|
1 | 1 | package com.yubico.fido.metadata;
|
2 | 2 |
|
3 | 3 | import com.fasterxml.jackson.annotation.JsonAlias;
|
4 |
| -import lombok.AccessLevel; |
5 |
| -import lombok.AllArgsConstructor; |
| 4 | +import com.fasterxml.jackson.annotation.JsonCreator; |
| 5 | +import com.fasterxml.jackson.annotation.JsonInclude; |
| 6 | +import com.fasterxml.jackson.annotation.JsonProperty; |
6 | 7 | import lombok.Builder;
|
7 | 8 | import lombok.Value;
|
8 |
| -import lombok.extern.jackson.Jacksonized; |
9 | 9 |
|
10 | 10 | /**
|
11 | 11 | * A fixed-keys map of CTAP2 option names to Boolean values representing whether an authenticator
|
12 | 12 | * supports the respective option.
|
13 | 13 | *
|
14 | 14 | * @see <a
|
15 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 15 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
16 | 16 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
17 | 17 | */
|
18 | 18 | @Value
|
19 | 19 | @Builder
|
20 |
| -@Jacksonized |
21 |
| -@AllArgsConstructor(access = AccessLevel.PRIVATE) |
22 | 20 | public class SupportedCtapOptions {
|
23 | 21 |
|
24 | 22 | /**
|
25 | 23 | * @see <a
|
26 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 24 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
27 | 25 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
28 | 26 | */
|
29 |
| - @Builder.Default boolean plat = false; |
| 27 | + boolean plat; |
30 | 28 |
|
31 | 29 | /**
|
32 | 30 | * @see <a
|
33 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 31 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
34 | 32 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
35 | 33 | */
|
36 |
| - @Builder.Default boolean rk = false; |
| 34 | + boolean rk; |
37 | 35 |
|
38 | 36 | /**
|
| 37 | + * If set to <code>true</code> the device is capable of accepting PIN. |
| 38 | + * |
39 | 39 | * @see <a
|
40 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 40 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
41 | 41 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
42 | 42 | */
|
43 |
| - @Builder.Default boolean clientPin = false; |
| 43 | + @JsonInclude(JsonInclude.Include.NON_DEFAULT) |
| 44 | + boolean clientPin; |
44 | 45 |
|
45 | 46 | /**
|
46 | 47 | * @see <a
|
47 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 48 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
48 | 49 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
49 | 50 | */
|
50 |
| - @Builder.Default boolean up = false; |
| 51 | + boolean up; |
51 | 52 |
|
52 | 53 | /**
|
| 54 | + * If set to <code>true</code> the device is capable of built-in user verification. |
| 55 | + * |
53 | 56 | * @see <a
|
54 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 57 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
55 | 58 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
56 | 59 | */
|
57 |
| - @Builder.Default boolean uv = false; |
| 60 | + @JsonInclude(JsonInclude.Include.NON_DEFAULT) |
| 61 | + boolean uv; |
58 | 62 |
|
59 | 63 | /**
|
60 | 64 | * @see <a
|
61 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 65 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
62 | 66 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
63 | 67 | */
|
64 |
| - @JsonAlias("uvToken") |
65 |
| - @Builder.Default |
66 |
| - boolean pinUvAuthToken = false; |
| 68 | + boolean pinUvAuthToken; |
67 | 69 |
|
68 | 70 | /**
|
69 | 71 | * @see <a
|
70 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 72 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
71 | 73 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
72 | 74 | */
|
73 |
| - @Builder.Default boolean noMcGaPermissionsWithClientPin = false; |
| 75 | + boolean noMcGaPermissionsWithClientPin; |
74 | 76 |
|
75 | 77 | /**
|
76 | 78 | * @see <a
|
77 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 79 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
78 | 80 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
79 | 81 | */
|
80 |
| - @Builder.Default boolean largeBlobs = false; |
| 82 | + boolean largeBlobs; |
81 | 83 |
|
82 | 84 | /**
|
| 85 | + * If set to <code>true</code> the authenticator is enterprise attestation capable. |
| 86 | + * |
83 | 87 | * @see <a
|
84 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 88 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
85 | 89 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
86 | 90 | */
|
87 |
| - @Builder.Default boolean ep = false; |
| 91 | + @JsonInclude(JsonInclude.Include.NON_DEFAULT) |
| 92 | + boolean ep; |
88 | 93 |
|
89 | 94 | /**
|
| 95 | + * If set to <code>true</code> the authenticator supports the authenticatorBioEnrollment commands. |
| 96 | + * |
90 | 97 | * @see <a
|
91 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 98 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
92 | 99 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
93 | 100 | */
|
94 |
| - @Builder.Default boolean bioEnroll = false; |
| 101 | + @JsonInclude(JsonInclude.Include.NON_DEFAULT) |
| 102 | + boolean bioEnroll; |
95 | 103 |
|
96 | 104 | /**
|
| 105 | + * If set to <code>true</code> the authenticator supports the Prototype authenticatorBioEnrollment |
| 106 | + * (0x40) commands. |
| 107 | + * |
97 | 108 | * @see <a
|
98 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 109 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
99 | 110 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
100 | 111 | */
|
101 |
| - @Builder.Default boolean userVerificationMgmtPreview = false; |
| 112 | + @JsonInclude(JsonInclude.Include.NON_DEFAULT) |
| 113 | + boolean userVerificationMgmtPreview; |
102 | 114 |
|
103 | 115 | /**
|
104 | 116 | * @see <a
|
105 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 117 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
106 | 118 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
107 | 119 | */
|
108 |
| - @Builder.Default boolean uvBioEnroll = false; |
| 120 | + boolean uvBioEnroll; |
109 | 121 |
|
110 | 122 | /**
|
111 | 123 | * @see <a
|
112 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 124 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
113 | 125 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
114 | 126 | */
|
115 |
| - @JsonAlias("config") |
116 |
| - @Builder.Default |
117 |
| - boolean authnrCfg = false; |
| 127 | + boolean authnrCfg; |
118 | 128 |
|
119 | 129 | /**
|
120 | 130 | * @see <a
|
121 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 131 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
122 | 132 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
123 | 133 | */
|
124 |
| - @Builder.Default boolean uvAcfg = false; |
| 134 | + boolean uvAcfg; |
125 | 135 |
|
126 | 136 | /**
|
127 | 137 | * @see <a
|
128 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 138 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
129 | 139 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
130 | 140 | */
|
131 |
| - @Builder.Default boolean credMgmt = false; |
| 141 | + boolean credMgmt; |
132 | 142 |
|
133 | 143 | /**
|
134 | 144 | * @see <a
|
135 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 145 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
136 | 146 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
137 | 147 | */
|
138 |
| - @Builder.Default boolean credentialMgmtPreview = false; |
| 148 | + boolean perCredMgmtRO; |
139 | 149 |
|
140 | 150 | /**
|
141 | 151 | * @see <a
|
142 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 152 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
143 | 153 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
144 | 154 | */
|
145 |
| - @Builder.Default boolean setMinPINLength = false; |
| 155 | + @JsonInclude(JsonInclude.Include.NON_DEFAULT) |
| 156 | + boolean credentialMgmtPreview; |
146 | 157 |
|
147 | 158 | /**
|
148 | 159 | * @see <a
|
149 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 160 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
150 | 161 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
151 | 162 | */
|
152 |
| - @Builder.Default boolean makeCredUvNotRqd = false; |
| 163 | + boolean setMinPINLength; |
153 | 164 |
|
154 | 165 | /**
|
155 | 166 | * @see <a
|
156 |
| - * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client |
| 167 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
157 | 168 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a>
|
158 | 169 | */
|
159 |
| - @Builder.Default boolean alwaysUv = false; |
| 170 | + boolean makeCredUvNotRqd; |
| 171 | + |
| 172 | + /** |
| 173 | + * If set to <code>true</code> the authenticator supports the Always Require User Verification |
| 174 | + * feature. |
| 175 | + * |
| 176 | + * @see <a |
| 177 | + * href="https://fidoalliance.org/specs/fido-v2.2-ps-20250228/fido-client-to-authenticator-protocol-v2.2-ps-20250228.html#authenticatorGetInfo">Client |
| 178 | + * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> |
| 179 | + */ |
| 180 | + @JsonInclude(JsonInclude.Include.NON_DEFAULT) |
| 181 | + boolean alwaysUv; |
| 182 | + |
| 183 | + @JsonCreator |
| 184 | + private SupportedCtapOptions( |
| 185 | + @JsonProperty("plat") Boolean plat, |
| 186 | + @JsonProperty("rk") Boolean rk, |
| 187 | + @JsonProperty("clientPin") Boolean clientPin, |
| 188 | + @JsonProperty("up") Boolean up, |
| 189 | + @JsonProperty("uv") Boolean uv, |
| 190 | + @JsonAlias("uvToken") @JsonProperty("pinUvAuthToken") Boolean pinUvAuthToken, |
| 191 | + @JsonProperty("noMcGaPermissionsWithClientPin") Boolean noMcGaPermissionsWithClientPin, |
| 192 | + @JsonProperty("largeBlobs") Boolean largeBlobs, |
| 193 | + @JsonProperty("ep") Boolean ep, |
| 194 | + @JsonProperty("bioEnroll") Boolean bioEnroll, |
| 195 | + @JsonProperty("userVerificationMgmtPreview") Boolean userVerificationMgmtPreview, |
| 196 | + @JsonProperty("uvBioEnroll") Boolean uvBioEnroll, |
| 197 | + @JsonAlias("config") @JsonProperty("authnrCfg") Boolean authnrCfg, |
| 198 | + @JsonProperty("uvAcfg") Boolean uvAcfg, |
| 199 | + @JsonProperty("credMgmt") Boolean credMgmt, |
| 200 | + @JsonProperty("perCredMgmtRO") Boolean perCredMgmtRO, |
| 201 | + @JsonProperty("credentialMgmtPreview") Boolean credentialMgmtPreview, |
| 202 | + @JsonProperty("setMinPINLength") Boolean setMinPINLength, |
| 203 | + @JsonProperty("makeCredUvNotRqd") Boolean makeCredUvNotRqd, |
| 204 | + @JsonProperty("alwaysUv") Boolean alwaysUv) { |
| 205 | + this.plat = Boolean.TRUE.equals(plat); |
| 206 | + this.rk = Boolean.TRUE.equals(rk); |
| 207 | + this.clientPin = clientPin != null; |
| 208 | + this.up = Boolean.TRUE.equals(up); |
| 209 | + this.uv = uv != null; |
| 210 | + this.pinUvAuthToken = Boolean.TRUE.equals(pinUvAuthToken); |
| 211 | + this.noMcGaPermissionsWithClientPin = Boolean.TRUE.equals(noMcGaPermissionsWithClientPin); |
| 212 | + this.largeBlobs = Boolean.TRUE.equals(largeBlobs); |
| 213 | + this.ep = ep != null; |
| 214 | + this.bioEnroll = bioEnroll != null; |
| 215 | + this.userVerificationMgmtPreview = userVerificationMgmtPreview != null; |
| 216 | + this.uvBioEnroll = Boolean.TRUE.equals(uvBioEnroll); |
| 217 | + this.authnrCfg = Boolean.TRUE.equals(authnrCfg); |
| 218 | + this.uvAcfg = Boolean.TRUE.equals(uvAcfg); |
| 219 | + this.credMgmt = Boolean.TRUE.equals(credMgmt); |
| 220 | + this.perCredMgmtRO = Boolean.TRUE.equals(perCredMgmtRO); |
| 221 | + this.credentialMgmtPreview = Boolean.TRUE.equals(credentialMgmtPreview); |
| 222 | + this.setMinPINLength = Boolean.TRUE.equals(setMinPINLength); |
| 223 | + this.makeCredUvNotRqd = Boolean.TRUE.equals(makeCredUvNotRqd); |
| 224 | + this.alwaysUv = alwaysUv != null; |
| 225 | + } |
160 | 226 | }
|
0 commit comments