[java-idp-plugin-webauthn] branch main updated: Add default values for predicates

Phil Smart philip.smart at jisc.ac.uk
Wed Apr 17 16:00:25 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=07872dcf5b579f8329dda42ca7226fa8449acd7f

The following commit(s) were added to refs/heads/main by this push:
     new 07872dc  Add default values for predicates
07872dc is described below

commit 07872dcf5b579f8329dda42ca7226fa8449acd7f
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Wed Apr 17 17:00:23 2024 +0100

    Add default values for predicates
---
 .../authn/webauthn/impl/LookupRegisteredCredentials.java       |  7 ++++---
 .../impl/LookupRegisteredCredentialsFromUserHandle.java        | 10 ++++++----
 2 files changed, 10 insertions(+), 7 deletions(-)

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 1fce097..4bfc777 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
@@ -48,18 +48,19 @@ 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?.*/
+    /** Should an event be built if there are no credentials found?. Defaults to false.*/
     private Predicate<ProfileRequestContext> triggerEventOnNoCredentialsPredicate;
     
     /** 
-     * The EventID of the event to build if no credentials are foud and <code>triggerEventOnNoCredentials<code> 
-     * is set.
+     * The EventID of the event to build if no credentials are found and 
+     * <code>triggerEventOnNoCredentialsPredicate<code> evaluates to true.
      */
     @Nonnull @NotEmpty private String noCredentialsEventId;
     
     /** Constructor.  */
     public LookupRegisteredCredentials() {
         noCredentialsEventId = WebAuthnAuthenticationEventIds.NO_REGISTERED_WEBAUTHN_CREDENTIALS;
+        triggerEventOnNoCredentialsPredicate = PredicateSupport.alwaysFalse();
     }
     
     /**
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 39bcaf8..039c619 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
@@ -56,18 +56,19 @@ public class LookupRegisteredCredentialsFromUserHandle extends AbstractWebAuthnA
     @Nonnull
     private final Logger log = LoggerFactory.getLogger(LookupRegisteredCredentialsFromUserHandle.class);
     
-    /** Should an event be built if there are no credentials found?.*/
+    /** Should an event be built if there are no credentials found?. Defaults to false.*/
     private Predicate<ProfileRequestContext> triggerEventOnNoCredentialsPredicate;
     
     /** 
-     * The EventID of the event to build if no credentials are foud and <code>triggerEventOnNoCredentials<code> 
-     * is set.
+     * The EventID of the event to build if no credentials are found and 
+     * <code>triggerEventOnNoCredentialsPredicate<code> evaluates to true.
      */
     @Nonnull @NotEmpty private String noCredentialsEventId;
     
     /** Constructor.  */
     public LookupRegisteredCredentialsFromUserHandle() {
         noCredentialsEventId = WebAuthnAuthenticationEventIds.NO_REGISTERED_WEBAUTHN_CREDENTIALS;
+        triggerEventOnNoCredentialsPredicate = PredicateSupport.alwaysFalse();
     }
     
     /**
@@ -136,7 +137,8 @@ public class LookupRegisteredCredentialsFromUserHandle extends AbstractWebAuthnA
         } else {
             final Optional<String> potentialUsername = repository.getUsernameForUserHandle(userHandle.get());
             if (potentialUsername.isEmpty()) {
-                log.debug("{} User could not be found from the supplied userHandle, no registered credentials", getLogPrefix());
+                log.debug("{} User could not be found from the supplied userHandle, no registered credentials", 
+                        getLogPrefix());
             } else {
                 final Collection<CredentialRegistration> credentials = 
                         repository.getRegistrationsByUsername(potentialUsername.get());

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


More information about the commits mailing list