[java-identity-provider COMMIT] in /trunk/idp-saml-impl/src: main/java/net/shibboleth/idp/saml/impl/nameid/LegacyName...

noreply at shibboleth.net noreply at shibboleth.net
Wed Feb 19 21:46:20 EST 2014


Author: scantor
Date: Wed Feb 19 21:46:20 2014
New Revision: 5408

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5408&view=rev
Log:
Align to expected location of AttributeContext in tree.

Modified:
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/nameid/LegacyNameIdentifierGenerator.java
    trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/DefaultSAML1NameIdentifierGeneratorTest.java
    trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/DefaultSAML2NameIDGeneratorTest.java
    trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/LegacySAML1NameIdentifierGeneratorTest.java
    trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/LegacySAML2NameIDGeneratorTest.java

Modified: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/nameid/LegacyNameIdentifierGenerator.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/nameid/LegacyNameIdentifierGenerator.java?rev=5408&r1=5407&r2=5408&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/nameid/LegacyNameIdentifierGenerator.java (original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/nameid/LegacyNameIdentifierGenerator.java Wed Feb 19 21:46:20 2014
@@ -24,6 +24,7 @@
 import net.shibboleth.idp.attribute.AttributeEncodingException;
 import net.shibboleth.idp.attribute.IdPAttribute;
 import net.shibboleth.idp.attribute.context.AttributeContext;
+import net.shibboleth.idp.relyingparty.RelyingPartyContext;
 import net.shibboleth.idp.saml.nameid.NameIdentifierAttributeEncoder;
 import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
 import net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent;
@@ -39,6 +40,7 @@
 import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Function;
+import com.google.common.base.Functions;
 import com.google.common.base.Predicate;
 import com.google.common.base.Predicates;
 
@@ -79,8 +81,11 @@
         super.setId(getClass().getName());
         
         activationCondition = Predicates.alwaysTrue();
-        attributeContextLookupStrategy = new ChildContextLookup<>(AttributeContext.class);
         encoderType = Constraint.isNotNull(clazz, "Encoder class type cannot be null");
+
+        // ProfileRequestContext -> RelyingPartyContext -> AttributeContext
+        attributeContextLookupStrategy = Functions.compose(new ChildContextLookup<>(AttributeContext.class),
+                new ChildContextLookup<ProfileRequestContext,RelyingPartyContext>(RelyingPartyContext.class));
     }
 
     /** {@inheritDoc} */

Modified: trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/DefaultSAML1NameIdentifierGeneratorTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/DefaultSAML1NameIdentifierGeneratorTest.java?rev=5408&r1=5407&r2=5408&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/DefaultSAML1NameIdentifierGeneratorTest.java (original)
+++ trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/DefaultSAML1NameIdentifierGeneratorTest.java Wed Feb 19 21:46:20 2014
@@ -112,8 +112,8 @@
 
         final IdPAttribute inputAttribute = new IdPAttribute(ATTR_NAME);
         inputAttribute.setValues(values);
-        prc.getSubcontext(RelyingPartyContext.class, false).getSubcontext(AttributeContext.class, true)
-                .setIdPAttributes(Collections.singleton(inputAttribute));
+        prc.getSubcontext(RelyingPartyContext.class).getSubcontext(AttributeContext.class, true).setIdPAttributes(
+                Collections.singleton(inputAttribute));
 
         generator.setAttributeSourceIds(Collections.singletonList(ATTR_NAME));
         generator.initialize();

Modified: trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/DefaultSAML2NameIDGeneratorTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/DefaultSAML2NameIDGeneratorTest.java?rev=5408&r1=5407&r2=5408&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/DefaultSAML2NameIDGeneratorTest.java (original)
+++ trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/DefaultSAML2NameIDGeneratorTest.java Wed Feb 19 21:46:20 2014
@@ -114,7 +114,8 @@
 
         final IdPAttribute inputAttribute = new IdPAttribute(ATTR_NAME);
         inputAttribute.setValues(values);
-        prc.getSubcontext(AttributeContext.class, true).setIdPAttributes(Collections.singleton(inputAttribute));

[... 162 lines stripped ...]


More information about the commits mailing list