[java-oidc-common] branch main updated: Add not empty constraint to constructor argument

Phil Smart philip.smart at jisc.ac.uk
Thu Feb 3 10:08:35 UTC 2022


This is an automated email from the git hooks/post-receive script.

philsmart pushed a commit to branch main
in repository java-oidc-common.

View the commit online:
http://git.shibboleth.net/view/?p=java-oidc-common.git;a=commit;h=295e5a43bc1e0a42a0ec1b97397d9b365f129076

The following commit(s) were added to refs/heads/main by this push:
     new 295e5a4  Add not empty constraint to constructor argument
295e5a4 is described below

commit 295e5a43bc1e0a42a0ec1b97397d9b365f129076
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Thu Feb 3 10:08:30 2022 +0000

    Add not empty constraint to constructor argument
---
 .../security/jwt/claims/impl/ClaimExistsActivationCondition.java  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/oidc-common-crypto-impl/src/main/java/net/shibboleth/oidc/security/jwt/claims/impl/ClaimExistsActivationCondition.java b/oidc-common-crypto-impl/src/main/java/net/shibboleth/oidc/security/jwt/claims/impl/ClaimExistsActivationCondition.java
index 56b7caf..f7a971f 100644
--- a/oidc-common-crypto-impl/src/main/java/net/shibboleth/oidc/security/jwt/claims/impl/ClaimExistsActivationCondition.java
+++ b/oidc-common-crypto-impl/src/main/java/net/shibboleth/oidc/security/jwt/claims/impl/ClaimExistsActivationCondition.java
@@ -27,13 +27,15 @@ import org.opensaml.profile.context.ProfileRequestContext;
 import com.nimbusds.jwt.JWTClaimsSet;
 
 import net.shibboleth.utilities.java.support.annotation.ParameterName;
+import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
+import net.shibboleth.utilities.java.support.logic.Constraint;
 
 /** Activation condition to check a claim exists in the claims set.*/
 @ThreadSafe
 public class ClaimExistsActivationCondition implements BiPredicate<ProfileRequestContext, JWTClaimsSet> {
     
     /** The name of the claim to check exists in the claims set.*/
-    @Nonnull private final String claimToCheck;
+    @Nonnull @NotEmpty private final String claimToCheck;
     
     /**
      * 
@@ -42,8 +44,8 @@ public class ClaimExistsActivationCondition implements BiPredicate<ProfileReques
      * @param claimName the name of the claim to check exists in the claims set.
      */
     public ClaimExistsActivationCondition(
-            @Nonnull @ParameterName(name="claimToCheck") final String claimName) {
-        claimToCheck = claimName;
+            @Nonnull @NotEmpty @ParameterName(name="claimToCheck") final String claimName) {
+        claimToCheck = Constraint.isNotEmpty(claimName, "Claim to check can not be empty or null");
     }
 
     @Override

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


More information about the commits mailing list