cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1493133 - in /cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security: SecurityConstants.java wss4j/PolicyBasedWSS4JOutInterceptor.java wss4j/WSS4JInInterceptor.java
Date Fri, 14 Jun 2013 15:58:27 GMT
Author: coheigea
Date: Fri Jun 14 15:58:27 2013
New Revision: 1493133

URL: http://svn.apache.org/r1493133
Log:
Merged revisions 1493127 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

........
  r1493127 | coheigea | 2013-06-14 16:46:24 +0100 (Fri, 14 Jun 2013) | 6 lines

  Fixing build

  Conflicts:
  	rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java

........

Modified:
    cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
    cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
    cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java

Modified: cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java?rev=1493133&r1=1493132&r2=1493133&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
Fri Jun 14 15:58:27 2013
@@ -71,6 +71,12 @@ public final class SecurityConstants {
      */
     public static final String ENCRYPT_USERNAME = "ws-security.encryption.username";
     
+    /**
+     * The actor or role name of the wsse:Security header. If this parameter 
+     * is omitted, the actor name is not set.
+     */
+    public static final String ACTOR = "ws-security.actor";
+    
     //
     // Callback class and Crypto properties
     //
@@ -416,7 +422,15 @@ public final class SecurityConstants {
      * c) A CallbackHandler object to use to obtain the token
      */
     public static final String STS_TOKEN_ON_BEHALF_OF = "ws-security.sts.token.on-behalf-of";
-    
+
+    /**
+     * Set this to "false" in order to remove the SOAP mustUnderstand header from security
headers generated based on
+     * a WS-SecurityPolicy.
+     *
+     * The default value is "true" which included the SOAP mustUnderstand header.
+     */
+    public static final String MUST_UNDERSTAND = "ws-security.must-understand";
+
     //
     // Internal tags
     //
@@ -428,7 +442,7 @@ public final class SecurityConstants {
     
     static {
         Set<String> s = new HashSet<String>(Arrays.asList(new String[] {
-            USERNAME, PASSWORD, SIGNATURE_USERNAME, ENCRYPT_USERNAME,
+            USERNAME, PASSWORD, SIGNATURE_USERNAME, ENCRYPT_USERNAME, ACTOR,
             CALLBACK_HANDLER, SAML_CALLBACK_HANDLER, SIGNATURE_PROPERTIES, 
             SIGNATURE_CRYPTO, ENCRYPT_PROPERTIES, ENCRYPT_CRYPTO,
             VALIDATE_TOKEN, ENABLE_REVOCATION, ALWAYS_ENCRYPT_UT, IS_BSP_COMPLIANT, 
@@ -443,7 +457,7 @@ public final class SecurityConstants {
             STS_TOKEN_DO_CANCEL, CACHE_ISSUED_TOKEN_IN_ENDPOINT,
             DISABLE_STS_CLIENT_WSMEX_CALL_USING_EPR_ADDRESS, STS_TOKEN_CRYPTO,
             STS_TOKEN_PROPERTIES, STS_TOKEN_USERNAME, STS_TOKEN_ACT_AS, STS_TOKEN_ON_BEHALF_OF,
-            TOKEN, TOKEN_ID
+            TOKEN, TOKEN_ID, MUST_UNDERSTAND
         }));
         ALL_PROPERTIES = Collections.unmodifiableSet(s);
     }

Modified: cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java?rev=1493133&r1=1493132&r2=1493133&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
Fri Jun 14 15:58:27 2013
@@ -34,6 +34,7 @@ import org.apache.cxf.binding.soap.saaj.
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.MessageUtils;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.phase.PhaseInterceptor;
@@ -95,8 +96,11 @@ public class PolicyBasedWSS4JOutIntercep
             Collection<AssertionInfo> ais;
             SOAPMessage saaj = message.getContent(SOAPMessage.class);
 
-            boolean mustUnderstand = true;
-            String actor = null;
+            boolean mustUnderstand = 
+                MessageUtils.getContextualBoolean(
+                    message, SecurityConstants.MUST_UNDERSTAND, true
+                );
+            String actor = (String)message.getContextualProperty(SecurityConstants.ACTOR);
             
 
             AssertionInfoMap aim = message.get(AssertionInfoMap.class);

Modified: cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java?rev=1493133&r1=1493132&r2=1493133&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
Fri Jun 14 15:58:27 2013
@@ -240,6 +240,9 @@ public class WSS4JInInterceptor extends 
             int doAction = WSSecurityUtil.decodeAction(action, actions);
 
             String actor = (String)getOption(WSHandlerConstants.ACTOR);
+            if (actor == null) {
+                actor = (String)msg.getContextualProperty(SecurityConstants.ACTOR);
+            }
 
             reqData.setCallbackHandler(getCallback(reqData, doAction, utWithCallbacks));
             



Mime
View raw message