[java-idp-plugin-webauthn] branch main updated: JWEBAUTHN-60 - Ensure cleanup hook is called

Phil Smart philip.smart at jisc.ac.uk
Fri Aug 22 09:45:31 UTC 2025


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=69160a82687b5b566097427f8fff459052ebcb4d

The following commit(s) were added to refs/heads/main by this push:
     new 69160a8  JWEBAUTHN-60 - Ensure cleanup hook is called
69160a8 is described below

commit 69160a82687b5b566097427f8fff459052ebcb4d
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Fri Aug 22 10:45:29 2025 +0100

    JWEBAUTHN-60 - Ensure cleanup hook is called
    
     - call cleanup hook on post execute. Does not wire up a default.
    
    https://shibboleth.atlassian.net/browse/JWEBAUTHN-60
---
 .../webauthn/impl/ValidateWebAuthnAssertion.java   | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

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 c2f6af0..e18fe75 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
@@ -20,6 +20,7 @@ import java.util.function.Function;
 import java.util.function.Predicate;
 
 import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 import javax.security.auth.Subject;
 
 import org.opensaml.messaging.context.navigate.ChildContextLookup;
@@ -76,6 +77,9 @@ public class ValidateWebAuthnAssertion extends AbstractAuditingValidationAction
     /** The WebAuthn client to use.*/
     @NonnullAfterInit private WebAuthnAuthenticationClient webAuthnClient;  
     
+    /** A cleanup hook to execute after processing. */
+    @Nullable private Consumer<ProfileRequestContext> cleanupHook;
+    
     /** The credential repository to validate assertion responses against.*/
     @NonnullAfterInit private WebAuthnCredentialRepository credentialRepository;
     
@@ -111,6 +115,16 @@ public class ValidateWebAuthnAssertion extends AbstractAuditingValidationAction
         }
         super.doInitialize();
     }
+    /**
+     * Set the cleanup hook to execute after processing.
+     * 
+     * @param hook cleanup hook
+     */
+    @Override
+    public void setCleanupHook(@Nullable final Consumer<ProfileRequestContext> hook) {
+        checkSetterPreconditions();
+        cleanupHook = hook;
+    }
     
     /**
      * Set the credential repository used to store WebAuthn credentials.
@@ -346,6 +360,16 @@ public class ValidateWebAuthnAssertion extends AbstractAuditingValidationAction
         }
     }
     
+    /** {@inheritDoc} */
+    @Override
+    protected void doPostExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
+        super.doPostExecute(profileRequestContext);
+        
+        if (cleanupHook != null) {
+            cleanupHook.accept(profileRequestContext);
+        }
+    }
+    
     /**
      * A default cleanup hook that removes the {@link WebAuthnAuthenticationContext} from the tree.
      */

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


More information about the commits mailing list