Skip to content

Commit 157d79a

Browse files
committed
Test that Filters.notRetired() does not filter non-retired entries
For example, the test now detects if the filter implementation is changed to `(entry) -> false` which was not detected before.
1 parent c186ad8 commit 157d79a

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

webauthn-server-attestation/src/test/scala/com/yubico/fido/metadata/FidoMds3Spec.scala

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,9 @@ class FidoMds3Spec extends AnyFunSpec with Matchers {
10411041
val aaguidRetired =
10421042
new AAGUID(ByteArray.fromHex("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"))
10431043

1044+
val aaguidNotRetired =
1045+
new AAGUID(ByteArray.fromHex("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"))
1046+
10441047
val blob: MetadataBLOBPayload =
10451048
JacksonCodecs.jsonWithDefaultEnums.readValue(
10461049
s"""{
@@ -1070,6 +1073,27 @@ class FidoMds3Spec extends AnyFunSpec with Matchers {
10701073
{ "status": "RETIRED", "effectiveDate": "2022-02-01" }
10711074
],
10721075
"timeOfLastStatusChange": "2022-02-15"
1076+
},
1077+
{
1078+
"aaguid": "${aaguidNotRetired.asGuidString()}",
1079+
"attestationCertificateKeyIdentifiers": [],
1080+
"metadataStatement": {
1081+
"aaguid": "${aaguidNotRetired.asGuidString()}",
1082+
"authenticatorVersion": 1,
1083+
"attestationRootCertificates": [],
1084+
"attestationTypes" : ["basic_full"],
1085+
"authenticationAlgorithms" : ["secp256r1_ecdsa_sha256_raw"],
1086+
"keyProtection" : ["software"],
1087+
"matcherProtection" : ["software"],
1088+
"protocolFamily" : "u2f",
1089+
"publicKeyAlgAndEncodings" : ["ecc_x962_raw"],
1090+
"schema" : 3,
1091+
"tcDisplay" : [],
1092+
"upv" : [{ "major" : 1, "minor" : 1 }],
1093+
"userVerificationDetails" : [[{ "userVerificationMethod" : "presence_internal" }]]
1094+
},
1095+
"statusReports": [],
1096+
"timeOfLastStatusChange": "2022-02-15"
10731097
}
10741098
]
10751099
}""".stripMargin,
@@ -1082,6 +1106,9 @@ class FidoMds3Spec extends AnyFunSpec with Matchers {
10821106
mds
10831107
.findEntries(aaguidRetired)
10841108
.asScala should not be empty
1109+
mds
1110+
.findEntries(aaguidNotRetired)
1111+
.asScala should not be empty
10851112
}
10861113

10871114
it("can be enabled explicitly as a prefilter.") {
@@ -1094,6 +1121,9 @@ class FidoMds3Spec extends AnyFunSpec with Matchers {
10941121
mds
10951122
.findEntries(aaguidRetired)
10961123
.asScala shouldBe empty
1124+
mds
1125+
.findEntries(aaguidNotRetired)
1126+
.asScala should not be empty
10971127
}
10981128

10991129
}

0 commit comments

Comments
 (0)