[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
Mon Sep 19 13:31:16 BST 2011


Author: lajoie
Date: Mon Sep 19 13:31:16 2011
New Revision: 4073

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4073&view=rev
Log:
add more profile action implementations

Modified:
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddDoNotCacheConditionToAssertions.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddInResponseToToResponse.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddNotBeforeConditionToAssertions.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddNotOnOrAfterConditionToAssertions.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddResponseShell.java

Modified: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddDoNotCacheConditionToAssertions.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddDoNotCacheConditionToAssertions.java?rev=4073&r1=4072&r2=4073&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddDoNotCacheConditionToAssertions.java (original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddDoNotCacheConditionToAssertions.java Mon Sep 19 13:31:16 2011
@@ -22,13 +22,14 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import net.shibboleth.idp.profile.AbstractIdentityProviderAction;
+import net.shibboleth.idp.profile.AbstractProfileRequestSubcontextAction;
 import net.shibboleth.idp.profile.ActionSupport;
 import net.shibboleth.idp.profile.ProfileException;
 import net.shibboleth.idp.profile.ProfileRequestContext;
+import net.shibboleth.idp.relyingparty.RelyingPartySubcontext;
+import net.shibboleth.idp.saml.profile.saml1.Saml1Support;
 
 import org.opensaml.common.SAMLObjectBuilder;
-import org.opensaml.messaging.context.MessageContext;
 import org.opensaml.saml1.core.Assertion;
 import org.opensaml.saml1.core.Conditions;
 import org.opensaml.saml1.core.DoNotCacheCondition;
@@ -44,61 +45,46 @@
  * {@link ProfileRequestContext#getOutboundMessageContext()}. If no {@link Conditions} is present on the
  * {@link Assertion} one will be created.
  */
-public class AddDoNotCacheConditionToAssertions extends AbstractIdentityProviderAction<Object, Response> {
+public class AddDoNotCacheConditionToAssertions extends
+        AbstractProfileRequestSubcontextAction<Object, Response, RelyingPartySubcontext> {
 
     /** Class logger. */
     private final Logger log = LoggerFactory.getLogger(AddDoNotCacheConditionToAssertions.class);
 
     /** {@inheritDoc} */
+    protected Class<RelyingPartySubcontext> getSubcontextType() {
+        return RelyingPartySubcontext.class;
+    }
+
+    /** {@inheritDoc} */
     protected Event doExecute(final HttpServletRequest httpRequest, final HttpServletResponse httpResponse,
             final RequestContext springRequestContext,
-            final ProfileRequestContext<Object, Response> profileRequestContext) throws ProfileException {
-        log.debug("Action {}: attempting to add DoNotCache condition to every Assertion in outgoing Response", getId());
+            final ProfileRequestContext<Object, Response> profileRequestContext,
+            final RelyingPartySubcontext relyingPartyContext) throws ProfileException {
 
-        final MessageContext<Response> outMsgCtx = profileRequestContext.getOutboundMessageContext();
-        if (outMsgCtx == null) {
-            log.debug("Action {}: no outbound message context available, no DoNotCache condition added", getId());
-            return ActionSupport.buildProceedEvent(this);
-        }
+        log.debug("Action {}: Attempting to add DoNotCache condition to every Assertion in outgoing Response", getId());
 
-        final Response response = outMsgCtx.getMessage();
-        if (response == null) {
-            log.debug("Action {}: no outbound message available, no DoNotCache condition added", getId());
-            return ActionSupport.buildProceedEvent(this);
-        }
+        final List<Assertion> assertions =
+                Saml1Support.getAssertionsFromResponse(this, profileRequestContext, relyingPartyContext);
 
-        final SAMLObjectBuilder<Conditions> conditionsBuilder =
-                (SAMLObjectBuilder<Conditions>) Configuration.getBuilderFactory().getBuilder(Conditions.TYPE_NAME);
         final SAMLObjectBuilder<DoNotCacheCondition> dncConditionBuilder =
                 (SAMLObjectBuilder<DoNotCacheCondition>) Configuration.getBuilderFactory().getBuilder(
                         DoNotCacheCondition.TYPE_NAME);
 
-        final List<Assertion> assertions = response.getAssertions();
-        if (assertions == null || assertions.isEmpty()) {
-            log.debug("Action {}: no assertions present in response, nothing to add DoNotCache conditions to", getId());

[... 293 lines stripped ...]


More information about the commits mailing list