[java-identity-provider COMMIT] in /trunk: idp-attribute-filter-impl/pom.xml idp-attribute-filter-impl/src/main/java/...

noreply at shibboleth.net noreply at shibboleth.net
Mon Jun 16 09:56:16 EDT 2014


Author: rdw
Date: Mon Jun 16 09:56:16 2014
New Revision: 6090

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6090&view=rev
Log:
IDP-376 Do not default the object strategy in the MetadataPolicyFilter because of visibility issues.  Inject it when parsing.

Modified:
    trunk/idp-attribute-filter-impl/pom.xml
    trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/policyrule/saml/impl/AttributeInMetadataPolicyRule.java
    trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/saml/impl/AttributeInMetadataPolicyRuleTest.java
    trunk/idp-attribute-filter-spring/src/main/java/net/shibboleth/idp/attribute/filter/spring/saml/AttributeInMetadataRuleParser.java

Modified: trunk/idp-attribute-filter-impl/pom.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-filter-impl/pom.xml?rev=6090&r1=6089&r2=6090&view=diff
==============================================================================
--- trunk/idp-attribute-filter-impl/pom.xml (original)
+++ trunk/idp-attribute-filter-impl/pom.xml Mon Jun 16 09:56:16 2014
@@ -61,6 +61,12 @@
             <type>test-jar</type>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>idp-saml-impl</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
         
         <dependency>
             <groupId>${project.groupId}</groupId>

Modified: trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/policyrule/saml/impl/AttributeInMetadataPolicyRule.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/policyrule/saml/impl/AttributeInMetadataPolicyRule.java?rev=6090&r1=6089&r2=6090&view=diff
==============================================================================
--- trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/policyrule/saml/impl/AttributeInMetadataPolicyRule.java (original)
+++ trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/policyrule/saml/impl/AttributeInMetadataPolicyRule.java Mon Jun 16 09:56:16 2014
@@ -32,8 +32,10 @@
 import net.shibboleth.idp.attribute.filter.Matcher;
 import net.shibboleth.idp.attribute.filter.context.AttributeFilterContext;
 import net.shibboleth.idp.saml.attribute.mapping.AttributesMapContainer;
+import net.shibboleth.utilities.java.support.annotation.constraint.NonnullAfterInit;
 import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
 import net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
 import net.shibboleth.utilities.java.support.component.ComponentSupport;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 
@@ -64,7 +66,7 @@
     private String logPrefix;
 
     /** The strategy to get the appropriate XMLObject from the context. */
-    @Nonnull private Function<SAMLMetadataContext, ? extends XMLObject> objectStrategy;
+    @NonnullAfterInit private Function<SAMLMetadataContext, ? extends XMLObject> objectStrategy;
 
     /**
      * Gets whether optionally requested attributes should be matched.
@@ -118,6 +120,15 @@
      */
     public void setMatchIfMetadataSilent(final boolean flag) {
         matchIfMetadataSilent = flag;
+    }
+    
+    /** {@inheritDoc} */
+    @Override
+    protected void doInitialize() throws ComponentInitializationException {
+        super.doInitialize();
+        if (null == objectStrategy) {
+            throw new ComponentInitializationException(getLogPrefix() + " Object strategy was non null");
+        }
     }
 
     /**

Modified: trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/saml/impl/AttributeInMetadataPolicyRuleTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/saml/impl/AttributeInMetadataPolicyRuleTest.java?rev=6090&r1=6089&r2=6090&view=diff
==============================================================================
--- trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/saml/impl/AttributeInMetadataPolicyRuleTest.java (original)
+++ trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/saml/impl/AttributeInMetadataPolicyRuleTest.java Mon Jun 16 09:56:16 2014
@@ -26,12 +26,16 @@
 import net.shibboleth.idp.attribute.IdPRequestedAttribute;
 import net.shibboleth.idp.attribute.filter.context.AttributeFilterContext;
 import net.shibboleth.idp.attribute.filter.matcher.impl.DataSources;
-import net.shibboleth.idp.attribute.filter.policyrule.saml.impl.AttributeInMetadataPolicyRule;

[... 73 lines stripped ...]


More information about the commits mailing list