[java-shib-common COMMIT] in /branches/REL_1: doc/RELEASE-NOTES.txt src/main/java/edu/internet2/middleware/shibboleth...

noreply at shibboleth.net noreply at shibboleth.net
Wed Oct 29 00:33:44 EDT 2014


Author: scantor
Date: Wed Oct 29 00:33:43 2014
New Revision: 1114

URL: http://svn.shibboleth.net/view/java-shib-common?rev=1114&view=rev
Log:
SC-198 -  Extend AttributeInMetadata match functor to solve indirect attribute requirement expressions

Added:
    branches/REL_1/src/test/java/edu/internet2/middleware/shibboleth/common/attribute/filtering/provider/match/saml/AttributeInMetadataMatchFunctorTestCase.java   (with props)
Modified:
    branches/REL_1/doc/RELEASE-NOTES.txt
    branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/filtering/provider/match/saml/AttributeInMetadataMatchFunctor.java
    branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/resolver/provider/dataConnector/StaticDataConnector.java
    branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/config/attribute/filtering/match/saml/AttributeInMetadataMatchFunctorBeanDefinitionParser.java
    branches/REL_1/src/main/resources/schema/shibboleth-2.0-afp-mf-saml.xsd
    branches/REL_1/src/test/resources/data/edu/internet2/middleware/shibboleth/common/config/metadata/Metadata1.xml

Modified: branches/REL_1/doc/RELEASE-NOTES.txt
URL: http://svn.shibboleth.net/view/java-shib-common/branches/REL_1/doc/RELEASE-NOTES.txt?rev=1114&r1=1113&r2=1114&view=diff
==============================================================================
--- branches/REL_1/doc/RELEASE-NOTES.txt (original)
+++ branches/REL_1/doc/RELEASE-NOTES.txt Wed Oct 29 00:33:43 2014
@@ -2,6 +2,7 @@
 =============================================
 [SC-196] - IdP will send empty Subject:NameID in assertion
 [SC-197] - Target of value/scope rules in Permit/Deny context are ignored
+[SC-198] - Extend AttributeInMetadata match functor for indirect attribute requirement expressions 
 
 Changes in Release 1.4.2
 =============================================

Modified: branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/filtering/provider/match/saml/AttributeInMetadataMatchFunctor.java
URL: http://svn.shibboleth.net/view/java-shib-common/branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/filtering/provider/match/saml/AttributeInMetadataMatchFunctor.java?rev=1114&r1=1113&r2=1114&view=diff
==============================================================================
--- branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/filtering/provider/match/saml/AttributeInMetadataMatchFunctor.java (original)
+++ branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/common/attribute/filtering/provider/match/saml/AttributeInMetadataMatchFunctor.java Wed Oct 29 00:33:43 2014
@@ -36,6 +36,7 @@
 import org.opensaml.xml.schema.XSInteger;
 import org.opensaml.xml.schema.XSString;
 import org.opensaml.xml.schema.XSURI;
+import org.opensaml.xml.util.DatatypeHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -62,6 +63,12 @@
     
     /** Whether to return a match if the metadata does not contain an ACS descriptor. */
     private boolean matchIfMetadataSilent;
+    
+    /** The SAML Attribute Name to look for in the metadata. */
+    private String attributeName;
+
+    /** The SAML Attribute NameFormat to look for in the metadata. */
+    private String attributeNameFormat;
 
     /**
      * Gets whether optionally requested attributes should be matched.
@@ -98,24 +105,43 @@
     public void setMatchIfMetadataSilent(final boolean flag) {
         matchIfMetadataSilent = flag;
     }
-    
+
+    /**
+     * Set the SAML Attribute Name to look for in the metadata. If not used, the
+     * evaluated attribute's own eventual encoded name(s) will be used to find a match.
+     * 
+     * <p>This allows a "look aside" to match a different SAML Attribute Name in the metadata.</p>
+     * 
+     * @param name the Name to look for
+     */
+    public void setAttributeName(String name) {
+        attributeName = DatatypeHelper.safeTrimOrNullString(name);
+    }
+
+    /**
+     * Set the SAML Attribute Namespace to look for in the metadata. If not used, the
+     * evaluated attribute's own eventual encoded name format(s) will be used to find a match.
+     * 
+     * <p>This allows a "look aside" to match a different SAML Attribute NameFormat in the metadata.</p>
+     * 
+     * @param format the NameFormat to look for
+     */
+    public void setAttributeNameFormat(String format) {
+        attributeNameFormat = DatatypeHelper.safeTrimOrNullString(format);
+        if (attributeNameFormat != null && Attribute.UNSPECIFIED.equals(attributeNameFormat)) {
+            attributeNameFormat = null;
+        }
+    }
+
     /** {@inheritDoc} */
     protected boolean doEvaluatePolicyRequirement(final ShibbolethFilteringContext filterContext)
             throws FilterProcessingException {
-        throw new FilterProcessingException("This match functor is not supported in policy requirements");
-    }
-
-    /** {@inheritDoc} */
-    protected boolean doEvaluateValue(final ShibbolethFilteringContext filterContext, final String attributeId,

[... 340 lines stripped ...]


More information about the commits mailing list