Skip to content

Commit f1d7dd2

Browse files
committed
Add AttestationConveyancePreference.ENTERPRISE
1 parent 2f00c8e commit f1d7dd2

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ New features:
2727
some JCA providers to accept attestation certificates with critical
2828
certificate policy extensions. See the JavaDoc for
2929
`TrustRootsResultBuilder.policyTreeValidator(Predicate)` for more information.
30+
* Added enum value `AttestationConveyancePreference.ENTERPRISE`.
3031
* (Experimental) Added constant `AuthenticatorTransport.HYBRID`.
3132

3233
Fixes:

webauthn-server-core/src/main/java/com/yubico/webauthn/data/AttestationConveyancePreference.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,20 @@ public enum AttestationConveyancePreference {
7373
* Indicates that the Relying Party wants to receive the attestation statement as generated by the
7474
* authenticator.
7575
*/
76-
DIRECT("direct");
76+
DIRECT("direct"),
77+
78+
/**
79+
* This value indicates that the Relying Party wants to receive an attestation statement that may
80+
* include uniquely identifying information. This is intended for controlled deployments within an
81+
* enterprise where the organization wishes to tie registrations to specific authenticators. User
82+
* agents MUST NOT provide such an attestation unless the user agent or authenticator
83+
* configuration permits it for the requested RP ID.
84+
*
85+
* <p>If permitted, the user agent SHOULD signal to the authenticator (at invocation time) that
86+
* enterprise attestation is requested, and convey the resulting AAGUID and attestation statement,
87+
* unaltered, to the Relying Party.
88+
*/
89+
ENTERPRISE("enterprise");
7790

7891
@JsonValue @Getter @NonNull private final String value;
7992

webauthn-server-core/src/test/scala/com/yubico/webauthn/data/EnumsSpec.scala

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,34 @@ class EnumsSpec
2222

2323
describe("AttestationConveyancePreference") {
2424
describe("can be parsed from JSON") {
25+
it("""value: "none"""") {
26+
json.readValue(
27+
"\"none\"",
28+
classOf[AttestationConveyancePreference],
29+
) should be theSameInstanceAs AttestationConveyancePreference.NONE
30+
}
31+
32+
it("""value: "indirect"""") {
33+
json.readValue(
34+
"\"indirect\"",
35+
classOf[AttestationConveyancePreference],
36+
) should be theSameInstanceAs AttestationConveyancePreference.INDIRECT
37+
}
38+
39+
it("""value: "direct"""") {
40+
json.readValue(
41+
"\"direct\"",
42+
classOf[AttestationConveyancePreference],
43+
) should be theSameInstanceAs AttestationConveyancePreference.DIRECT
44+
}
45+
46+
it("""value: "enterprise"""") {
47+
json.readValue(
48+
"\"enterprise\"",
49+
classOf[AttestationConveyancePreference],
50+
) should be theSameInstanceAs AttestationConveyancePreference.ENTERPRISE
51+
}
52+
2553
it("but throws IllegalArgumentException for unknown values.") {
2654
val result = Try(
2755
json.readValue("\"foo\"", classOf[AttestationConveyancePreference])

0 commit comments

Comments
 (0)