-
Notifications
You must be signed in to change notification settings - Fork 155
MDS: Adjust SupportedCtapOptions parsing logic #419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
f4981f2
77a8af8
5bceb93
ad36a8b
0452830
f51c289
8a97204
6801734
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package com.yubico.fido.metadata; | ||
|
||
import com.fasterxml.jackson.annotation.JsonAlias; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Builder; | ||
import lombok.Value; | ||
import lombok.extern.jackson.Jacksonized; | ||
|
@@ -18,7 +18,6 @@ | |
@Value | ||
@Builder | ||
@Jacksonized | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class SupportedCtapOptions { | ||
|
||
/** | ||
|
@@ -157,4 +156,46 @@ public class SupportedCtapOptions { | |
* to Authenticator Protocol (CTAP) §6.4. authenticatorGetInfo (0x04)</a> | ||
*/ | ||
@Builder.Default boolean alwaysUv = false; | ||
|
||
@JsonCreator | ||
private SupportedCtapOptions( | ||
@JsonProperty("plat") Boolean plat, | ||
@JsonProperty("rk") Boolean rk, | ||
@JsonProperty("clientPin") Boolean clientPin, | ||
@JsonProperty("up") Boolean up, | ||
@JsonProperty("uv") Boolean uv, | ||
@JsonProperty("pinUvAuthToken") Boolean pinUvAuthToken, | ||
@JsonProperty("noMcGaPermissionsWithClientPin") Boolean noMcGaPermissionsWithClientPin, | ||
@JsonProperty("largeBlobs") Boolean largeBlobs, | ||
@JsonProperty("ep") Boolean ep, | ||
@JsonProperty("bioEnroll") Boolean bioEnroll, | ||
@JsonProperty("userVerificationMgmtPreview") Boolean userVerificationMgmtPreview, | ||
@JsonProperty("uvBioEnroll") Boolean uvBioEnroll, | ||
@JsonProperty("authnrCfg") Boolean authnrCfg, | ||
@JsonProperty("uvAcfg") Boolean uvAcfg, | ||
@JsonProperty("credMgmt") Boolean credMgmt, | ||
@JsonProperty("credentialMgmtPreview") Boolean credentialMgmtPreview, | ||
@JsonProperty("setMinPINLength") Boolean setMinPINLength, | ||
@JsonProperty("makeCredUvNotRqd") Boolean makeCredUvNotRqd, | ||
@JsonProperty("alwaysUv") Boolean alwaysUv) { | ||
this.plat = plat; | ||
this.rk = rk; | ||
this.clientPin = clientPin != null; | ||
this.up = up; | ||
fdennis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
this.uv = uv != null; | ||
this.pinUvAuthToken = Boolean.TRUE.equals(pinUvAuthToken); | ||
this.noMcGaPermissionsWithClientPin = Boolean.TRUE.equals(noMcGaPermissionsWithClientPin); | ||
this.largeBlobs = Boolean.TRUE.equals(largeBlobs); | ||
this.ep = ep != null; | ||
this.bioEnroll = bioEnroll != null; | ||
this.userVerificationMgmtPreview = userVerificationMgmtPreview != null; | ||
this.uvBioEnroll = Boolean.TRUE.equals(uvBioEnroll); | ||
this.authnrCfg = Boolean.TRUE.equals(authnrCfg); | ||
this.uvAcfg = Boolean.TRUE.equals(uvAcfg); | ||
this.credMgmt = Boolean.TRUE.equals(credMgmt); | ||
this.credentialMgmtPreview = Boolean.TRUE.equals(credentialMgmtPreview); | ||
this.setMinPINLength = Boolean.TRUE.equals(setMinPINLength); | ||
this.makeCredUvNotRqd = Boolean.TRUE.equals(makeCredUvNotRqd); | ||
this.alwaysUv = alwaysUv != null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like an |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to update the JavaDoc for
clientPin
since the behaviour here is no longer the same as in the CTAP spec.