[java-opensaml] branch main updated: Add a few annotations for IdP cleanup.

Scott Cantor cantor.2 at osu.edu
Thu Mar 2 16:30:26 UTC 2023


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

scantor pushed a commit to branch main
in repository java-opensaml.

View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=5e8d5899b90d04f3ae9913a93463b7a99281fbce

The following commit(s) were added to refs/heads/main by this push:
     new 5e8d5899b Add a few annotations for IdP cleanup.
5e8d5899b is described below

commit 5e8d5899b90d04f3ae9913a93463b7a99281fbce
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Mar 2 11:30:24 2023 -0500

    Add a few annotations for IdP cleanup.
---
 .../java/org/opensaml/soap/wssecurity/Password.java    | 18 +++++++++++-------
 .../java/org/opensaml/soap/wssecurity/Security.java    | 11 +++++++----
 .../org/opensaml/soap/wssecurity/UsernameToken.java    | 16 ++++++++++------
 3 files changed, 28 insertions(+), 17 deletions(-)

diff --git a/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/Password.java b/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/Password.java
index 9776b201c..7b6cd8ef7 100644
--- a/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/Password.java
+++ b/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/Password.java
@@ -17,8 +17,12 @@
 
 package org.opensaml.soap.wssecurity;
 
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 import javax.xml.namespace.QName;
 
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
+
 /**
  * The <code>Password</code> element.
  * 
@@ -27,37 +31,37 @@ import javax.xml.namespace.QName;
  */
 public interface Password extends AttributedString {
     /** Element local name. */
-    public static final String ELEMENT_LOCAL_NAME = "Password";
+    @Nonnull @NotEmpty public static final String ELEMENT_LOCAL_NAME = "Password";
 
     /** Qualified element name. */
-    public static final QName ELEMENT_NAME = 
+    @Nonnull public static final QName ELEMENT_NAME = 
         new QName(WSSecurityConstants.WSSE_NS, ELEMENT_LOCAL_NAME, WSSecurityConstants.WSSE_PREFIX);
 
     /** The <code>Type</code> attribute local name. */
-    public static final String TYPE_ATTRIB_NAME = "Type";
+    @Nonnull @NotEmpty public static final String TYPE_ATTRIB_NAME = "Type";
     
     /**
      * The <code>wsse:Password/@Type</code> attribute URI value <code>#PasswordText</code> (DEFAULT).
      */
-    public static final String TYPE_PASSWORD_TEXT = WSSecurityConstants.WSSE_NS + "#PasswordText";
+    @Nonnull @NotEmpty public static final String TYPE_PASSWORD_TEXT = WSSecurityConstants.WSSE_NS + "#PasswordText";
 
     /**
      * The <code>wsse:Password/@Type</code> attribute URI value <code>#PasswordDigest</code>.
      */
-    public static final String TYPE_PASSWORD_DIGEST = WSSecurityConstants.WSSE_NS + "#PasswordDigest";
+    @Nonnull @NotEmpty public static final String TYPE_PASSWORD_DIGEST = WSSecurityConstants.WSSE_NS + "#PasswordDigest";
 
     /**
      * Returns the <code>wsse:Password/@Type</code> attribute URI value.
      * 
      * @return the <code>Type</code> attribute URI value.
      */
-    public String getType();
+    @Nullable public String getType();
 
     /**
      * Sets the <code>wsse:Password/@Type</code> attribute URI value.
      * 
      * @param type the <code>Type</code> attribute URI value to set.
      */
-    public void setType(String type);
+    public void setType(@Nullable String type);
 
 }
diff --git a/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/Security.java b/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/Security.java
index c539da62a..7934dad06 100644
--- a/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/Security.java
+++ b/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/Security.java
@@ -17,11 +17,14 @@
 
 package org.opensaml.soap.wssecurity;
 
+import javax.annotation.Nonnull;
 import javax.xml.namespace.QName;
 
 import org.opensaml.core.xml.AttributeExtensibleXMLObject;
 import org.opensaml.core.xml.ElementExtensibleXMLObject;
 
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
+
 /**
  * The <wsse:Security> header block.
  * 
@@ -31,17 +34,17 @@ import org.opensaml.core.xml.ElementExtensibleXMLObject;
 public interface Security extends AttributeExtensibleXMLObject, ElementExtensibleXMLObject, WSSecurityObject {
 
     /** Element local name. */
-    public static final String ELEMENT_LOCAL_NAME = "Security";
+    @Nonnull @NotEmpty public static final String ELEMENT_LOCAL_NAME = "Security";
 
     /** Qualified element name. */
-    public static final QName ELEMENT_NAME =
+    @Nonnull public static final QName ELEMENT_NAME =
         new QName(WSSecurityConstants.WSSE_NS, ELEMENT_LOCAL_NAME, WSSecurityConstants.WSSE_PREFIX);
     
     /** Local name of the XSI type. */
-    public static final String TYPE_LOCAL_NAME = "SecurityHeaderType"; 
+    @Nonnull @NotEmpty public static final String TYPE_LOCAL_NAME = "SecurityHeaderType"; 
         
     /** QName of the XSI type. */
-    public static final QName TYPE_NAME = 
+    @Nonnull public static final QName TYPE_NAME = 
         new QName(WSSecurityConstants.WSSE_NS, TYPE_LOCAL_NAME, WSSecurityConstants.WSSE_PREFIX);
 
 }
diff --git a/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/UsernameToken.java b/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/UsernameToken.java
index fcb72b554..d0c1c2d8e 100644
--- a/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/UsernameToken.java
+++ b/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/UsernameToken.java
@@ -17,11 +17,15 @@
 
 package org.opensaml.soap.wssecurity;
 
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 import javax.xml.namespace.QName;
 
 import org.opensaml.core.xml.AttributeExtensibleXMLObject;
 import org.opensaml.core.xml.ElementExtensibleXMLObject;
 
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
+
 /**
  * The <wsse:UsernameToken> element.
  * 
@@ -32,17 +36,17 @@ public interface UsernameToken extends IdBearing, AttributeExtensibleXMLObject,
         ElementExtensibleXMLObject, WSSecurityObject {
     
     /** Element local name. */
-    public static final String ELEMENT_LOCAL_NAME = "UsernameToken";
+    @Nonnull @NotEmpty public static final String ELEMENT_LOCAL_NAME = "UsernameToken";
 
     /** Qualified element name. */
-    public static final QName ELEMENT_NAME =
+    @Nonnull public static final QName ELEMENT_NAME =
         new QName(WSSecurityConstants.WSSE_NS, ELEMENT_LOCAL_NAME, WSSecurityConstants.WSSE_PREFIX);
     
     /** Local name of the XSI type. */
-    public static final String TYPE_LOCAL_NAME = "UsernameTokenType"; 
+    @Nonnull @NotEmpty public static final String TYPE_LOCAL_NAME = "UsernameTokenType"; 
         
     /** QName of the XSI type. */
-    public static final QName TYPE_NAME = 
+    @Nonnull public static final QName TYPE_NAME = 
         new QName(WSSecurityConstants.WSSE_NS, TYPE_LOCAL_NAME, WSSecurityConstants.WSSE_PREFIX);
 
     /**
@@ -50,7 +54,7 @@ public interface UsernameToken extends IdBearing, AttributeExtensibleXMLObject,
      * 
      * @return the {@link Username} child element.
      */
-    public Username getUsername();
+    @Nullable public Username getUsername();
 
     /**
      * Sets the <wsse:Username> child element.
@@ -58,6 +62,6 @@ public interface UsernameToken extends IdBearing, AttributeExtensibleXMLObject,
      * @param username
      *            the {@link Username} child element to set.
      */
-    public void setUsername(Username username);
+    public void setUsername(@Nullable Username username);
 
 }

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


More information about the commits mailing list