[java-idp-plugin-webauthn] branch main updated: Javadoc and logging improvements

Phil Smart philip.smart at jisc.ac.uk
Wed Jun 5 13:53:10 UTC 2024


This is an automated email from the git hooks/post-receive script.

philsmart pushed a commit to branch main
in repository java-idp-plugin-webauthn.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-webauthn.git;a=commit;h=891e62d543cbd95809328cdbe28daa4d72ea0ae5

The following commit(s) were added to refs/heads/main by this push:
     new 891e62d  Javadoc and logging improvements
891e62d is described below

commit 891e62d543cbd95809328cdbe28daa4d72ea0ae5
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Wed Jun 5 14:53:08 2024 +0100

    Javadoc and logging improvements
---
 .../admin/CredentialCreationOptionsParameters.java     |  4 ++--
 .../authn/webauthn/authn/BaseOptionsParameters.java    |  2 +-
 ...y.java => WebAuthnAuthenticationClientFactory.java} |  2 +-
 .../impl/AbstractWebAuthnAuthenticationAction.java     |  8 +++++---
 .../webauthn/impl/AbstractWebAuthnBaseAction.java      |  5 +++--
 .../impl/AbstractWebAuthnExtractionAction.java         |  5 +++--
 .../plugin/authn/webauthn/impl/BaseWebAuthnAction.java |  6 +++---
 .../BaseWebAuthnAuthenticationContextConsumer.java     |  4 ++--
 .../impl/CreatePublicKeyCredentialRequestOptions.java  |  2 +-
 .../webauthn/impl/EnsureAllowedCredentialsIsEmpty.java |  4 ++--
 .../authn/webauthn/impl/GenerateServerChallenge.java   |  2 +-
 .../webauthn/impl/LookupRegisteredCredentials.java     |  6 +++---
 .../LookupRegisteredCredentialsFromUserHandle.java     |  6 +++---
 .../impl/PopulateWebAuthnAuthenticationContext.java    |  2 +-
 .../impl/SetPaswordlessUsageToContextConsumer.java     |  2 +-
 .../impl/SetSecondFactorUsageToContextConsumer.java    |  2 +-
 .../impl/SetUsernamelessUsageToContextConsumer.java    |  2 +-
 .../authn/webauthn/impl/ValidateWebAuthnAssertion.java | 18 ++++++++++--------
 .../plugin/authn/webauthn/impl/WebAuthnEncoder.java    |  2 +-
 19 files changed, 45 insertions(+), 39 deletions(-)

diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/CredentialCreationOptionsParameters.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/CredentialCreationOptionsParameters.java
index e310736..4cbcaaf 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/CredentialCreationOptionsParameters.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/admin/CredentialCreationOptionsParameters.java
@@ -53,7 +53,7 @@ public class CredentialCreationOptionsParameters extends BaseOptionsParameters {
      */
     @Nonnull @NotEmpty final String displayName;
     
-    /** The AuthenticatorAttachment requirement. {@code null} would represent either possibility.*/
+    /** The authenticator attachment requirement. {@code null} would represent either possibility.*/
     @Nullable final AuthenticatorAttachment authenticatorAttachment;
     
     /** The requirement on registering a ResidentKey. Also know as a discoverable credential.*/
@@ -62,7 +62,7 @@ public class CredentialCreationOptionsParameters extends BaseOptionsParameters {
     /** The user.id supplied to the authenticator during registration. As generated by the IdP.*/
     @Nonnull final byte[] userId;    
     
-    /** The Attestation conveyance preference.*/
+    /** The attestation conveyance preference.*/
     @Nonnull private final AttestationConveyancePreference attestationConveyancePreference;
     
     /** Enable the credential properties extensions. For example, to report discoverable credentials i.e. 'passkeys'.*/
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/BaseOptionsParameters.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/BaseOptionsParameters.java
index 22d823b..c356396 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/BaseOptionsParameters.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/authn/BaseOptionsParameters.java
@@ -21,7 +21,7 @@ import com.yubico.webauthn.data.UserVerificationRequirement;
 import net.shibboleth.shared.logic.Constraint;
 
 /**
- * Abstract options parameters class. Common to credential create or request options. 
+ * Abstract options parameters class. Common to credential create or get options. 
  */
 public abstract class BaseOptionsParameters {    
     
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebauthnAuthenticationClientFactory.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebAuthnAuthenticationClientFactory.java
similarity index 92%
rename from webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebauthnAuthenticationClientFactory.java
rename to webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebAuthnAuthenticationClientFactory.java
index dd912a0..f15b6d3 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebauthnAuthenticationClientFactory.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/client/WebAuthnAuthenticationClientFactory.java
@@ -8,7 +8,7 @@ import net.shibboleth.idp.plugin.authn.webauthn.exception.WebAuthnAuthentication
 /**
  * Abstract factory for creating singleton {@link WebAuthnAuthenticationClient} instances.
  */
-public interface WebauthnAuthenticationClientFactory {
+public interface WebAuthnAuthenticationClientFactory {
     
     
     /**
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnAuthenticationAction.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnAuthenticationAction.java
index 6ea7976..269d6e6 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnAuthenticationAction.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnAuthenticationAction.java
@@ -33,6 +33,7 @@ import net.shibboleth.idp.authn.context.AuthenticationContext;
 import net.shibboleth.idp.plugin.authn.webauthn.client.WebAuthnAuthenticationClient;
 import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnAuthenticationContext;
 import net.shibboleth.idp.plugin.authn.webauthn.storage.StorageServiceCredentialRepository;
+import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
 import net.shibboleth.shared.annotation.constraint.NonnullBeforeExec;
 import net.shibboleth.shared.annotation.constraint.NotEmpty;
 import net.shibboleth.shared.component.ComponentInitializationException;
@@ -40,7 +41,7 @@ import net.shibboleth.shared.logic.Constraint;
 import net.shibboleth.shared.primitive.LoggerFactory;
 
 /**
- * <p>A base class for webauthn authentication related actions.</p>
+ * <p>A base class for WebAuthn authentication related actions.</p>
  * 
  * <p>In addition to the work performed by {@link AbstractAuthenticationAction}, this action also looks up
  * and makes available the {@link WebAuthnAuthenticationContext}.</p>
@@ -66,7 +67,7 @@ public abstract class AbstractWebAuthnAuthenticationAction extends AbstractAuthe
     @NonnullBeforeExec private WebAuthnAuthenticationContext webauthnContext;
     
     /** The WebAuthn client to use.*/
-    @NonnullBeforeExec private WebAuthnAuthenticationClient webAuthnClient;
+    @NonnullAfterInit private WebAuthnAuthenticationClient webAuthnClient;
     
     /** The credential repository to store WebAuthn credentials in.*/
     @Nullable private StorageServiceCredentialRepository credentialRepository;
@@ -158,6 +159,7 @@ public abstract class AbstractWebAuthnAuthenticationAction extends AbstractAuthe
             return false;
             
         }
+        assert webauthnContext != null;
         return doPreExecute(profileRequestContext, authenticationContext, webauthnContext);
     }
     
@@ -172,7 +174,7 @@ public abstract class AbstractWebAuthnAuthenticationAction extends AbstractAuthe
     @Override
     protected final void doExecute(@Nonnull final ProfileRequestContext profileRequestContext,
             @Nonnull final AuthenticationContext authenticationContext) {
-        
+        assert webauthnContext != null;
         doExecute(profileRequestContext,authenticationContext, webauthnContext);
     }
     
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnBaseAction.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnBaseAction.java
index 726840f..0bed813 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnBaseAction.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnBaseAction.java
@@ -98,7 +98,8 @@ public abstract class AbstractWebAuthnBaseAction extends BaseWebAuthnAction {
             ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
             return false;
             
-        }        
+        }
+        assert webAuthnBaseContext != null;
         return doPreExecute(profileRequestContext, webAuthnBaseContext);
     }
     
@@ -110,7 +111,7 @@ public abstract class AbstractWebAuthnBaseAction extends BaseWebAuthnAction {
      */
     @Override
     protected final void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
-        
+        assert webAuthnBaseContext != null;
         doExecute(profileRequestContext, webAuthnBaseContext);
     }
     
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnExtractionAction.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnExtractionAction.java
index 4f34910..f74607b 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnExtractionAction.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/AbstractWebAuthnExtractionAction.java
@@ -35,12 +35,13 @@ import net.shibboleth.shared.primitive.LoggerFactory;
 import net.shibboleth.shared.primitive.StringSupport;
 
 /**
- * A base class for WebAuthn actions that extract usernames for subsequent use.
+ * A base class for WebAuthn actions that extracts a username for subsequent use.
  * 
  * <p>The base class adds a common mechanism for applying regular expression transforms to
  * the username prior to being added to the context tree.</p>
  *
- * Similar to {@link AbstractExtractionAction}, but without the requirement of it running inside an authentication flow.
+ * <p>Similar to {@link AbstractExtractionAction}, but without the requirement of it running inside an authentication 
+ * flow.</p>
  */
 public class AbstractWebAuthnExtractionAction extends AbstractProfileAction {
     
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/BaseWebAuthnAction.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/BaseWebAuthnAction.java
index 754df41..4ff3e87 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/BaseWebAuthnAction.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/BaseWebAuthnAction.java
@@ -34,7 +34,7 @@ public abstract class BaseWebAuthnAction extends AbstractProfileAction {
     /** The WebAuthn client to use.*/
     @NonnullAfterInit private WebAuthnAuthenticationClient webAuthnClient;
     
-    /** The credential respository to store valid credentials in.*/
+    /** The credential repository to store valid credentials in.*/
     @NonnullAfterInit private StorageServiceCredentialRepository credentialRepository;
     
     /** Optional FIDO metadata service resolver.*/ 
@@ -56,7 +56,7 @@ public abstract class BaseWebAuthnAction extends AbstractProfileAction {
     /**
      * Set the WebAuthn client used to handle registration and authentication ceremonies.
      * 
-     * @param client The webauthnClient to set.
+     * @param client The WebAuthn client to set.
      */
     public void setWebAuthnClient(@Nonnull final WebAuthnAuthenticationClient client) {
         checkSetterPreconditions();
@@ -86,7 +86,7 @@ public abstract class BaseWebAuthnAction extends AbstractProfileAction {
     /**
      * Get the FIDO Alliance metadata service resolver to use as the attestation trust source.
      * 
-     * @return the fido metadata service.
+     * @return the FIDO metadata service.
      */
     @Nullable protected FidoMetadataService getFidoMetadataService() {
         checkComponentActive();
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/BaseWebAuthnAuthenticationContextConsumer.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/BaseWebAuthnAuthenticationContextConsumer.java
index 43774a0..455ed3d 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/BaseWebAuthnAuthenticationContextConsumer.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/BaseWebAuthnAuthenticationContextConsumer.java
@@ -31,12 +31,12 @@ import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnAuthenticationCo
  */
 public abstract class BaseWebAuthnAuthenticationContextConsumer implements Consumer<ProfileRequestContext> {
     
-    /** Strategy used to locate or create the {@link WebAuthnAuthenticationContext} to populate. */
+    /** Strategy used to locate the {@link WebAuthnAuthenticationContext} to populate. */
     @Nonnull 
     private final Function<ProfileRequestContext,WebAuthnAuthenticationContext> webauthnAuthContextCreationStrategy;
     
     /** Constructor.*/
-    public BaseWebAuthnAuthenticationContextConsumer() {
+    BaseWebAuthnAuthenticationContextConsumer() {
         webauthnAuthContextCreationStrategy =
                 new ChildContextLookup<>(WebAuthnAuthenticationContext.class).
                 compose(new ChildContextLookup<>(AuthenticationContext.class));
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/CreatePublicKeyCredentialRequestOptions.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/CreatePublicKeyCredentialRequestOptions.java
index abf5522..1fc493c 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/CreatePublicKeyCredentialRequestOptions.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/CreatePublicKeyCredentialRequestOptions.java
@@ -41,7 +41,7 @@ import net.shibboleth.shared.collection.CollectionSupport;
 import net.shibboleth.shared.primitive.LoggerFactory;
 
 /**
- * Action to create a CreatePublicKeyCredentialRequestOptions from the parameters in the WebAuthn context using the 
+ * Action to create CreatePublicKeyCredentialRequestOptions from the parameters in the WebAuthn context using the 
  * supplied {@link WebAuthnAuthenticationClient client}.
  * 
  * @pre <pre>ProfileRequestContext.getSubcontext(WebAuthnAuthenticationContext.class) != null</pre>
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/EnsureAllowedCredentialsIsEmpty.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/EnsureAllowedCredentialsIsEmpty.java
index 4dadac5..5425528 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/EnsureAllowedCredentialsIsEmpty.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/EnsureAllowedCredentialsIsEmpty.java
@@ -24,10 +24,10 @@ import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnAuthenticationCo
 import net.shibboleth.shared.primitive.LoggerFactory;
 
 /**
- * An action that blanks any existing registered credentials in the WebAuthn context.
+ * An action that blanks any existing registered credentials in the WebAuthn authentication context.
  * 
  * @pre <pre>ProfileRequestContext.getSubcontext(WebAuthnAuthenticationContext.class) != null</pre>
- * @post <pre>WebAuthnRegistrationContext.getExistingCredentials() == null</pre>
+ * @post <pre>WebAuthnAuthenticationContext.getExistingCredentials() == null</pre>
  */
 public class EnsureAllowedCredentialsIsEmpty extends AbstractWebAuthnAuthenticationAction {
 
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/GenerateServerChallenge.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/GenerateServerChallenge.java
index 2b764bb..2c05b29 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/GenerateServerChallenge.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/GenerateServerChallenge.java
@@ -41,7 +41,7 @@ import net.shibboleth.shared.primitive.LoggerFactory;
  * 
  * @event {@link org.opensaml.profile.action.EventIds#PROCEED_EVENT_ID}
  * @event {@link org.opensaml.profile.action.EventIds#INVALID_PROFILE_CTX}
- * @post a byte challenge is added to the {@link BaseWebAuthnContext base context}
+ * @post a challenge is added to the {@link BaseWebAuthnContext base context}
  */
 public class GenerateServerChallenge extends AbstractWebAuthnBaseAction {
     
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentials.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentials.java
index 1178b97..abcadef 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentials.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentials.java
@@ -52,7 +52,7 @@ public class LookupRegisteredCredentials extends AbstractWebAuthnBaseAction {
     @Nonnull
     private final Logger log = LoggerFactory.getLogger(LookupRegisteredCredentials.class);
     
-    /** Should an event be built if there are no credentials found?. Defaults to false.*/
+    /** Should an non-proceed event be built if there are no credentials found?. Defaults to false.*/
     private Predicate<ProfileRequestContext> triggerEventOnNoCredentialsPredicate;
     
     /** 
@@ -68,7 +68,7 @@ public class LookupRegisteredCredentials extends AbstractWebAuthnBaseAction {
     }
     
     /**
-     * Set a flag which triggers a custom event to be built if no credentials are found?
+     * Set a flag which triggers a custom event to be built if no credentials are found.
      * 
      * @param trigger the flag to set
      */
@@ -78,7 +78,7 @@ public class LookupRegisteredCredentials extends AbstractWebAuthnBaseAction {
     }
     
     /**
-     * Set a predicate which triggers a custom event to be built if no credentials are found?
+     * Set a predicate which triggers a custom event to be built if no credentials are found.
      * 
      * @param trigger the flag to set
      */
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentialsFromUserHandle.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentialsFromUserHandle.java
index 37e9284..b0fe054 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentialsFromUserHandle.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/LookupRegisteredCredentialsFromUserHandle.java
@@ -75,7 +75,7 @@ public class LookupRegisteredCredentialsFromUserHandle extends AbstractWebAuthnA
     }
     
     /**
-     * Set a flag which triggers a custom event to be built if no credentials are found?
+     * Set a flag which triggers a custom event to be built if no credentials are found.
      * 
      * @param trigger the flag to set
      */
@@ -85,7 +85,7 @@ public class LookupRegisteredCredentialsFromUserHandle extends AbstractWebAuthnA
     }
     
     /**
-     * Set a predicate which triggers a custom event to be built if no credentials are found?
+     * Set a predicate which triggers a custom event to be built if no credentials are found.
      * 
      * @param trigger the flag to set
      */
@@ -96,7 +96,7 @@ public class LookupRegisteredCredentialsFromUserHandle extends AbstractWebAuthnA
     }
     
     /**
-     * Set the EventID of the event to build if no credentials are foud and <code>triggerEventOnNoCredentials<code> 
+     * Set the EventID of the event to build if no credentials are found and <code>triggerEventOnNoCredentials<code> 
      * is set.
      * 
      * @param eventId the eventId to build.
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/PopulateWebAuthnAuthenticationContext.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/PopulateWebAuthnAuthenticationContext.java
index df0cc93..83fae89 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/PopulateWebAuthnAuthenticationContext.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/PopulateWebAuthnAuthenticationContext.java
@@ -128,7 +128,7 @@ public class PopulateWebAuthnAuthenticationContext extends AbstractAuthenticatio
         final WebAuthnAuthenticationContext context = 
                 webauthnAuthContextCreationStrategy.apply(profileRequestContext);
         if (context == null) {
-            log.error("{} Error creating WebauthnAuthenticationContext", getLogPrefix());
+            log.error("{} Error creating WebAuthnAuthenticationContext", getLogPrefix());
             ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
             return;
         }
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/SetPaswordlessUsageToContextConsumer.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/SetPaswordlessUsageToContextConsumer.java
index 160521e..3f972be 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/SetPaswordlessUsageToContextConsumer.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/SetPaswordlessUsageToContextConsumer.java
@@ -17,7 +17,7 @@ package net.shibboleth.idp.plugin.authn.webauthn.impl;
 import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnAuthenticationContext;
 
 /**
- * A consumer that sets the isPasswordless mode to the authentication context.
+ * A consumer that sets the isPasswordless mode flag to the authentication context.
  */
 public class SetPaswordlessUsageToContextConsumer extends BaseWebAuthnAuthenticationContextConsumer{
 
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/SetSecondFactorUsageToContextConsumer.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/SetSecondFactorUsageToContextConsumer.java
index 4a8442b..029097d 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/SetSecondFactorUsageToContextConsumer.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/SetSecondFactorUsageToContextConsumer.java
@@ -17,7 +17,7 @@ package net.shibboleth.idp.plugin.authn.webauthn.impl;
 import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnAuthenticationContext;
 
 /**
- * A consumer that sets the isSecondFactor mode to the authentication context.
+ * A consumer that sets the isSecondFactor mode flag to the authentication context.
  */
 public class SetSecondFactorUsageToContextConsumer extends BaseWebAuthnAuthenticationContextConsumer{
 
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/SetUsernamelessUsageToContextConsumer.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/SetUsernamelessUsageToContextConsumer.java
index b5ef843..11040d1 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/SetUsernamelessUsageToContextConsumer.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/SetUsernamelessUsageToContextConsumer.java
@@ -17,7 +17,7 @@ package net.shibboleth.idp.plugin.authn.webauthn.impl;
 import net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnAuthenticationContext;
 
 /**
- * A consumer that sets the isUsernameless mode to the authentication context.
+ * A consumer that sets the isUsernameless mode flag to the authentication context.
  */
 public class SetUsernamelessUsageToContextConsumer extends BaseWebAuthnAuthenticationContextConsumer{
 
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ValidateWebAuthnAssertion.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ValidateWebAuthnAssertion.java
index 8d908a3..2356d0d 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ValidateWebAuthnAssertion.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/ValidateWebAuthnAssertion.java
@@ -35,8 +35,8 @@ import net.shibboleth.shared.logic.PredicateSupport;
 import net.shibboleth.shared.primitive.LoggerFactory;
 
 /**
- * An action that validates a WebAuthn Authenticator Assertion that results from a call to WebAuthn's 'get' 
- * (authentication) API. If successful, populates the Subject with a {@link UsernamePrincipal} based on the username in
+ * An action that validates a WebAuthn authenticator assertion that results from a call to WebAuthn's 'get' credential
+ * API. If successful, populates the Subject with a {@link UsernamePrincipal} based on the username in
  * the authentication context and a {@link WebAuthnUserIdPrinicpal} based on the user.id in the authentication context.
  * 
  * @event {@link AuthnEventIds#INVALID_CREDENTIALS}
@@ -52,7 +52,7 @@ public class ValidateWebAuthnAssertion extends AbstractValidationAction {
     @Nonnull
     private final Function<ProfileRequestContext, WebAuthnAuthenticationContext> webauthnContextLookupStrategy;
 
-    /** The webauthn authentication context. */
+    /** The WebAuthn authentication context. */
     @NonnullBeforeExec private WebAuthnAuthenticationContext context;    
     
     /** The WebAuthn client to use.*/
@@ -93,7 +93,7 @@ public class ValidateWebAuthnAssertion extends AbstractValidationAction {
     /**
      * Set the credential repository used to store WebAuthn credentials.
      *  
-     * @param repository The respository to set.
+     * @param repository The repository to set.
      */
     public void setCredentialRepository(@Nonnull final StorageServiceCredentialRepository repository) {
         checkSetterPreconditions();
@@ -101,7 +101,7 @@ public class ValidateWebAuthnAssertion extends AbstractValidationAction {
     }    
     
     /**
-     * Set the WebAuthn client used to handle registration and authentication ceremonies.
+     * Set the WebAuthn client used to handle validation of the authentication ceremony.
      * 
      * @param client The webauthnClient to set.
      */
@@ -162,7 +162,7 @@ public class ValidateWebAuthnAssertion extends AbstractValidationAction {
                 context.getPublicKeyCredentialAssertionResponse();
        
         if (assertion == null) {
-            log.warn("{} No authenticator assertion found, {} can not authenticate", 
+            log.warn("{} No PublicKeyCredential with authenticator assertion found, can not authenticate '{}'", 
                     getLogPrefix(),context.getUsername());
             handleError(profileRequestContext, authenticationContext, AuthnEventIds.INVALID_CREDENTIALS,
                     AuthnEventIds.INVALID_CREDENTIALS);
@@ -170,9 +170,11 @@ public class ValidateWebAuthnAssertion extends AbstractValidationAction {
             return; 
         }
         try {
-            
+            final PublicKeyCredentialRequestOptions localPublicKeyCredentialRequestOptions = 
+                    publicKeyCredentialRequestOptions;
+            assert localPublicKeyCredentialRequestOptions != null;
             final AssertionResult result = webAuthnClient.validateAuthenticatorAssertionResponse(
-                    context.getUsername(), context.getUserId(), publicKeyCredentialRequestOptions, assertion);
+                    context.getUsername(), context.getUserId(), localPublicKeyCredentialRequestOptions, assertion);
             
             if (!result.isSuccess()) {
                 throw new AssertionFailureException("Assestion was not valid");
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/WebAuthnEncoder.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/WebAuthnEncoder.java
index 8e23e93..f8dcf46 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/WebAuthnEncoder.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/WebAuthnEncoder.java
@@ -45,7 +45,7 @@ public final class WebAuthnEncoder {
    
     /** Private constructor. */
     private WebAuthnEncoder() {
-        
+        // Do nothing
     }
     
     /**

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list