[java-idp-plugin-webauthn] branch main updated: Cleanup encoder naming

Phil Smart philip.smart at jisc.ac.uk
Tue Feb 6 14:25:03 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=80122bc45efbf2d7f045f24a42b123c65ca79ec0

The following commit(s) were added to refs/heads/main by this push:
     new 80122bc  Cleanup encoder naming
80122bc is described below

commit 80122bc45efbf2d7f045f24a42b123c65ca79ec0
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Tue Feb 6 14:25:01 2024 +0000

    Cleanup encoder naming
---
 .../webauthn/impl/CreatePublicKeyCredentialRequestOptions.java    | 1 +
 .../impl/{CredentialEncoder.java => WebAuthnEncoder.java}         | 4 ++--
 .../admin/webauthn-registration/webauthn-registration-flow.xml    | 4 ++--
 .../idp/plugin/authn/webauthn/views/webauthn-register.vm          | 8 ++++----
 .../idp/plugin/authn/webauthn/views/webauthn-registered.vm        | 8 ++++----
 5 files changed, 13 insertions(+), 12 deletions(-)

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 e8da523..189a7ed 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
@@ -112,6 +112,7 @@ public class CreatePublicKeyCredentialRequestOptions extends AbstractWebAuthnAut
                 .withAllowCredentials(existingCredentialDescriptors)
                 .build();
             
+            assert requestParams != null;
             final PublicKeyCredentialRequestOptions pkCredRequestOptions = 
                     client.createAuthenticationRequest(requestParams);
             
diff --git a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/CredentialEncoder.java b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/WebAuthnEncoder.java
similarity index 97%
rename from webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/CredentialEncoder.java
rename to webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/WebAuthnEncoder.java
index 735ff9d..fd206ef 100644
--- a/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/CredentialEncoder.java
+++ b/webauthn-impl/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/impl/WebAuthnEncoder.java
@@ -32,10 +32,10 @@ import net.shibboleth.shared.annotation.constraint.NotEmpty;
 /**
  * Encoder for {@link RegisteredCredential credentials} that converts raw values into a format suitable for views.
  */
-public final class CredentialEncoder {
+public final class WebAuthnEncoder {
    
     /** Private constructor. */
-    private CredentialEncoder() {
+    private WebAuthnEncoder() {
         
     }
     
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 f8c01cf..af69ac8 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
@@ -47,7 +47,7 @@
             <evaluate expression="authenticationContext.getSubcontext(T(net.shibboleth.idp.authn.context.AuthenticationErrorContext))" result="viewScope.authenticationErrorContext" />
             <evaluate expression="authenticationContext.getSubcontext(T(net.shibboleth.idp.authn.context.AuthenticationWarningContext))" result="viewScope.authenticationWarningContext" />
             <evaluate expression="T(net.shibboleth.shared.codec.HTMLEncoder)" result="viewScope.encoder" />
-            <evaluate expression="T(net.shibboleth.idp.plugin.authn.webauthn.impl.CredentialEncoder)" result="viewScope.credentialEncoder"/>
+            <evaluate expression="T(net.shibboleth.idp.plugin.authn.webauthn.impl.WebAuthnEncoder)" result="viewScope.webAuthnEncoder"/>
             <evaluate expression="flowRequestContext.getExternalContext().getNativeRequest()" result="viewScope.request" />
             <evaluate expression="flowRequestContext.getExternalContext().getNativeResponse()" result="viewScope.response" />
         </on-render>
@@ -93,7 +93,7 @@
             <evaluate expression="authenticationContext.getSubcontext(T(net.shibboleth.idp.authn.context.AuthenticationErrorContext))" result="viewScope.authenticationErrorContext" />
             <evaluate expression="authenticationContext.getSubcontext(T(net.shibboleth.idp.authn.context.AuthenticationWarningContext))" result="viewScope.authenticationWarningContext" />
             <evaluate expression="T(net.shibboleth.shared.codec.HTMLEncoder)" result="viewScope.encoder" />
-            <evaluate expression="T(net.shibboleth.idp.plugin.authn.webauthn.impl.CredentialEncoder)" result="viewScope.credentialEncoder"/>
+            <evaluate expression="T(net.shibboleth.idp.plugin.authn.webauthn.impl.WebAuthnEncoder)" result="viewScope.webAuthnEncoder"/>
             <evaluate expression="flowRequestContext.getExternalContext().getNativeRequest()" result="viewScope.request" />
             <evaluate expression="flowRequestContext.getExternalContext().getNativeResponse()" result="viewScope.response" />
         </on-render>
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register.vm b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register.vm
index 303591c..2f27c14 100644
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register.vm
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register.vm
@@ -12,7 +12,7 @@
 ## authenticationWarningContext - context with login warning state
 ## rpUIContext - the context with SP UI information from the metadata
 ## encoder - HTMLEncoder class
-## credentialEncoder - CredentialEncoder class
+## webAuthnEncoder - WebAuthnEncoder class
 ## request - HttpServletRequest
 ## response - HttpServletResponse
 ## environment - Spring Environment object for property resolution
@@ -117,9 +117,9 @@
                              #foreach($cred in $webauthnRegContext.existingCredentials)
                                 <tr>
                                     <td>$encoder.encodeForHTML($cred.nickname)</td>
-                                    <td>$encoder.encodeForHTML($credentialEncoder.formatTransports($cred.transports))</td>
-                                    <td>$encoder.encodeForHTML($credentialEncoder.formatDiscoverable($cred.isDiscoverable()))</td>
-                                    <td>$encoder.encodeForHTML($credentialEncoder.formatInstant($cred.registrationTime))</td>
+                                    <td>$encoder.encodeForHTML($webAuthnEncoder.formatTransports($cred.transports))</td>
+                                    <td>$encoder.encodeForHTML($webAuthnEncoder.formatDiscoverable($cred.isDiscoverable()))</td>
+                                    <td>$encoder.encodeForHTML($webAuthnEncoder.formatInstant($cred.registrationTime))</td>
                                     <td>
                                     <form id="deleteKeyForm" action="$flowExecutionUrl" method="post">
                                         #parse("csrf/csrf.vm")
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-registered.vm b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-registered.vm
index 64067ee..3a06395 100644
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-registered.vm
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-registered.vm
@@ -12,7 +12,7 @@
 ## authenticationWarningContext - context with login warning state
 ## rpUIContext - the context with SP UI information from the metadata
 ## encoder - HTMLEncoder class
-## credentialEncoder - CredentialEncoder class
+## webAuthnEncoder - WebAuthnEncoder class
 ## request - HttpServletRequest
 ## response - HttpServletResponse
 ## environment - Spring Environment object for property resolution
@@ -65,10 +65,10 @@
                         #foreach($cred in $webauthnRegContext.existingCredentials)
                         <tr>
                             <td>$encoder.encodeForHTML($cred.nickname)</td>
-                            <td>$encoder.encodeForHTML($credentialEncoder.formatTransports($cred.transports))</td>
-                            <td>$encoder.encodeForHTML($credentialEncoder.formatDiscoverable($cred.isDiscoverable()))</td>
+                            <td>$encoder.encodeForHTML($webAuthnEncoder.formatTransports($cred.transports))</td>
+                            <td>$encoder.encodeForHTML($webAuthnEncoder.formatDiscoverable($cred.isDiscoverable()))</td>
                             <td>$encoder.encodeForHTML($cred.userVerified)</td>
-                            <td>$encoder.encodeForHTML($credentialEncoder.formatInstant($cred.registrationTime))</td>
+                            <td>$encoder.encodeForHTML($webAuthnEncoder.formatInstant($cred.registrationTime))</td>
                         </tr>
                         #end
                     </table>

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


More information about the commits mailing list