[java-identity-provider COMMIT] in /trunk: idp-conf/src/main/resources/conf/intercept/context-check-intercept-config....

noreply at shibboleth.net noreply at shibboleth.net
Sun May 24 16:15:52 EDT 2015


Author: scantor
Date: Sun May 24 16:15:52 2015
New Revision: 7534

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7534&view=rev
Log:
IDP-729 - change attribute context checking predicate to look at unfiltered set

Modified:
    trunk/idp-conf/src/main/resources/conf/intercept/context-check-intercept-config.xml
    trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/SimpleAttributePredicate.java

Modified: trunk/idp-conf/src/main/resources/conf/intercept/context-check-intercept-config.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/conf/intercept/context-check-intercept-config.xml?rev=7534&r1=7533&r2=7534&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/conf/intercept/context-check-intercept-config.xml	(original)
+++ trunk/idp-conf/src/main/resources/conf/intercept/context-check-intercept-config.xml	Sun May 24 16:15:52 2015
@@ -23,7 +23,8 @@
         <constructor-arg>
             <list>
                 <bean parent="shibboleth.Conditions.RelyingPartyId" c:candidates="#{ 'https://sp.example.org' }" />
-                <bean class="net.shibboleth.idp.profile.logic.SimpleAttributePredicate">
+                <bean class="net.shibboleth.idp.profile.logic.SimpleAttributePredicate"
+                        p:useUnfilteredAttributes="true">
                     <property name="attributeValueMap">
                         <map>
                             <entry key="eppn">

Modified: trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/SimpleAttributePredicate.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/SimpleAttributePredicate.java?rev=7534&r1=7533&r2=7534&view=diff
==============================================================================
--- trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/SimpleAttributePredicate.java	(original)
+++ trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/SimpleAttributePredicate.java	Sun May 24 16:15:52 2015
@@ -63,6 +63,9 @@
     /** Strategy function to lookup {@link AttributeContext}. */
     @Nonnull private Function<ProfileRequestContext,AttributeContext> attributeContextLookupStrategy;
 
+    /** Whether to look at filtered or unfiltered attributes. */
+    private boolean useUnfilteredAttributes;
+
     /** Map of attribute IDs to values. */
     @Nonnull @NonnullElements private ListMultimap<String,String> attributeValueMap;
     
@@ -70,7 +73,7 @@
     public SimpleAttributePredicate() {
         attributeContextLookupStrategy = Functions.compose(new ChildContextLookup<>(AttributeContext.class),
                 new ChildContextLookup<ProfileRequestContext,RelyingPartyContext>(RelyingPartyContext.class));
-        
+        useUnfilteredAttributes = true;
         attributeValueMap = ArrayListMultimap.create();
     }
 
@@ -84,6 +87,17 @@
 
         attributeContextLookupStrategy =
                 Constraint.isNotNull(strategy, "AttributeContext lookup strategy cannot be null");
+    }
+    
+    /**
+     * Set whether to source the input attributes from the unfiltered set.
+     * 
+     * <p>Defaults to true.</p>
+     * 
+     * @param flag flag to set
+     */
+    public void setUseUnfilteredAttributes(final boolean flag) {
+        useUnfilteredAttributes = flag;
     }
     
     /**
@@ -111,10 +125,13 @@
             return attributeValueMap.isEmpty();
         }
         
+        final Map<String,IdPAttribute> attributes = useUnfilteredAttributes ? attributeCtx.getUnfilteredIdPAttributes()
+                : attributeCtx.getIdPAttributes();
+        
         for (final String id : attributeValueMap.keySet()) {
             log.debug("Checking for attribute: {}", id);
             
-            final IdPAttribute attribute = attributeCtx.getIdPAttributes().get(id);
+            final IdPAttribute attribute = attributes.get(id);
             if (attribute == null) {
                 log.info("Attribute {} not found in context", id);
                 return false;



More information about the commits mailing list