[java-identity-provider] branch master updated: Add wiring for AffiliationDescriptor support in relying-party groups.

Scott Cantor cantor.2 at osu.edu
Thu Aug 3 11:07:39 EDT 2017


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=1343b522b1a21383fa33d98026a96a5601412927

The following commit(s) were added to refs/heads/master by this push:
       new  1343b52   Add wiring for AffiliationDescriptor support in relying-party groups.
1343b52 is described below

commit 1343b522b1a21383fa33d98026a96a5601412927
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Aug 3 11:07:28 2017 -0400

    Add wiring for AffiliationDescriptor support in relying-party groups.
---
 .../src/main/resources/system/conf/relying-party-mddriven.xml |  3 ++-
 .../src/main/resources/system/conf/relying-party-system.xml   |  3 ++-
 .../src/test/resources/metadata/example-sp123-metadata.xml    |  9 +++++++++
 .../relyingparty/impl/RelyingPartyConfigurationSupport.java   | 11 ++++++++---
 4 files changed, 21 insertions(+), 5 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 a428ed1..8e2a0a6 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
@@ -43,7 +43,8 @@
         class="net.shibboleth.idp.saml.relyingparty.impl.RelyingPartyConfigurationSupport" factory-method="byName" />
 
     <bean id="RelyingPartyByGroup.MDDriven" parent="RelyingParty.MDDriven" abstract="true"
-        class="net.shibboleth.idp.saml.relyingparty.impl.RelyingPartyConfigurationSupport" factory-method="byGroup" />
+        class="net.shibboleth.idp.saml.relyingparty.impl.RelyingPartyConfigurationSupport" factory-method="byGroup"
+        c:resolver-ref="shibboleth.MetadataResolver" />
 
     <bean id="RelyingPartyByTag.MDDriven" parent="RelyingParty.MDDriven" abstract="true"
         class="net.shibboleth.idp.saml.relyingparty.impl.RelyingPartyConfigurationSupport" factory-method="byTag"
diff --git a/idp-conf/src/main/resources/system/conf/relying-party-system.xml b/idp-conf/src/main/resources/system/conf/relying-party-system.xml
index d8addd5..6a7a759 100644
--- a/idp-conf/src/main/resources/system/conf/relying-party-system.xml
+++ b/idp-conf/src/main/resources/system/conf/relying-party-system.xml
@@ -36,7 +36,8 @@
 
     <!-- Parent bean for RelyingParty overrides based on activation by group. -->
     <bean id="RelyingPartyByGroup" abstract="true" parent="RelyingParty"
-        class="net.shibboleth.idp.saml.relyingparty.impl.RelyingPartyConfigurationSupport" factory-method="byGroup" />
+        class="net.shibboleth.idp.saml.relyingparty.impl.RelyingPartyConfigurationSupport" factory-method="byGroup"
+        c:resolver-ref="shibboleth.MetadataResolver" />
 
     <!-- Parent bean for RelyingParty overrides based on activation by tag. -->
     <bean id="RelyingPartyByTag" abstract="true" parent="RelyingParty"
diff --git a/idp-conf/src/test/resources/metadata/example-sp123-metadata.xml b/idp-conf/src/test/resources/metadata/example-sp123-metadata.xml
index 3c3fa97..d0f6b64 100644
--- a/idp-conf/src/test/resources/metadata/example-sp123-metadata.xml
+++ b/idp-conf/src/test/resources/metadata/example-sp123-metadata.xml
@@ -6,6 +6,15 @@ Example metadata for mock SPs with entityIDs of form 'https://sp[123].example.or
                     xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui"
                     xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
                     xmlns:mdattr="urn:oasis:names:tc:SAML:metadata:attribute">
+                    
+<EntityDescriptor entityID="https://affiliation.example.org">
+    <AffiliationDescriptor affiliationOwnerID="https://affiliation.example.org">
+        <AffiliateMember>https://sp1.example.org</AffiliateMember>
+        <AffiliateMember>https://sp2.example.org</AffiliateMember>
+        <AffiliateMember>https://sp3.example.org</AffiliateMember>
+    </AffiliationDescriptor>
+</EntityDescriptor>
+
 <EntityDescriptor entityID="https://sp1.example.org">
     <Extensions>
 	    <mdattr:EntityAttributes xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/relyingparty/impl/RelyingPartyConfigurationSupport.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/relyingparty/impl/RelyingPartyConfigurationSupport.java
index 5c2af51..f8622a2 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/relyingparty/impl/RelyingPartyConfigurationSupport.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/relyingparty/impl/RelyingPartyConfigurationSupport.java
@@ -20,12 +20,14 @@ package net.shibboleth.idp.saml.relyingparty.impl;
 import java.util.Collection;
 
 import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.opensaml.saml.common.messaging.context.navigate.EntityDescriptorLookupFunction;
 import org.opensaml.saml.common.profile.logic.EntityAttributesPredicate;
 import org.opensaml.saml.common.profile.logic.EntityAttributesPredicate.Candidate;
 import org.opensaml.saml.common.profile.logic.EntityGroupNamePredicate;
+import org.opensaml.saml.metadata.resolver.MetadataResolver;
 import org.opensaml.saml.saml2.metadata.EntityDescriptor;
 
 import com.google.common.base.Functions;
@@ -77,14 +79,17 @@ public final class RelyingPartyConfigurationSupport {
 
     /**
      * A shorthand method for constructing a {@link RelyingPartyConfiguration} with an activation condition based on
-     * one or more {@link org.opensaml.saml.saml2.metadata.EntitiesDescriptor} groups.
+     * one or more {@link org.opensaml.saml.saml2.metadata.EntitiesDescriptor} groups, and optionally via
+     * {@link org.opensaml.saml.saml2.metadata.AffiliationDescriptor} lookup.
      * 
      * @param groupNames the group names
+     * @param resolver optional metadata source for affiliation lookup
      * 
      * @return  a default-constructed configuration with the appropriate condition set
      */
     @Nonnull public static RelyingPartyConfiguration byGroup(
-            @Nonnull @NonnullElements final Collection<String> groupNames) {
+            @Nonnull @NonnullElements final Collection<String> groupNames,
+            @Nullable final MetadataResolver resolver) {
         Constraint.isNotNull(groupNames, "Group name list cannot be null");
         
         // We adapt an OpenSAML Predicate applying to an EntityDescriptor by indirecting the lookup of the
@@ -93,7 +98,7 @@ public final class RelyingPartyConfigurationSupport {
         final StrategyIndirectedPredicate<ProfileRequestContext,EntityDescriptor> indirectPredicate =
                 new StrategyIndirectedPredicate<>(
                         Functions.compose(new EntityDescriptorLookupFunction(),new SAMLMetadataContextLookupFunction()),
-                        new EntityGroupNamePredicate(groupNames));
+                        new EntityGroupNamePredicate(groupNames, resolver));
         
         final RelyingPartyConfiguration config = new RelyingPartyConfiguration();
         config.setActivationCondition(indirectPredicate);

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


More information about the commits mailing list