[java-identity-provider COMMIT] in /trunk/idp-attribute-filter-api: pom.xml src/main/java/net/shibboleth/idp/attribut...

noreply at shibboleth.net noreply at shibboleth.net
Tue Jul 30 13:31:46 EDT 2013


Author: scantor
Date: Tue Jul 30 13:31:46 2013
New Revision: 4634

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4634&view=rev
Log:
IDP-264: relax name format matching for attributes

Modified:
    trunk/idp-attribute-filter-api/pom.xml
    trunk/idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/attributemapper/AbstractSAMLAttributeMapper.java

Modified: trunk/idp-attribute-filter-api/pom.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-filter-api/pom.xml?rev=4634&r1=4633&r2=4634&view=diff
==============================================================================
--- trunk/idp-attribute-filter-api/pom.xml (original)
+++ trunk/idp-attribute-filter-api/pom.xml Tue Jul 30 13:31:46 2013
@@ -25,7 +25,7 @@
 
         <dependency>
             <groupId>${opensaml.groupId}</groupId>
-            <artifactId>opensaml-storage-api</artifactId>
+            <artifactId>opensaml-saml-api</artifactId>
             <version>${opensaml.version}</version>
         </dependency>
 

Modified: trunk/idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/attributemapper/AbstractSAMLAttributeMapper.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/attributemapper/AbstractSAMLAttributeMapper.java?rev=4634&r1=4633&r2=4634&view=diff
==============================================================================
--- trunk/idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/attributemapper/AbstractSAMLAttributeMapper.java (original)
+++ trunk/idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/attributemapper/AbstractSAMLAttributeMapper.java Tue Jul 30 13:31:46 2013
@@ -148,8 +148,8 @@
      * 
      * @param format The attributeFormat to set.
      */
-    public void setAttributeFormat(String format) {
-        attributeFormat = format;
+    public void setAttributeFormat(@Nullable final String format) {
+        attributeFormat = StringSupport.trimOrNull(format);
     }
 
     /**
@@ -158,7 +158,7 @@
      * @return Returns the format.
      */
     @Nullable public String getAttributeFormat() {
-        return StringSupport.trimOrNull(attributeFormat);
+        return attributeFormat;
     }
 
     /** {@inheritDoc} */
@@ -175,7 +175,7 @@
     }
 
     /**
-     * Does the attribute match the provided parameterisation.
+     * Determines if the attribute matches the provided parameterisation.
      * 
      * @param attribute the attribute to consider
      * @return whether it matches.
@@ -188,8 +188,14 @@
             return false;
         }
 
-        final String format = attribute.getNameFormat();
-        if (getAttributeFormat() != null && !getAttributeFormat().equals(format)) {
+        // Ignore format if it's "unspecified".
+        String format = attribute.getNameFormat();
+        if (org.opensaml.saml.saml2.core.Attribute.UNSPECIFIED.equals(format)) {
+            format = null;
+        }
+        
+        if (getAttributeFormat() != null && format != null && !getAttributeFormat().equals(format)
+                && !org.opensaml.saml.saml2.core.Attribute.UNSPECIFIED.equals(getAttributeFormat())) {
             log.debug("{} SAML name format {} does not match {}", getLogPrefix(), format, getAttributeFormat());
             return false;
         }



More information about the commits mailing list