8787 *
8888 * <p>Use the {@link #builder() builder} to configure settings, then use the {@link
8989 * #findEntries(List, AAGUID)} method or its overloads to retrieve metadata entries.
90+ *
91+ * @since 2.0.0
9092 */
9193@ Slf4j
9294public final class FidoMetadataService implements AttestationTrustSource {
@@ -234,6 +236,7 @@ public static class Step1 {
234236 *
235237 * <p>This is an alias of <code>useBlob(blob.getPayload()</code>.
236238 *
239+ * @since 2.0.0
237240 * @see FidoMetadataDownloader#loadCachedBlob()
238241 * @see #useBlob(MetadataBLOBPayload)
239242 */
@@ -247,6 +250,7 @@ public FidoMetadataServiceBuilder useBlob(@NonNull MetadataBLOB blob) {
247250 * <p>The {@link FidoMetadataDownloader#loadCachedBlob()} method returns a value whose {@link
248251 * MetadataBLOB#getPayload() .getPayload()} result is suitable for use here.
249252 *
253+ * @since 2.0.0
250254 * @see FidoMetadataDownloader#loadCachedBlob()
251255 * @see #useBlob(MetadataBLOB)
252256 */
@@ -263,9 +267,12 @@ public FidoMetadataServiceBuilder useBlob(@NonNull MetadataBLOBPayload blobPaylo
263267 *
264268 * <p>The default is {@link Filters#notRevoked() Filters.notRevoked()}. Setting a different
265269 * filter overrides this default; to preserve the "not revoked" condition in addition to the new
266- * filter, you must explicitly include the condition in the few filter. For example, by using
267- * {@link Filters#allOf(Predicate[]) Filters.allOf(Predicate...)}.
270+ * filter, you must explicitly include the condition in the new filter, for example by using
271+ * {@link Filters#allOf(Predicate[]) Filters.allOf(Predicate...)}. To add the {@link
272+ * Filters#notRetired() Filters.notRetired()} filter, use: <code>
273+ * .prefilter(Filters.allOf(Filters.notRevoked(), Filters.notRetired()))</code>.
268274 *
275+ * @since 2.0.0
269276 * @param prefilter a {@link Predicate} which returns <code>true</code> for metadata entries to
270277 * include in the data source.
271278 * @see #filter(Predicate)
@@ -300,6 +307,7 @@ public FidoMetadataServiceBuilder prefilter(
300307 * @param filter a {@link Predicate} which returns <code>true</code> for metadata entries to
301308 * allow for the corresponding authenticator during credential registration and metadata
302309 * lookup.
310+ * @since 2.0.0
303311 * @see #prefilter(Predicate)
304312 * @see AuthenticatorToBeFiltered
305313 * @see Filters#allOf(Predicate[])
@@ -318,6 +326,7 @@ public FidoMetadataServiceBuilder filter(
318326 *
319327 * @param certStore a {@link CertStore} of additional CRLs and/or intermediate certificates to
320328 * use while validating attestation certificate paths.
329+ * @since 2.0.0
321330 */
322331 public FidoMetadataServiceBuilder certStore (@ NonNull CertStore certStore ) {
323332 this .certStore = certStore ;
@@ -345,6 +354,7 @@ public FidoMetadataService build()
345354 * FidoMetadataServiceBuilder#prefilter(Predicate) prefilter} and {@link
346355 * FidoMetadataServiceBuilder#filter(Predicate) filter} settings.
347356 *
357+ * @since 2.0.0
348358 * @see FidoMetadataServiceBuilder#prefilter(Predicate)
349359 * @see FidoMetadataServiceBuilder#filter(Predicate)
350360 */
@@ -358,6 +368,7 @@ public static class Filters {
358368 * @param filters A set of filters.
359369 * @return A filter which only accepts inputs that satisfy ALL of the given <code>
360370 * filters</code>.
371+ * @since 2.0.0
361372 */
362373 @ SafeVarargs
363374 public static <T > Predicate <T > allOf (Predicate <T >... filters ) {
@@ -369,6 +380,7 @@ public static <T> Predicate<T> allOf(Predicate<T>... filters) {
369380 * statusReports} array contains no entry with {@link AuthenticatorStatus#REVOKED REVOKED}
370381 * status.
371382 *
383+ * @since 2.0.0
372384 * @see AuthenticatorStatus#REVOKED
373385 */
374386 public static Predicate <MetadataBLOBPayloadEntry > notRevoked () {
@@ -378,6 +390,21 @@ public static Predicate<MetadataBLOBPayloadEntry> notRevoked() {
378390 statusReport -> AuthenticatorStatus .REVOKED .equals (statusReport .getStatus ()));
379391 }
380392
393+ /**
394+ * Include any metadata entry whose {@link MetadataBLOBPayloadEntry#getStatusReports()
395+ * statusReports} array contains no entry with {@link AuthenticatorStatus#RETIRED RETIRED}
396+ * status.
397+ *
398+ * @since 2.9.0
399+ * @see AuthenticatorStatus#RETIRED
400+ */
401+ public static Predicate <MetadataBLOBPayloadEntry > notRetired () {
402+ return (entry ) ->
403+ entry .getStatusReports ().stream ()
404+ .noneMatch (
405+ statusReport -> AuthenticatorStatus .RETIRED .equals (statusReport .getStatus ()));
406+ }
407+
381408 /**
382409 * Accept any authenticator whose matched metadata entry does NOT indicate a compromised
383410 * attestation key.
@@ -390,6 +417,7 @@ public static Predicate<MetadataBLOBPayloadEntry> notRevoked() {
390417 * {@link AuthenticatorToBeFiltered#getAttestationCertificateChain() attestation certificate
391418 * chain}.
392419 *
420+ * @since 2.0.0
393421 * @see AuthenticatorStatus#ATTESTATION_KEY_COMPROMISE
394422 */
395423 public static Predicate <AuthenticatorToBeFiltered > noAttestationKeyCompromise () {
@@ -417,6 +445,8 @@ public static Predicate<AuthenticatorToBeFiltered> noAttestationKeyCompromise()
417445 /**
418446 * This class encapsulates parameters for filtering authenticators in the {@link
419447 * FidoMetadataServiceBuilder#filter(Predicate) filter} setting of {@link FidoMetadataService}.
448+ *
449+ * @since 2.0.0
420450 */
421451 @ Value
422452 @ AllArgsConstructor (access = AccessLevel .PRIVATE )
@@ -426,12 +456,16 @@ public static class AuthenticatorToBeFiltered {
426456 * The attestation certificate chain from the <a
427457 * href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#attestation-statement">attestation
428458 * statement</a> from an authenticator about ot be registered.
459+ *
460+ * @since 2.0.0
429461 */
430462 @ NonNull List <X509Certificate > attestationCertificateChain ;
431463
432464 /**
433465 * A metadata BLOB entry that matches the {@link #getAttestationCertificateChain()} and {@link
434466 * #getAaguid()} in this same {@link AuthenticatorToBeFiltered} object.
467+ *
468+ * @since 2.0.0
435469 */
436470 @ NonNull MetadataBLOBPayloadEntry metadataEntry ;
437471
@@ -444,6 +478,8 @@ public static class AuthenticatorToBeFiltered {
444478 *
445479 * <p>This will not be present if the attested credential data contained an AAGUID of all
446480 * zeroes.
481+ *
482+ * @since 2.0.0
447483 */
448484 public Optional <AAGUID > getAaguid () {
449485 return Optional .ofNullable (aaguid );
@@ -491,6 +527,7 @@ public Optional<AAGUID> getAaguid() {
491527 * attestationCertificateChain</code>, if any.
492528 * </ul>
493529 *
530+ * @since 2.0.0
494531 * @see #findEntries(List)
495532 * @see #findEntries(List, AAGUID)
496533 */
@@ -566,6 +603,7 @@ public Set<MetadataBLOBPayloadEntry> findEntries(
566603 /**
567604 * Alias of <code>findEntries(attestationCertificateChain, Optional.empty())</code>.
568605 *
606+ * @since 2.0.0
569607 * @see #findEntries(List, Optional)
570608 */
571609 public Set <MetadataBLOBPayloadEntry > findEntries (
@@ -576,6 +614,7 @@ public Set<MetadataBLOBPayloadEntry> findEntries(
576614 /**
577615 * Alias of <code>findEntries(attestationCertificateChain, Optional.of(aaguid))</code>.
578616 *
617+ * @since 2.0.0
579618 * @see #findEntries(List, Optional)
580619 */
581620 public Set <MetadataBLOBPayloadEntry > findEntries (
@@ -594,6 +633,7 @@ public Set<MetadataBLOBPayloadEntry> findEntries(
594633 * .orElseGet(Collections::emptySet)
595634 * </pre>
596635 *
636+ * @since 2.0.0
597637 * @see #findEntries(List, Optional)
598638 */
599639 public Set <MetadataBLOBPayloadEntry > findEntries (@ NonNull RegistrationResult registrationResult ) {
@@ -606,6 +646,7 @@ public Set<MetadataBLOBPayloadEntry> findEntries(@NonNull RegistrationResult reg
606646 /**
607647 * Find metadata entries matching the given AAGUID.
608648 *
649+ * @since 2.0.0
609650 * @see #findEntries(List, Optional)
610651 */
611652 public Set <MetadataBLOBPayloadEntry > findEntries (@ NonNull AAGUID aaguid ) {
@@ -623,6 +664,7 @@ public Set<MetadataBLOBPayloadEntry> findEntries(@NonNull AAGUID aaguid) {
623664 * @return All metadata entries which satisfy the {@link
624665 * FidoMetadataServiceBuilder#prefilter(Predicate) prefilter} AND for which the <code>filter
625666 * </code> returns <code>true</code>.
667+ * @since 2.0.0
626668 * @see #findEntries(List, Optional)
627669 */
628670 public Set <MetadataBLOBPayloadEntry > findEntries (
@@ -637,6 +679,9 @@ public Set<MetadataBLOBPayloadEntry> findEntries(
637679 .collect (Collectors .toSet ());
638680 }
639681
682+ /**
683+ * @since 2.0.0
684+ */
640685 @ Override
641686 public TrustRootsResult findTrustRoots (
642687 List <X509Certificate > attestationCertificateChain , Optional <ByteArray > aaguid ) {
0 commit comments