[java-idp-plugin-webauthn] branch main updated: Add error and info UI reset functions

Phil Smart philip.smart at jisc.ac.uk
Wed Aug 14 12:50:32 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=1564d3bf87122ae63c962fe3bcdf79488971cef3

The following commit(s) were added to refs/heads/main by this push:
     new 1564d3b  Add error and info UI reset functions
1564d3b is described below

commit 1564d3bf87122ae63c962fe3bcdf79488971cef3
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Wed Aug 14 13:50:29 2024 +0100

    Add error and info UI reset functions
    
     - In unusual cases an old error and new info message could be displayed
    at the same time.
---
 .../authn/webauthn/context/WebAuthnRegistrationErrorContext.java  | 8 ++++++++
 .../webauthn/context/WebAuthnRegistrationInformationContext.java  | 7 +++++++
 .../admin/webauthn-registration/webauthn-registration-flow.xml    | 5 ++++-
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnRegistrationErrorContext.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnRegistrationErrorContext.java
index fbd1ca3..156d615 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnRegistrationErrorContext.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnRegistrationErrorContext.java
@@ -82,5 +82,13 @@ public class WebAuthnRegistrationErrorContext extends BaseContext {
     @Nullable public String getLastClassifiedError() {
         return classifiedErrors.stream().reduce((first, second) -> second).orElse(null);
     }
+    
+    /**
+     * Reset the error context by clearing the classified messages.
+     */
+    public void reset() {
+        classifiedErrors.clear();
+    }
+       
 
 }
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnRegistrationInformationContext.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnRegistrationInformationContext.java
index 43cf9e5..0f5cde3 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnRegistrationInformationContext.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnRegistrationInformationContext.java
@@ -82,5 +82,12 @@ public class WebAuthnRegistrationInformationContext extends BaseContext {
     @Nullable public String getLastClassifiedMessage() {
         return classifiedMessages.stream().reduce((first, second) -> second).orElse(null);
     }
+    
+    /**
+     * Reset the information context by clearing the classified messages.
+     */
+    public void reset() {
+        classifiedMessages.clear();
+    }
 
 }
diff --git a/webauthn-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/admin/webauthn-registration/webauthn-registration-flow.xml b/webauthn-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/admin/webauthn-registration/webauthn-registration-flow.xml
index 627ac57..6ad4aa3 100644
--- a/webauthn-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/admin/webauthn-registration/webauthn-registration-flow.xml
+++ b/webauthn-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/admin/webauthn-registration/webauthn-registration-flow.xml
@@ -93,7 +93,10 @@
        <transition on="finish" to="RegistrationComplete" />
        <transition on="addKey" to="AddKey" />
        <transition on="deleteKey" to="DeleteKey" />
-       
+       <on-exit>
+         <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnRegistrationContext)).ensureSubcontext(T(net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnRegistrationInformationContext)).reset()"/>
+         <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnRegistrationContext)).ensureSubcontext(T(net.shibboleth.idp.plugin.authn.webauthn.context.WebAuthnRegistrationErrorContext)).reset()"/>
+       </on-exit>       
     </view-state>
     
    <action-state id="AddKey">

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


More information about the commits mailing list