[java-idp-plugin-webauthn] branch main updated: Remove constraint checks from nullable context fields

Phil Smart philip.smart at jisc.ac.uk
Wed Jul 31 15:39:53 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=4f99cd653bb87c068834142f70ab142ded7b8e76

The following commit(s) were added to refs/heads/main by this push:
     new 4f99cd6  Remove constraint checks from nullable context fields
4f99cd6 is described below

commit 4f99cd653bb87c068834142f70ab142ded7b8e76
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Wed Jul 31 16:39:51 2024 +0100

    Remove constraint checks from nullable context fields
---
 .../idp/plugin/authn/webauthn/context/BaseWebAuthnContext.java     | 7 +++----
 .../plugin/authn/webauthn/context/WebAuthnRegistrationContext.java | 6 ++----
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/BaseWebAuthnContext.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/BaseWebAuthnContext.java
index 6581494..341ba18 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/BaseWebAuthnContext.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/BaseWebAuthnContext.java
@@ -24,7 +24,6 @@ import org.opensaml.messaging.context.BaseContext;
 import com.yubico.webauthn.data.UserVerificationRequirement;
 
 import net.shibboleth.idp.plugin.authn.webauthn.storage.CredentialRegistration;
-import net.shibboleth.shared.annotation.constraint.NotEmpty;
 import net.shibboleth.shared.annotation.constraint.NotLive;
 import net.shibboleth.shared.annotation.constraint.Unmodifiable;
 import net.shibboleth.shared.collection.CollectionSupport;
@@ -78,14 +77,14 @@ public class BaseWebAuthnContext extends BaseContext {
     }
 
     /**
-     * Sets the username (WebAuthn user.name). Must not be empty or {@code null}.
+     * Sets the username (WebAuthn user.name). 
      * 
      * @param name the user.name
      * 
      * @return this context
      */
-    @Nonnull public BaseWebAuthnContext setUsername(@Nonnull @NotEmpty final String name) {
-        username = Constraint.isNotEmpty(name, "User.name can not be null or empty");
+    @Nonnull public BaseWebAuthnContext setUsername(@Nullable final String name) {
+        username = name;
         return this;
     }
 
diff --git a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnRegistrationContext.java b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnRegistrationContext.java
index 2b8bced..36934bf 100644
--- a/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnRegistrationContext.java
+++ b/webauthn-api/src/main/java/net/shibboleth/idp/plugin/authn/webauthn/context/WebAuthnRegistrationContext.java
@@ -13,8 +13,6 @@ import com.yubico.webauthn.data.PublicKeyCredentialCreationOptions;
 import com.yubico.webauthn.data.ResidentKeyRequirement;
 
 import net.shibboleth.idp.plugin.authn.webauthn.admin.RegistrationResult;
-import net.shibboleth.shared.annotation.constraint.NotEmpty;
-import net.shibboleth.shared.logic.Constraint;
 
 
 /** 
@@ -250,8 +248,8 @@ public final class WebAuthnRegistrationContext extends BaseWebAuthnContext {
      * 
      * @param name The display name to set.
      */
-    @Nonnull public BaseWebAuthnContext setDisplayName(@Nonnull @NotEmpty final String name) {
-        displayName = Constraint.isNotEmpty(name, "The Display Name can not be null");
+    @Nonnull public BaseWebAuthnContext setDisplayName(@Nullable final String name) {
+        displayName = name;
         return this;
     }
     

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


More information about the commits mailing list