1 | package com.yubico.fido.metadata; | |
2 | ||
3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
4 | import com.fasterxml.jackson.core.JacksonException; | |
5 | import com.fasterxml.jackson.core.JsonGenerator; | |
6 | import com.fasterxml.jackson.core.JsonParser; | |
7 | import com.fasterxml.jackson.databind.DeserializationContext; | |
8 | import com.fasterxml.jackson.databind.JsonDeserializer; | |
9 | import com.fasterxml.jackson.databind.JsonSerializer; | |
10 | import com.fasterxml.jackson.databind.SerializerProvider; | |
11 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | |
12 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; | |
13 | import com.yubico.webauthn.data.AuthenticatorTransport; | |
14 | import com.yubico.webauthn.data.PublicKeyCredentialParameters; | |
15 | import com.yubico.webauthn.extension.uvm.UserVerificationMethod; | |
16 | import java.io.IOException; | |
17 | import java.util.Arrays; | |
18 | import java.util.List; | |
19 | import java.util.Map; | |
20 | import java.util.Optional; | |
21 | import java.util.Set; | |
22 | import java.util.stream.Collectors; | |
23 | import java.util.stream.Stream; | |
24 | import lombok.Builder; | |
25 | import lombok.NonNull; | |
26 | import lombok.Value; | |
27 | import lombok.extern.jackson.Jacksonized; | |
28 | ||
29 | /** | |
30 | * This dictionary describes supported versions, extensions, AAGUID of the device and its | |
31 | * capabilities. | |
32 | * | |
33 | * <p>See: <a | |
34 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
35 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
36 | * | |
37 | * @see <a | |
38 | * href="https://fidoalliance.org/specs/mds/fido-metadata-statement-v3.0-ps-20210518.html#authenticatorgetinfo-dictionary">FIDO | |
39 | * Metadata Statement §3.12. AuthenticatorGetInfo dictionary</a> | |
40 | * @see <a | |
41 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
42 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
43 | */ | |
44 | @Value | |
45 | @Builder(toBuilder = true) | |
46 | @Jacksonized | |
47 | @JsonIgnoreProperties({ | |
48 | "maxAuthenticatorConfigLength", | |
49 | "defaultCredProtect" | |
50 | }) // Present in example but not defined | |
51 | public class AuthenticatorGetInfo { | |
52 | ||
53 | /** | |
54 | * @see <a | |
55 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
56 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
57 | */ | |
58 | @NonNull Set<CtapVersion> versions; | |
59 | ||
60 | /** | |
61 | * @see <a | |
62 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
63 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
64 | */ | |
65 | Set<String> extensions; | |
66 | ||
67 | /** | |
68 | * @see <a | |
69 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
70 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
71 | */ | |
72 | AAGUID aaguid; | |
73 | ||
74 | /** | |
75 | * @see <a | |
76 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
77 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
78 | */ | |
79 | SupportedCtapOptions options; | |
80 | ||
81 | /** | |
82 | * @see <a | |
83 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
84 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
85 | */ | |
86 | Integer maxMsgSize; | |
87 | ||
88 | /** | |
89 | * @see <a | |
90 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
91 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
92 | */ | |
93 | Set<CtapPinUvAuthProtocolVersion> pinUvAuthProtocols; | |
94 | ||
95 | /** | |
96 | * @see <a | |
97 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
98 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
99 | */ | |
100 | Integer maxCredentialCountInList; | |
101 | ||
102 | /** | |
103 | * @see <a | |
104 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
105 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
106 | */ | |
107 | Integer maxCredentialIdLength; | |
108 | ||
109 | /** | |
110 | * @see <a | |
111 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
112 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
113 | */ | |
114 | Set<AuthenticatorTransport> transports; | |
115 | ||
116 | /** | |
117 | * @see <a | |
118 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
119 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
120 | */ | |
121 | @JsonDeserialize(using = ListPublicKeyCredentialParametersIgnoringUnknownValuesDeserializer.class) | |
122 | List<PublicKeyCredentialParameters> algorithms; | |
123 | ||
124 | /** | |
125 | * @see <a | |
126 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
127 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
128 | */ | |
129 | Integer maxSerializedLargeBlobArray; | |
130 | ||
131 | /** | |
132 | * @see <a | |
133 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
134 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
135 | */ | |
136 | Boolean forcePINChange; | |
137 | ||
138 | /** | |
139 | * @see <a | |
140 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
141 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
142 | */ | |
143 | Integer minPINLength; | |
144 | ||
145 | /** | |
146 | * @see <a | |
147 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
148 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
149 | */ | |
150 | Integer firmwareVersion; | |
151 | ||
152 | /** | |
153 | * @see <a | |
154 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
155 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
156 | */ | |
157 | Integer maxCredBlobLength; | |
158 | ||
159 | /** | |
160 | * @see <a | |
161 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
162 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
163 | */ | |
164 | Integer maxRPIDsForSetMinPINLength; | |
165 | ||
166 | /** | |
167 | * @see <a | |
168 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
169 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
170 | */ | |
171 | Integer preferredPlatformUvAttempts; | |
172 | ||
173 | @JsonDeserialize(using = SetFromIntJsonDeserializer.class) | |
174 | @JsonSerialize(contentUsing = IntFromSetJsonSerializer.class) | |
175 | Set<UserVerificationMethod> uvModality; | |
176 | ||
177 | Map<CtapCertificationId, Integer> certifications; | |
178 | Integer remainingDiscoverableCredentials; | |
179 | Set<Integer> vendorPrototypeConfigCommands; | |
180 | ||
181 | /** | |
182 | * @see <a | |
183 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
184 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
185 | */ | |
186 | public Optional<Set<String>> getExtensions() { | |
187 |
1
1. getExtensions : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getExtensions → SURVIVED |
return Optional.ofNullable(extensions); |
188 | } | |
189 | ||
190 | /** | |
191 | * @see <a | |
192 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
193 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
194 | */ | |
195 | public Optional<AAGUID> getAaguid() { | |
196 |
1
1. getAaguid : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getAaguid → SURVIVED |
return Optional.ofNullable(aaguid); |
197 | } | |
198 | ||
199 | /** | |
200 | * @see <a | |
201 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
202 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
203 | */ | |
204 | public Optional<SupportedCtapOptions> getOptions() { | |
205 |
1
1. getOptions : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getOptions → SURVIVED |
return Optional.ofNullable(options); |
206 | } | |
207 | ||
208 | /** | |
209 | * @see <a | |
210 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
211 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
212 | */ | |
213 | public Optional<Integer> getMaxMsgSize() { | |
214 |
1
1. getMaxMsgSize : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxMsgSize → SURVIVED |
return Optional.ofNullable(maxMsgSize); |
215 | } | |
216 | ||
217 | /** | |
218 | * @see <a | |
219 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
220 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
221 | */ | |
222 | public Optional<Set<CtapPinUvAuthProtocolVersion>> getPinUvAuthProtocols() { | |
223 |
1
1. getPinUvAuthProtocols : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getPinUvAuthProtocols → SURVIVED |
return Optional.ofNullable(pinUvAuthProtocols); |
224 | } | |
225 | ||
226 | /** | |
227 | * @see <a | |
228 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
229 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
230 | */ | |
231 | public Optional<Integer> getMaxCredentialCountInList() { | |
232 |
1
1. getMaxCredentialCountInList : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxCredentialCountInList → SURVIVED |
return Optional.ofNullable(maxCredentialCountInList); |
233 | } | |
234 | ||
235 | /** | |
236 | * @see <a | |
237 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
238 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
239 | */ | |
240 | public Optional<Integer> getMaxCredentialIdLength() { | |
241 |
1
1. getMaxCredentialIdLength : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxCredentialIdLength → SURVIVED |
return Optional.ofNullable(maxCredentialIdLength); |
242 | } | |
243 | ||
244 | /** | |
245 | * @see <a | |
246 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
247 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
248 | */ | |
249 | public Optional<Set<AuthenticatorTransport>> getTransports() { | |
250 |
1
1. getTransports : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getTransports → SURVIVED |
return Optional.ofNullable(transports); |
251 | } | |
252 | ||
253 | /** | |
254 | * @see <a | |
255 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
256 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
257 | */ | |
258 | public Optional<List<PublicKeyCredentialParameters>> getAlgorithms() { | |
259 |
1
1. getAlgorithms : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getAlgorithms → SURVIVED |
return Optional.ofNullable(algorithms); |
260 | } | |
261 | ||
262 | /** | |
263 | * @see <a | |
264 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
265 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
266 | */ | |
267 | public Optional<Integer> getMaxSerializedLargeBlobArray() { | |
268 |
1
1. getMaxSerializedLargeBlobArray : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxSerializedLargeBlobArray → SURVIVED |
return Optional.ofNullable(maxSerializedLargeBlobArray); |
269 | } | |
270 | ||
271 | /** | |
272 | * @see <a | |
273 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
274 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
275 | */ | |
276 | public Optional<Boolean> getForcePINChange() { | |
277 |
1
1. getForcePINChange : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getForcePINChange → SURVIVED |
return Optional.ofNullable(forcePINChange); |
278 | } | |
279 | ||
280 | /** | |
281 | * @see <a | |
282 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
283 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
284 | */ | |
285 | public Optional<Integer> getMinPINLength() { | |
286 |
1
1. getMinPINLength : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMinPINLength → SURVIVED |
return Optional.ofNullable(minPINLength); |
287 | } | |
288 | ||
289 | /** | |
290 | * @see <a | |
291 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
292 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
293 | */ | |
294 | public Optional<Integer> getFirmwareVersion() { | |
295 |
1
1. getFirmwareVersion : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getFirmwareVersion → SURVIVED |
return Optional.ofNullable(firmwareVersion); |
296 | } | |
297 | ||
298 | /** | |
299 | * @see <a | |
300 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
301 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
302 | */ | |
303 | public Optional<Integer> getMaxCredBlobLength() { | |
304 |
1
1. getMaxCredBlobLength : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxCredBlobLength → SURVIVED |
return Optional.ofNullable(maxCredBlobLength); |
305 | } | |
306 | ||
307 | /** | |
308 | * @see <a | |
309 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
310 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
311 | */ | |
312 | public Optional<Integer> getMaxRPIDsForSetMinPINLength() { | |
313 |
1
1. getMaxRPIDsForSetMinPINLength : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getMaxRPIDsForSetMinPINLength → SURVIVED |
return Optional.ofNullable(maxRPIDsForSetMinPINLength); |
314 | } | |
315 | ||
316 | /** | |
317 | * @see <a | |
318 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
319 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
320 | */ | |
321 | public Optional<Integer> getPreferredPlatformUvAttempts() { | |
322 |
1
1. getPreferredPlatformUvAttempts : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getPreferredPlatformUvAttempts → SURVIVED |
return Optional.ofNullable(preferredPlatformUvAttempts); |
323 | } | |
324 | ||
325 | /** | |
326 | * @see <a | |
327 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
328 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
329 | */ | |
330 | public Optional<Set<UserVerificationMethod>> getUvModality() { | |
331 |
1
1. getUvModality : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getUvModality → SURVIVED |
return Optional.ofNullable(uvModality); |
332 | } | |
333 | ||
334 | /** | |
335 | * @see <a | |
336 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
337 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
338 | */ | |
339 | public Optional<Map<CtapCertificationId, Integer>> getCertifications() { | |
340 |
1
1. getCertifications : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getCertifications → SURVIVED |
return Optional.ofNullable(certifications); |
341 | } | |
342 | ||
343 | /** | |
344 | * @see <a | |
345 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
346 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
347 | */ | |
348 | public Optional<Integer> getRemainingDiscoverableCredentials() { | |
349 |
1
1. getRemainingDiscoverableCredentials : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getRemainingDiscoverableCredentials → SURVIVED |
return Optional.ofNullable(remainingDiscoverableCredentials); |
350 | } | |
351 | ||
352 | /** | |
353 | * @see <a | |
354 | * href="https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#authenticatorGetInfo">Client | |
355 | * to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | |
356 | */ | |
357 | public Optional<Set<Integer>> getVendorPrototypeConfigCommands() { | |
358 |
1
1. getVendorPrototypeConfigCommands : replaced return value with Optional.empty for com/yubico/fido/metadata/AuthenticatorGetInfo::getVendorPrototypeConfigCommands → SURVIVED |
return Optional.ofNullable(vendorPrototypeConfigCommands); |
359 | } | |
360 | ||
361 | private static class SetFromIntJsonDeserializer | |
362 | extends JsonDeserializer<Set<UserVerificationMethod>> { | |
363 | @Override | |
364 | public Set<UserVerificationMethod> deserialize(JsonParser p, DeserializationContext ctxt) | |
365 | throws IOException { | |
366 | final int bitset = p.getNumberValue().intValue(); | |
367 |
1
1. deserialize : replaced return value with Collections.emptySet for com/yubico/fido/metadata/AuthenticatorGetInfo$SetFromIntJsonDeserializer::deserialize → KILLED |
return Arrays.stream(UserVerificationMethod.values()) |
368 |
3
1. lambda$deserialize$0 : Replaced bitwise AND with OR → KILLED 2. lambda$deserialize$0 : negated conditional → KILLED 3. lambda$deserialize$0 : replaced boolean return with true for com/yubico/fido/metadata/AuthenticatorGetInfo$SetFromIntJsonDeserializer::lambda$deserialize$0 → KILLED |
.filter(uvm -> (uvm.getValue() & bitset) != 0) |
369 | .collect(Collectors.toSet()); | |
370 | } | |
371 | } | |
372 | ||
373 | private static class IntFromSetJsonSerializer | |
374 | extends JsonSerializer<Set<UserVerificationMethod>> { | |
375 | @Override | |
376 | public void serialize( | |
377 | Set<UserVerificationMethod> value, JsonGenerator gen, SerializerProvider serializers) | |
378 | throws IOException { | |
379 |
1
1. serialize : removed call to com/fasterxml/jackson/core/JsonGenerator::writeNumber → KILLED |
gen.writeNumber( |
380 |
4
1. lambda$serialize$1 : Replaced bitwise OR with AND → NO_COVERAGE 2. lambda$serialize$1 : replaced Integer return value with 0 for com/yubico/fido/metadata/AuthenticatorGetInfo$IntFromSetJsonSerializer::lambda$serialize$1 → NO_COVERAGE 3. lambda$serialize$0 : replaced Integer return value with 0 for com/yubico/fido/metadata/AuthenticatorGetInfo$IntFromSetJsonSerializer::lambda$serialize$0 → KILLED 4. lambda$serialize$0 : Replaced bitwise OR with AND → KILLED |
value.stream().reduce(0, (acc, next) -> acc | next.getValue(), (a, b) -> a | b)); |
381 | } | |
382 | } | |
383 | ||
384 | @Value | |
385 | @JsonDeserialize(using = PublicKeyCredentialParametersIgnoringUnknownValues.Deserializer.class) | |
386 | private static class PublicKeyCredentialParametersIgnoringUnknownValues { | |
387 | PublicKeyCredentialParameters value; | |
388 | ||
389 | private static class Deserializer | |
390 | extends JsonDeserializer<PublicKeyCredentialParametersIgnoringUnknownValues> { | |
391 | @Override | |
392 | public PublicKeyCredentialParametersIgnoringUnknownValues deserialize( | |
393 | JsonParser p, DeserializationContext ctxt) throws IOException, JacksonException { | |
394 | try { | |
395 |
1
1. deserialize : replaced return value with null for com/yubico/fido/metadata/AuthenticatorGetInfo$PublicKeyCredentialParametersIgnoringUnknownValues$Deserializer::deserialize → KILLED |
return new PublicKeyCredentialParametersIgnoringUnknownValues( |
396 | p.readValueAs(PublicKeyCredentialParameters.class)); | |
397 | } catch (IOException e) { | |
398 | return null; | |
399 | } | |
400 | } | |
401 | } | |
402 | } | |
403 | ||
404 | private static class ListPublicKeyCredentialParametersIgnoringUnknownValuesDeserializer | |
405 | extends JsonDeserializer<List<PublicKeyCredentialParameters>> { | |
406 | @Override | |
407 | public List<PublicKeyCredentialParameters> deserialize( | |
408 | JsonParser p, DeserializationContext ctxt) throws IOException { | |
409 | PublicKeyCredentialParametersIgnoringUnknownValues[] pkcpiuvs = | |
410 | p.readValueAs(PublicKeyCredentialParametersIgnoringUnknownValues[].class); | |
411 |
1
1. deserialize : replaced return value with Collections.emptyList for com/yubico/fido/metadata/AuthenticatorGetInfo$ListPublicKeyCredentialParametersIgnoringUnknownValuesDeserializer::deserialize → KILLED |
return Arrays.stream(pkcpiuvs) |
412 | .flatMap( | |
413 | pkcpiuv -> { | |
414 |
2
1. lambda$deserialize$0 : negated conditional → KILLED 2. lambda$deserialize$0 : negated conditional → KILLED |
if (pkcpiuv != null && pkcpiuv.value != null) { |
415 |
1
1. lambda$deserialize$0 : replaced return value with Stream.empty for com/yubico/fido/metadata/AuthenticatorGetInfo$ListPublicKeyCredentialParametersIgnoringUnknownValuesDeserializer::lambda$deserialize$0 → KILLED |
return Stream.of(pkcpiuv.value); |
416 | } else { | |
417 | return Stream.empty(); | |
418 | } | |
419 | }) | |
420 | .collect(Collectors.toList()); | |
421 | } | |
422 | } | |
423 | } | |
Mutations | ||
187 |
1.1 |
|
196 |
1.1 |
|
205 |
1.1 |
|
214 |
1.1 |
|
223 |
1.1 |
|
232 |
1.1 |
|
241 |
1.1 |
|
250 |
1.1 |
|
259 |
1.1 |
|
268 |
1.1 |
|
277 |
1.1 |
|
286 |
1.1 |
|
295 |
1.1 |
|
304 |
1.1 |
|
313 |
1.1 |
|
322 |
1.1 |
|
331 |
1.1 |
|
340 |
1.1 |
|
349 |
1.1 |
|
358 |
1.1 |
|
367 |
1.1 |
|
368 |
1.1 2.2 3.3 |
|
379 |
1.1 |
|
380 |
1.1 2.2 3.3 4.4 |
|
395 |
1.1 |
|
411 |
1.1 |
|
414 |
1.1 2.2 |
|
415 |
1.1 |