cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r930245 - in /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security: SecurityConstants.java wss4j/policyhandlers/AbstractBindingBuilder.java
Date Fri, 02 Apr 2010 11:28:22 GMT
Author: dkulp
Date: Fri Apr  2 11:28:21 2010
New Revision: 930245

URL: http://svn.apache.org/viewvc?rev=930245&view=rev
Log:
[CXF-2745] Add ability to set timestamp ttl

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java?rev=930245&r1=930244&r2=930245&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
Fri Apr  2 11:28:21 2010
@@ -46,6 +46,8 @@ public final class SecurityConstants {
 
     public static final String STS_CLIENT = "ws-security.sts.client";
     
+    public static final String TIMESTAMP_TTL = "ws-security.timestamp.timeToLive";
+    
     /**
      * WCF's trust server sometimes will encrypt the token in the response IN ADDITION TO
      * the full security on the message. These properties control the way the STS client

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java?rev=930245&r1=930244&r2=930245&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
Fri Apr  2 11:28:21 2010
@@ -347,6 +347,17 @@ public abstract class AbstractBindingBui
         if (ais != null) {
             for (AssertionInfo ai : ais) {
                 timestampEl = new WSSecTimestamp();
+                Object o = message.getContextualProperty(SecurityConstants.TIMESTAMP_TTL);
+                int ttl = 300;  //default is 300 seconds
+                if (o instanceof Number) {
+                    ttl = ((Number)o).intValue();
+                } else if (o instanceof String) {
+                    ttl = Integer.parseInt((String)o);
+                }
+                if (ttl <= 0) {
+                    ttl = 300;
+                }
+                timestampEl.setTimeToLive(ttl);
                 timestampEl.prepare(saaj.getSOAPPart());
                 ai.setAsserted(true);
             }                    



Mime
View raw message