cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject git commit: Minor WSS4J optimisations when sending no security header
Date Mon, 14 Apr 2014 23:03:33 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 76fc9eb40 -> b4c680ae6


Minor WSS4J optimisations when sending no security header


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b4c680ae
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b4c680ae
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b4c680ae

Branch: refs/heads/master
Commit: b4c680ae6c445df7d6c2364d3a2db14305c0954c
Parents: 76fc9eb
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Apr 15 00:02:51 2014 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Apr 15 00:03:07 2014 +0100

----------------------------------------------------------------------
 .../ws/security/wss4j/WSS4JOutInterceptor.java    |  8 ++++----
 .../security/wss4j/WSS4JStaxOutInterceptor.java   | 18 ++++++++----------
 2 files changed, 12 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/b4c680ae/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
index 66434c3..7ac08ab 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
@@ -158,10 +158,6 @@ public class WSS4JOutInterceptor extends AbstractWSS4JInterceptor {
             }
             SoapVersion version = mc.getVersion();
             RequestData reqData = new RequestData();
-            translateProperties(mc);
-    
-            reqData.setMsgContext(mc);
-            reqData.setAttachmentCallbackHandler(new AttachmentCallbackHandler(mc));
             
             /*
              * The overall try, just to have a finally at the end to perform some
@@ -195,6 +191,10 @@ public class WSS4JOutInterceptor extends AbstractWSS4JInterceptor {
                 if (actions.isEmpty()) {
                     return;
                 }
+
+                translateProperties(mc);
+                reqData.setMsgContext(mc);
+                reqData.setAttachmentCallbackHandler(new AttachmentCallbackHandler(mc));
                 
                 handleSecureMTOM(mc, actions);
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/b4c680ae/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxOutInterceptor.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxOutInterceptor.java
index f7d90cf..2e42641 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxOutInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxOutInterceptor.java
@@ -38,7 +38,6 @@ import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
-import org.apache.cxf.ws.policy.AssertionInfoMap;
 import org.apache.cxf.ws.security.SecurityConstants;
 import org.apache.wss4j.common.ConfigurationConstants;
 import org.apache.wss4j.common.WSSPolicyException;
@@ -130,22 +129,17 @@ public class WSS4JStaxOutInterceptor extends AbstractWSS4JStaxInterceptor
{
 
         XMLStreamWriter newXMLStreamWriter;
         try {
-            @SuppressWarnings("unchecked")
-            final List<SecurityEvent> requestSecurityEvents = 
-                (List<SecurityEvent>) mc.getExchange().get(SecurityEvent.class.getName()
+ ".in");
-            
             WSSSecurityProperties secProps = createSecurityProperties();
             translateProperties(mc, secProps);
+            configureCallbackHandler(mc, secProps);
             Map<String, SecurityTokenProvider<OutboundSecurityToken>> outboundTokens
= 
                 new HashMap<String, SecurityTokenProvider<OutboundSecurityToken>>();
-            configureCallbackHandler(mc, secProps);
             configureProperties(mc, outboundTokens, secProps);
-            
-            if ((secProps.getActions() == null || secProps.getActions().size() == 0)
-                && mc.get(AssertionInfoMap.class) != null) {
-                // If no actions configured (with SecurityPolicy) then return
+            if (secProps.getActions() == null || secProps.getActions().size() == 0) {
+                // If no actions configured then return
                 return;
             }
+
             handleSecureMTOM(mc, secProps);
             
             if (secProps.getAttachmentCallbackHandler() == null) {
@@ -157,6 +151,10 @@ public class WSS4JStaxOutInterceptor extends AbstractWSS4JStaxInterceptor
{
             
             OutboundWSSec outboundWSSec = WSSec.getOutboundWSSec(secProps);
             
+            @SuppressWarnings("unchecked")
+            final List<SecurityEvent> requestSecurityEvents = 
+                (List<SecurityEvent>) mc.getExchange().get(SecurityEvent.class.getName()
+ ".in");
+            
             final OutboundSecurityContextImpl outboundSecurityContext = new OutboundSecurityContextImpl();
             outboundSecurityContext.putList(SecurityEvent.class, requestSecurityEvents);
             outboundSecurityContext.addSecurityEventListener(securityEventListener);


Mime
View raw message