[java-identity-provider COMMIT] in /trunk/idp-authn-api/src: main/java/net/shibboleth/idp/authn/AuthenticationEvent.j...

noreply at shibboleth.net noreply at shibboleth.net
Wed Jul 17 16:37:49 EDT 2013


Author: scantor
Date: Wed Jul 17 16:37:49 2013
New Revision: 4590

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4590&view=rev
Log:
After reflection, restore inactivity timeout.

Modified:
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationEvent.java
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationWorkflowDescriptor.java
    trunk/idp-authn-api/src/test/java/net/shibboleth/idp/authn/AuthenticationWorkflowDescriptorTest.java

Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationEvent.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationEvent.java?rev=4590&r1=4589&r2=4590&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationEvent.java (original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationEvent.java Wed Jul 17 16:37:49 2013
@@ -55,6 +55,9 @@
     /** The time, in milliseconds since the epoch, that the authentication completed. */
     private final long authenticationInstant;
 
+    /** The last time, in milliseconds since the epoch, this event was used to bypass authentication. */
+    private long lastActivityInstant;
+    
     /**
      * Constructor. <p>Sets the authentication instant to the current time.</p>
      * 
@@ -68,6 +71,7 @@
                 "Authentication method cannot be null nor empty");
         subjects = new ArrayList(Constraint.isNotEmpty(newSubjects, "Subject list cannot be null or empty"));
         authenticationInstant = System.currentTimeMillis();
+        lastActivityInstant = authenticationInstant;
     }
 
     /**
@@ -118,6 +122,31 @@
     public long getAuthenticationInstant() {
         return authenticationInstant;
     }
+    
+    /**
+     * Gets the last activity instant, in milliseconds since the epoch, for this event.
+     * 
+     * @return last activity instant, in milliseconds since the epoch, for this event, never less than 0
+     */
+    public long getLastActivityInstant() {
+        return lastActivityInstant;
+    }
+    
+    /**
+     * Sets the last activity instant, in milliseconds since the epoch, for this event.
+     * 
+     * @param instant last activity instant, in milliseconds since the epoch, for this event, must be greater than 0
+     */
+    public void setLastActivityInstant(final long instant) {
+        lastActivityInstant = Constraint.isGreaterThan(0, instant, "Last activity instant must be greater than 0");
+    }
+
+    /**
+     * Sets the last activity instant, in milliseconds since the epoch, for this event to the current time.
+     */
+    public void setLastActivityInstantToNow() {
+        lastActivityInstant = System.currentTimeMillis();
+    }
 
     /** {@inheritDoc} */
     public int hashCode() {
@@ -146,7 +175,8 @@
     public String toString() {
         return Objects.toStringHelper(this).add("authenticationWorkflowId", authenticationWorkflowId)
                 .add("authenticatedPrincipal", getSubjectName())
-                .add("authenticationInstant", new DateTime(authenticationInstant)).toString();
+                .add("authenticationInstant", new DateTime(authenticationInstant))
+                .add("lastActivityInstant", new DateTime(lastActivityInstant)).toString();
     }
     
     /**

Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationWorkflowDescriptor.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationWorkflowDescriptor.java?rev=4590&r1=4589&r2=4590&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationWorkflowDescriptor.java (original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationWorkflowDescriptor.java Wed Jul 17 16:37:49 2013
@@ -55,6 +55,9 @@
     /** Maximum amount of time in milliseconds, since first usage, a workflow should be considered active. */
     private long lifetime;
     
+    /** Maximum amount of time in milliseconds, since last usage, a workflow should be considered active. */
+    private long timeout;
+    
     /** Supported principals, indexed by type, that the workflow can produce. */
     @Nonnull private Subject supportedPrincipals;
 
@@ -128,7 +131,28 @@
     public void setLifetime(long workflowLifetime) {
         lifetime = Constraint.isGreaterThanOrEqual(0, workflowLifetime, "Lifetime must be greater than or equal to 0");
     }
-
+    
+    /**
+     * Gets the maximum amount of time in milliseconds, since the last usage, a workflow should be considered active.
+     * A value of 0 indicates that there is no inactivity timeout on an active workflow.
+     * 
+     * @return the duration.
+     */
+    public long getInactivityTimeout() {
+        return timeout;
+    }
+
+    /**

[... 49 lines stripped ...]


More information about the commits mailing list