[java-identity-provider COMMIT] in /trunk/idp-saml-impl/src: main/java/net/shibboleth/idp/saml/impl/profile/saml1/Add...

noreply at shibboleth.net noreply at shibboleth.net
Wed Mar 5 14:31:47 EST 2014


Author: scantor
Date: Wed Mar  5 14:31:46 2014
New Revision: 5529

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5529&view=rev
Log:
Expanded use of strategies in statement builders.

Modified:
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddAttributeStatementToAssertion.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml2/AddAttributeStatementToAssertion.java
    trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/profile/saml1/AddAttributeStatementToAssertionTest.java
    trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/profile/saml2/AddAttributeStatementToAssertionTest.java

Modified: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddAttributeStatementToAssertion.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddAttributeStatementToAssertion.java?rev=5529&r1=5528&r2=5529&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddAttributeStatementToAssertion.java (original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddAttributeStatementToAssertion.java Wed Mar  5 14:31:46 2014
@@ -39,9 +39,13 @@
 import org.opensaml.profile.context.navigate.OutboundMessageContextLookup;
 
 import net.shibboleth.idp.saml.attribute.encoding.AbstractSAML1AttributeEncoder;
+import net.shibboleth.idp.saml.impl.profile.config.navigate.IdentifierGenerationStrategyLookupFunction;
+import net.shibboleth.idp.saml.impl.profile.config.navigate.ResponderIdLookupFunction;
+import net.shibboleth.utilities.java.support.annotation.constraint.NonnullAfterInit;
 import net.shibboleth.utilities.java.support.annotation.constraint.NullableElements;
 import net.shibboleth.utilities.java.support.component.ComponentSupport;
 import net.shibboleth.utilities.java.support.logic.Constraint;
+import net.shibboleth.utilities.java.support.security.IdentifierGenerationStrategy;
 
 import org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport;
 import org.opensaml.messaging.context.navigate.ChildContextLookup;
@@ -71,8 +75,7 @@
  * 
  * @event {@link EventIds#PROCEED_EVENT_ID}
  * @event {@link EventIds#INVALID_MSG_CTX}
- * @event {@link IdPEventIds#INVALID_RELYING_PARTY_CTX}
- * @event {@link IdPEventIds#INVALID_PROFILE_CONFIG}
+ * @event {@link EventIds#INVALID_PROFILE_CTX}
  * @event {@link IdPEventIds#UNABLE_ENCODE_ATTRIBUTE}
  */
 public class AddAttributeStatementToAssertion extends AbstractProfileAction {
@@ -90,23 +93,27 @@
     private boolean ignoringUnencodableAttributes;
 
     /**
-     * Strategy used to locate the {@link RelyingPartyContext} associated with a given {@link ProfileRequestContext}.
-     */
-    @Nonnull private Function<ProfileRequestContext, RelyingPartyContext> relyingPartyContextLookupStrategy;
-
-    /**
      * Strategy used to locate the {@link AttributeContext} associated with a given {@link ProfileRequestContext}.
      */
     @Nonnull private Function<ProfileRequestContext, AttributeContext> attributeContextLookupStrategy;
+
+    /** Strategy used to locate the {@link IdentifierGenerationStrategy} to use. */
+    @NonnullAfterInit private Function<ProfileRequestContext,IdentifierGenerationStrategy> idGeneratorLookupStrategy;
+
+    /** Strategy used to obtain the assertion issuer value. */
+    @Nullable private Function<ProfileRequestContext,String> issuerLookupStrategy;
     
     /** Strategy used to locate the {@link Response} to operate on. */
     @Nonnull private Function<ProfileRequestContext, Response> responseLookupStrategy;
 
-    /** RelyingPartyContext to use. */
-    @Nullable private RelyingPartyContext relyingPartyCtx;
-
     /** AttributeContext to use. */
     @Nullable private AttributeContext attributeCtx;
+
+    /** The generator to use. */
+    @Nullable private IdentifierGenerationStrategy idGenerator;
+
+    /** EntityID to populate as assertion issuer. */
+    @Nullable private String issuerId;
     
     /** Response to modify. */
     @Nullable private Response response;
@@ -116,11 +123,12 @@
         statementInOwnAssertion = false;
         ignoringUnencodableAttributes = true;
 
-        relyingPartyContextLookupStrategy = new ChildContextLookup<>(RelyingPartyContext.class);
         attributeContextLookupStrategy = Functions.compose(new ChildContextLookup<>(AttributeContext.class),
                 new ChildContextLookup<ProfileRequestContext,RelyingPartyContext>(RelyingPartyContext.class));
         responseLookupStrategy =
                 Functions.compose(new MessageLookup<>(Response.class), new OutboundMessageContextLookup());
+        idGeneratorLookupStrategy = new IdentifierGenerationStrategyLookupFunction();
+        issuerLookupStrategy = new ResponderIdLookupFunction();
     }
 
     /**
@@ -149,21 +157,6 @@
     }
 
     /**

[... 285 lines stripped ...]


More information about the commits mailing list