cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1485722 - /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxInInterceptor.java
Date Thu, 23 May 2013 14:17:01 GMT
Author: coheigea
Date: Thu May 23 14:17:01 2013
New Revision: 1485722

URL: http://svn.apache.org/r1485722
Log:
Set the SOAP Action correctly on the inbound streaming policy enforcer

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxInInterceptor.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxInInterceptor.java?rev=1485722&r1=1485721&r2=1485722&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxInInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxInInterceptor.java
Thu May 23 14:17:01 2013
@@ -37,6 +37,7 @@ import javax.xml.namespace.QName;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor;
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
 import org.apache.cxf.binding.soap.model.SoapOperationInfo;
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
@@ -445,15 +446,21 @@ public class PolicyBasedWSS4JStaxInInter
             operationPolicies.add(operationPolicy);
         }
         
+        String soapAction = SoapActionInInterceptor.getSoapAction(msg);
+        if (soapAction == null) {
+            soapAction = "";
+        }
+        
         final List<SecurityEvent> incomingSecurityEventList = new LinkedList<SecurityEvent>();
-        // TODO Soap Action
-        PolicyEnforcer securityEventListener = new PolicyEnforcer(operationPolicies, "",
isRequestor(msg)) {
-            @Override
-            public void registerSecurityEvent(SecurityEvent securityEvent) throws WSSecurityException
{
-                incomingSecurityEventList.add(securityEvent);
-                super.registerSecurityEvent(securityEvent);
-            }
-        };
+        PolicyEnforcer securityEventListener = 
+            new PolicyEnforcer(operationPolicies, soapAction, isRequestor(msg)) {
+            
+                @Override
+                public void registerSecurityEvent(SecurityEvent securityEvent) throws WSSecurityException
{
+                    incomingSecurityEventList.add(securityEvent);
+                    super.registerSecurityEvent(securityEvent);
+                }
+            };
         
         msg.getExchange().put(SecurityEvent.class.getName() + ".in", incomingSecurityEventList);
         msg.put(SecurityEvent.class.getName() + ".in", incomingSecurityEventList);



Mime
View raw message