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

noreply at shibboleth.net noreply at shibboleth.net
Mon Jun 10 13:01:40 EDT 2013


Author: rdw
Date: Mon Jun 10 13:01:39 2013
New Revision: 4528

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4528&view=rev
Log:
IDP-208 AttributeInMetadataMatcher and tests

Added:
    trunk/idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/RequestedAttribute.java   (with props)
    trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/impl/saml/AttributeInMetadataMatcher.java   (with props)
    trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/impl/saml/AttributeInMetadataMatcherTest.java   (with props)
Modified:
    trunk/idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/AttributeFilterContext.java
    trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/impl/matcher/DataSources.java

Modified: trunk/idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/AttributeFilterContext.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/AttributeFilterContext.java?rev=4528&r1=4527&r2=4528&view=diff
==============================================================================
--- trunk/idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/AttributeFilterContext.java (original)
+++ trunk/idp-attribute-filter-api/src/main/java/net/shibboleth/idp/attribute/filter/AttributeFilterContext.java Mon Jun 10 13:01:39 2013
@@ -57,6 +57,9 @@
 
     /** Values, for a given attribute, that are not permitted to be released. */
     private Map<String, Set<AttributeValue>> deniedValues;
+    
+    /** The requested Attributes (from the metadata for this request). */
+    private Map<String, RequestedAttribute> requestedAttributes;
 
     /** Attributes which have been filtered. */
     private Map<String, Attribute> filteredAttributes;
@@ -223,4 +226,27 @@
             filteredAttributes.put(attribute.getId(), attribute);
         }
     }
+
+    /** Get the attributes requested in the ACS.
+     * @return Returns the requestedAttributes.
+     */
+    public Map<String,RequestedAttribute> getRequestedAttributes() {
+        return requestedAttributes;
+    }
+
+    /** Set the attributes requested by the ACS.
+     * @param attributes The requestedAttributes to set.
+     */
+    public void setRequestedAttributes(@Nullable @NullableElements final Collection<RequestedAttribute> attributes) {
+        Collection<RequestedAttribute> checkedAttributes = new ArrayList<RequestedAttribute>();
+        CollectionSupport.addIf(checkedAttributes, attributes, Predicates.notNull());
+
+        requestedAttributes =
+                MapConstraints.constrainedMap(new HashMap<String, RequestedAttribute>(checkedAttributes.size()),
+                        MapConstraints.notNull());
+
+        for (RequestedAttribute attribute : checkedAttributes) {
+            requestedAttributes.put(attribute.getId(), attribute);
+        }
+    }
 }

Modified: trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/impl/matcher/DataSources.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/impl/matcher/DataSources.java?rev=4528&r1=4527&r2=4528&view=diff
==============================================================================
--- trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/impl/matcher/DataSources.java (original)
+++ trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/impl/matcher/DataSources.java Mon Jun 10 13:01:39 2013
@@ -32,7 +32,7 @@
 /**
  * Strings and such used for testing.
  */
-public class DataSources {
+public abstract class DataSources {
 
     public final static String TEST_STRING = "nibbleahappywarthog";
 



More information about the commits mailing list