You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: webauthn-server-core/src/test/scala/com/yubico/webauthn/RelyingPartyRegistrationSpec.scala
+58-40
Original file line number
Diff line number
Diff line change
@@ -1134,8 +1134,12 @@ class RelyingPartyRegistrationSpec
1134
1134
}
1135
1135
}
1136
1136
1137
-
it("Fails if credProtect is set with enforceCredentialProtectionPolicy=true and no output policy is returned.") {
1138
-
forAll { policy: CredentialProtectionPolicy=>
1137
+
it("Fails if credProtect is set with enforceCredentialProtectionPolicy=true and credProtectPolicy!=userVerificationOptional and no output policy is returned.") {
it("Fails if credProtect is set with enforceCredentialProtectionPolicy=true and credProtectPolicy!=userVerificationOptional and the output policy does not match the input policy.") {
it("Succeeds regardless of output credProtect policy if credProtect is set with enforceCredentialProtectionPolicy=false.") {
1194
-
forAll {
1201
+
it("Succeeds regardless of output credProtect policy if credProtect is set with enforceCredentialProtectionPolicy=false or credProtectPolicy=userVerificationOptional.") {
1202
+
valgenCredPropsInput=for {
1203
+
enforce <- arbitrary[Boolean]
1204
+
policy <-
1205
+
if (enforce) Gen.const(CredentialProtectionPolicy.UV_OPTIONAL)
1206
+
else arbitrary[CredentialProtectionPolicy]
1207
+
} yield {
1208
+
if (enforce) CredentialProtectionInput.require(policy)
1209
+
elseCredentialProtectionInput.prefer(policy)
1210
+
}
1211
+
forAll(
1212
+
genCredPropsInput,
1213
+
arbitrary[Option[CredentialProtectionPolicy]],
1214
+
) {
1195
1215
(
1196
-
inputPolicy: CredentialProtectionPolicy,
1216
+
credPropsInput: CredentialProtectionInput,
1197
1217
outputPolicy: Option[CredentialProtectionPolicy],
1198
1218
) =>
1199
1219
valauthenticatorExtensionOutputs=
@@ -1212,9 +1232,7 @@ class RelyingPartyRegistrationSpec
Copy file name to clipboardExpand all lines: webauthn-server-core/src/test/scala/com/yubico/webauthn/RelyingPartyV2RegistrationSpec.scala
+58-40
Original file line number
Diff line number
Diff line change
@@ -1126,8 +1126,12 @@ class RelyingPartyV2RegistrationSpec
1126
1126
}
1127
1127
}
1128
1128
1129
-
it("Fails if credProtect is set with enforceCredentialProtectionPolicy=true and no output policy is returned.") {
1130
-
forAll { policy: CredentialProtectionPolicy=>
1129
+
it("Fails if credProtect is set with enforceCredentialProtectionPolicy=true and credProtectPolicy!=userVerificationOptional and no output policy is returned.") {
it("Fails if credProtect is set with enforceCredentialProtectionPolicy=true and credProtectPolicy!=userVerificationOptional and the output policy does not match the input policy.") {
it("Succeeds regardless of output credProtect policy if credProtect is set with enforceCredentialProtectionPolicy=false.") {
1186
-
forAll {
1193
+
it("Succeeds regardless of output credProtect policy if credProtect is set with enforceCredentialProtectionPolicy=false or credProtectPolicy=userVerificationOptional.") {
1194
+
valgenCredPropsInput=for {
1195
+
enforce <- arbitrary[Boolean]
1196
+
policy <-
1197
+
if (enforce) Gen.const(CredentialProtectionPolicy.UV_OPTIONAL)
1198
+
else arbitrary[CredentialProtectionPolicy]
1199
+
} yield {
1200
+
if (enforce) CredentialProtectionInput.require(policy)
1201
+
elseCredentialProtectionInput.prefer(policy)
1202
+
}
1203
+
forAll(
1204
+
genCredPropsInput,
1205
+
arbitrary[Option[CredentialProtectionPolicy]],
1206
+
) {
1187
1207
(
1188
-
inputPolicy: CredentialProtectionPolicy,
1208
+
credPropsInput: CredentialProtectionInput,
1189
1209
outputPolicy: Option[CredentialProtectionPolicy],
1190
1210
) =>
1191
1211
valauthenticatorExtensionOutputs=
@@ -1204,9 +1224,7 @@ class RelyingPartyV2RegistrationSpec
0 commit comments