[java-identity-provider] branch master updated: Fix artifactConfiguration property handling and wire up tag lookup.

Scott Cantor cantor.2 at osu.edu
Thu Oct 4 20:31:53 EDT 2018


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=ad2324c91b181003bda5cfc3cc92a22889c350b7

The following commit(s) were added to refs/heads/master by this push:
       new  ad2324c   Fix artifactConfiguration property handling and wire up tag lookup.
ad2324c is described below

commit ad2324c91b181003bda5cfc3cc92a22889c350b7
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Oct 4 20:31:33 2018 -0400

    Fix artifactConfiguration property handling and wire up tag lookup.
---
 .../resources/system/conf/relying-party-mddriven.xml     | 12 ++++++++++++
 .../AbstractSAML1ArtifactAwareProfileConfiguration.java  | 16 ++++++++--------
 .../AbstractSAML2ArtifactAwareProfileConfiguration.java  | 16 ++++++++--------
 3 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/idp-conf/src/main/resources/system/conf/relying-party-mddriven.xml b/idp-conf/src/main/resources/system/conf/relying-party-mddriven.xml
index b669763..18bca21 100644
--- a/idp-conf/src/main/resources/system/conf/relying-party-mddriven.xml
+++ b/idp-conf/src/main/resources/system/conf/relying-party-mddriven.xml
@@ -197,6 +197,10 @@
             class="net.shibboleth.idp.saml.saml1.profile.config.BrowserSSOProfileConfiguration"
             p:artifactConfiguration-ref="shibboleth.DefaultArtifactConfiguration"
             p:inboundInterceptorFlows="security-policy/shibboleth-sso">
+        <property name="artifactConfigurationLookupStrategy">
+            <bean parent="shibboleth.MDDrivenBeanProperty" p:propertyName="artifactConfiguration"
+                p:propertyType="#{T(net.shibboleth.idp.saml.profile.config.SAMLArtifactConfiguration)}" />
+        </property>
         <property name="signResponses">
             <bean class="net.shibboleth.utilities.java.support.logic.PredicateSupport" factory-method="fromFunction">
                 <constructor-arg>
@@ -275,6 +279,10 @@
             class="net.shibboleth.idp.saml.saml2.profile.config.BrowserSSOProfileConfiguration"
             p:artifactConfiguration-ref="shibboleth.DefaultArtifactConfiguration"
             p:inboundInterceptorFlows="security-policy/saml2-sso">
+        <property name="artifactConfigurationLookupStrategy">
+            <bean parent="shibboleth.MDDrivenBeanProperty" p:propertyName="artifactConfiguration"
+                p:propertyType="#{T(net.shibboleth.idp.saml.profile.config.SAMLArtifactConfiguration)}" />
+        </property>
         <property name="signArtifactRequests">
             <bean class="net.shibboleth.utilities.java.support.logic.PredicateSupport" factory-method="fromFunction">
                 <constructor-arg>
@@ -385,6 +393,10 @@
             class="net.shibboleth.idp.saml.saml2.profile.config.SingleLogoutProfileConfiguration"
             p:artifactConfiguration-ref="shibboleth.DefaultArtifactConfiguration"
             p:inboundInterceptorFlows="security-policy/saml2-slo">
+        <property name="artifactConfigurationLookupStrategy">
+            <bean parent="shibboleth.MDDrivenBeanProperty" p:propertyName="artifactConfiguration"
+                p:propertyType="#{T(net.shibboleth.idp.saml.profile.config.SAMLArtifactConfiguration)}" />
+        </property>
         <property name="signArtifactRequests">
             <bean class="net.shibboleth.utilities.java.support.logic.PredicateSupport" factory-method="fromFunction">
                 <constructor-arg>
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml1/profile/config/AbstractSAML1ArtifactAwareProfileConfiguration.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml1/profile/config/AbstractSAML1ArtifactAwareProfileConfiguration.java
index 309b998..aac28f2 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml1/profile/config/AbstractSAML1ArtifactAwareProfileConfiguration.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml1/profile/config/AbstractSAML1ArtifactAwareProfileConfiguration.java
@@ -27,7 +27,6 @@ import net.shibboleth.idp.saml.profile.config.AbstractSAMLProfileConfiguration;
 import net.shibboleth.idp.saml.profile.config.SAMLArtifactAwareProfileConfiguration;
 import net.shibboleth.idp.saml.profile.config.SAMLArtifactConfiguration;
 import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
-import net.shibboleth.utilities.java.support.logic.FunctionSupport;
 
 /**
  * Configuration support for artifact-aware profiles.
@@ -38,8 +37,11 @@ public abstract class AbstractSAML1ArtifactAwareProfileConfiguration
         extends AbstractSAMLProfileConfiguration
         implements SAML1ProfileConfiguration, SAMLArtifactAwareProfileConfiguration {
 
+    /** Explicitly set artifact configuration. */
+    @Nullable private SAMLArtifactConfiguration artifactConfiguration; 
+    
     /** Lookup function to supply <code>artifactConfiguration</code> property. */
-    @Nonnull private Function<ProfileRequestContext,SAMLArtifactConfiguration> artifactConfigurationLookupStrategy;
+    @Nullable private Function<ProfileRequestContext,SAMLArtifactConfiguration> artifactConfigurationLookupStrategy;
 
     /**
      * Constructor.
@@ -48,12 +50,11 @@ public abstract class AbstractSAML1ArtifactAwareProfileConfiguration
      */
     protected AbstractSAML1ArtifactAwareProfileConfiguration(@Nonnull @NotEmpty final String profileId) {
         super(profileId);
-        artifactConfigurationLookupStrategy = FunctionSupport.constant(null);
     }
     
     /** {@inheritDoc} */
-    @Override @Nullable public SAMLArtifactConfiguration getArtifactConfiguration() {
-        return artifactConfigurationLookupStrategy.apply(getProfileRequestContext());
+    @Nullable public SAMLArtifactConfiguration getArtifactConfiguration() {
+        return getIndirectProperty(artifactConfigurationLookupStrategy, artifactConfiguration);
     }
 
     /**
@@ -62,7 +63,7 @@ public abstract class AbstractSAML1ArtifactAwareProfileConfiguration
      * @param config configuration to set
      */
     public void setArtifactConfiguration(@Nullable final SAMLArtifactConfiguration config) {
-        artifactConfigurationLookupStrategy = FunctionSupport.constant(config);
+        artifactConfiguration = config;
     }
 
     /**
@@ -74,8 +75,7 @@ public abstract class AbstractSAML1ArtifactAwareProfileConfiguration
      */
     public void setArtifactConfigurationLookupStrategy(
             @Nullable final Function<ProfileRequestContext,SAMLArtifactConfiguration> strategy) {
-        artifactConfigurationLookupStrategy = strategy != null
-                ? strategy : FunctionSupport.<ProfileRequestContext,SAMLArtifactConfiguration>constant(null);
+        artifactConfigurationLookupStrategy = strategy;
     }
 
 }
\ No newline at end of file
diff --git a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/AbstractSAML2ArtifactAwareProfileConfiguration.java b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/AbstractSAML2ArtifactAwareProfileConfiguration.java
index 4b0a16d..b42364e 100644
--- a/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/AbstractSAML2ArtifactAwareProfileConfiguration.java
+++ b/idp-saml-api/src/main/java/net/shibboleth/idp/saml/saml2/profile/config/AbstractSAML2ArtifactAwareProfileConfiguration.java
@@ -33,7 +33,6 @@ import net.shibboleth.idp.saml.profile.config.SAMLArtifactConfiguration;
 import net.shibboleth.idp.saml.profile.config.SAMLArtifactConsumerProfileConfiguration;
 import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
 import net.shibboleth.utilities.java.support.logic.Constraint;
-import net.shibboleth.utilities.java.support.logic.FunctionSupport;
 
 /**
  * Configuration support for artifact-aware profiles.
@@ -44,8 +43,11 @@ public abstract class AbstractSAML2ArtifactAwareProfileConfiguration
         extends AbstractSAML2ProfileConfiguration
         implements SAMLArtifactAwareProfileConfiguration, SAMLArtifactConsumerProfileConfiguration {
 
+    /** Explicitly set artifact configuration. */
+    @Nullable private SAMLArtifactConfiguration artifactConfiguration; 
+    
     /** Lookup function to supply <code>artifactConfiguration</code> property. */
-    @Nonnull private Function<ProfileRequestContext,SAMLArtifactConfiguration> artifactConfigurationLookupStrategy;
+    @Nullable private Function<ProfileRequestContext,SAMLArtifactConfiguration> artifactConfigurationLookupStrategy;
     
     /** Predicate used to determine if artifact resolution requests should be signed. */
     @Nonnull private Predicate<MessageContext> signArtifactRequestsPredicate;
@@ -60,14 +62,13 @@ public abstract class AbstractSAML2ArtifactAwareProfileConfiguration
      */
     protected AbstractSAML2ArtifactAwareProfileConfiguration(@Nonnull @NotEmpty final String profileId) {
         super(profileId);
-        artifactConfigurationLookupStrategy = FunctionSupport.constant(null);
         signArtifactRequestsPredicate = new NoIntegrityMessageChannelPredicate();
         clientTLSArtifactRequestsPredicate = Predicates.not(new NoIntegrityMessageChannelPredicate());
     }
     
     /** {@inheritDoc} */
-    @Override @Nullable public SAMLArtifactConfiguration getArtifactConfiguration() {
-        return artifactConfigurationLookupStrategy.apply(getProfileRequestContext());
+    @Nullable public SAMLArtifactConfiguration getArtifactConfiguration() {
+        return getIndirectProperty(artifactConfigurationLookupStrategy, artifactConfiguration);
     }
 
     /**
@@ -76,7 +77,7 @@ public abstract class AbstractSAML2ArtifactAwareProfileConfiguration
      * @param config configuration to set
      */
     public void setArtifactConfiguration(@Nullable final SAMLArtifactConfiguration config) {
-        artifactConfigurationLookupStrategy = FunctionSupport.constant(config);
+        artifactConfiguration = config;
     }
 
     /**
@@ -88,8 +89,7 @@ public abstract class AbstractSAML2ArtifactAwareProfileConfiguration
      */
     public void setArtifactConfigurationLookupStrategy(
             @Nullable final Function<ProfileRequestContext,SAMLArtifactConfiguration> strategy) {
-        artifactConfigurationLookupStrategy = strategy != null
-                ? strategy : FunctionSupport.<ProfileRequestContext,SAMLArtifactConfiguration>constant(null);
+        artifactConfigurationLookupStrategy = strategy;
     }
 
     /** {@inheritDoc} */

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list