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

noreply at shibboleth.net noreply at shibboleth.net
Wed Dec 12 15:28:23 EST 2012


Author: tzeller
Date: Wed Dec 12 15:28:23 2012
New Revision: 4246

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4246&view=rev
Log:
Updated profile action to return event ids rather than throwing exceptions upon error.

Added:
    trunk/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/impl/CheckMessageLifetimeTest.java
      - copied, changed from r4232, trunk/idp-profile-impl/src/test/java/net/shibboleth/idp/profile/impl/CheckMandatoryLifetimeTest.java
Modified:
    trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/CheckMessageLifetime.java

Modified: trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/CheckMessageLifetime.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/CheckMessageLifetime.java?rev=4246&r1=4245&r2=4246&view=diff
==============================================================================
--- trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/CheckMessageLifetime.java (original)
+++ trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/CheckMessageLifetime.java Wed Dec 12 15:28:23 2012
@@ -23,10 +23,15 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import net.shibboleth.ext.spring.webflow.Event;
+import net.shibboleth.ext.spring.webflow.Events;
 import net.shibboleth.idp.profile.AbstractProfileAction;
 import net.shibboleth.idp.profile.ActionSupport;
+import net.shibboleth.idp.profile.EventIds;
 import net.shibboleth.idp.profile.ProfileException;
 import net.shibboleth.idp.profile.ProfileRequestContext;
+import net.shibboleth.idp.profile.config.ProfileConfiguration;
+import net.shibboleth.idp.profile.config.SecurityConfiguration;
 import net.shibboleth.idp.relyingparty.RelyingPartyContext;
 import net.shibboleth.utilities.java.support.component.ComponentSupport;
 import net.shibboleth.utilities.java.support.component.UnmodifiableComponentException;
@@ -36,15 +41,39 @@
 import org.opensaml.messaging.context.BasicMessageMetadataContext;
 import org.opensaml.messaging.context.MessageContext;
 import org.opensaml.messaging.context.navigate.ChildContextLookup;
-import org.springframework.webflow.execution.Event;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Function;
 
-/** An action that checks that the inbound message should be considered valid based upon when it was issued. */
+/** Checks that the inbound message should be considered valid based upon when it was issued. */
+ at Events({
+        @Event(id = EventIds.PROCEED_EVENT_ID),
+        @Event(id = EventIds.INVALID_MSG_CTX,
+                description = "No inbound message context is associated with the current request"),
+        @Event(id = EventIds.INVALID_MSG_MD,
+                description = "No inbound message metadata is associated with the current request"),
+        @Event(id = EventIds.INVALID_RELYING_PARTY_CTX,
+                description = "No relying party context is associated with the current request"),
+        @Event(id = CheckMessageLifetime.NO_ISSUE_INSTANT,
+                description = "No issue instant is associated with the inbound message"),
+        @Event(id = CheckMessageLifetime.PAST_ISSUE_INSTANT,
+                description = "Inbound message was issued too far in the past and is now considered expired"),
+        @Event(id = CheckMessageLifetime.FUTURE_ISSUE_INSTANT,
+                description = "Inbound message was issued too far in the future and is not yet valid")})
 public final class CheckMessageLifetime extends AbstractProfileAction {
 
     /** ID of action returned if no issue instant is associated with the message. */
     public static final String NO_ISSUE_INSTANT = "NoIssueInstant";
+
+    /** ID of action returned if inbound message was issued from a point in time too far in the past. */
+    public static final String PAST_ISSUE_INSTANT = "PastIssueInstant";
+
+    /** ID of action returned if inbound message was issued from a point in time too far in the future. */
+    public static final String FUTURE_ISSUE_INSTANT = "FutureIssueInstant";
+
+    /** Class logger. */
+    private final Logger log = LoggerFactory.getLogger(FilterAttributes.class);
 
     /** Amount of time, in milliseconds, for which a message is valid. Default value: 5 minutes */
     private long messageLifetime;
@@ -154,73 +183,62 @@
     }
 
     /** {@inheritDoc} */
-    protected Event doExecute(HttpServletRequest httpRequest, HttpServletResponse httpResponse,
-            ProfileRequestContext profileRequestContext) throws ProfileException {
+    protected org.springframework.webflow.execution.Event doExecute(HttpServletRequest httpRequest,
+            HttpServletResponse httpResponse, ProfileRequestContext profileRequestContext) throws ProfileException {
+        log.debug("Action {}: Attempting to check message lifetime", getId());
 
         final RelyingPartyContext relyingPartyCtx = rpContextLookupStrategy.apply(profileRequestContext);

[... 182 lines stripped ...]


More information about the commits mailing list