From 379c5fbac004728a903cb39c2b6b00f0fa791ad6 Mon Sep 17 00:00:00 2001 From: Emil Lundberg Date: Thu, 9 Nov 2023 19:10:58 +0100 Subject: [PATCH] Fill out JavaDoc for credentialRepositoryV2 and usernameRepository setters --- .../src/main/java/com/yubico/webauthn/RelyingParty.java | 7 ++++++- .../src/main/java/com/yubico/webauthn/RelyingPartyV2.java | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/webauthn-server-core/src/main/java/com/yubico/webauthn/RelyingParty.java b/webauthn-server-core/src/main/java/com/yubico/webauthn/RelyingParty.java index 2553d3ab8..52bb2528a 100644 --- a/webauthn-server-core/src/main/java/com/yubico/webauthn/RelyingParty.java +++ b/webauthn-server-core/src/main/java/com/yubico/webauthn/RelyingParty.java @@ -606,7 +606,12 @@ public RelyingPartyBuilder credentialRepository(CredentialRepository credentialR /** * {@link RelyingPartyBuilder#credentialRepository(CredentialRepository) - * credentialRepository} is a required parameter. + * credentialRepository} is a required parameter. This setter differs from {@link + * #credentialRepository(CredentialRepository)} in that it takes an instance of {@link + * CredentialRepositoryV2} and converts the builder's return type to {@link RelyingPartyV2}. + * {@link CredentialRepositoryV2} does not require the application to support usernames, + * unless {@link RelyingPartyV2.RelyingPartyV2Builder#usernameRepository(UsernameRepository) + * usernameRepository} is also set in a subsequent builder step. * * @see #credentialRepository(CredentialRepository) * @deprecated EXPERIMENTAL: This is an experimental feature. It is likely to change or be diff --git a/webauthn-server-core/src/main/java/com/yubico/webauthn/RelyingPartyV2.java b/webauthn-server-core/src/main/java/com/yubico/webauthn/RelyingPartyV2.java index b81d47e36..23a71c5bf 100644 --- a/webauthn-server-core/src/main/java/com/yubico/webauthn/RelyingPartyV2.java +++ b/webauthn-server-core/src/main/java/com/yubico/webauthn/RelyingPartyV2.java @@ -140,7 +140,13 @@ public class RelyingPartyV2 { @NonNull private final CredentialRepositoryV2 credentialRepository; /** - * TODO + * Enable support for identifying users by username. + * + *

If set, then {@link #startAssertion(StartAssertionOptions)} allows setting the {@link + * StartAssertionOptions.StartAssertionOptionsBuilder#username(String) username} parameter when + * starting an assertion. + * + *

By default, this is not set. * * @deprecated EXPERIMENTAL: This is an experimental feature. It is likely to change or be deleted * before reaching a mature release.