cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [2/3] cxf git commit: Add a warning for MTOM for the policy case as well
Date Wed, 08 Jul 2015 15:48:33 GMT
Add a warning for MTOM for the policy case as well

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


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

Branch: refs/heads/3.0.x-fixes
Commit: 2905d05f17ae6aafe2b31a542069fcd5b6e6a496
Parents: 8da648c
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Wed Jul 8 16:43:53 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Wed Jul 8 16:44:35 2015 +0100

----------------------------------------------------------------------
 .../wss4j/PolicyBasedWSS4JOutInterceptor.java   | 22 ++++++++++++++++++++
 1 file changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/2905d05f/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
index 98a6330..db37434 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JOutInterceptor.java
@@ -30,7 +30,11 @@ import javax.xml.soap.SOAPException;
 import javax.xml.soap.SOAPMessage;
 
 import org.w3c.dom.Element;
+<<<<<<< HEAD
 
+=======
+import org.apache.cxf.attachment.AttachmentUtil;
+>>>>>>> 419478e... Add a warning for MTOM for the policy case as well
 import org.apache.cxf.binding.soap.SoapFault;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
@@ -129,7 +133,16 @@ public class PolicyBasedWSS4JOutInterceptor extends AbstractPhaseInterceptor<Soa
                 );
             String actor = (String)message.getContextualProperty(SecurityConstants.ACTOR);
             
+<<<<<<< HEAD
             AssertionInfoMap aim = message.get(AssertionInfoMap.class);
+=======
+            if (AttachmentUtil.isMtomEnabled(message) && hasAttachments(message))
{
+                LOG.warning("MTOM is enabled with WS-Security. Please note that if an attachment
is"
+                    + "referenced in the SOAP Body, only the reference will be signed and
not the"
+                    + "SOAP Body!");
+            }
+            
+>>>>>>> 419478e... Add a warning for MTOM for the policy case as well
             // extract Assertion information
             if (aim != null) {
                 AbstractBinding transport = null;
@@ -209,7 +222,16 @@ public class PolicyBasedWSS4JOutInterceptor extends AbstractPhaseInterceptor<Soa
             }
             
         }
+<<<<<<< HEAD
 
+=======
+        
+        private boolean hasAttachments(SoapMessage mc) {
+            final Collection<org.apache.cxf.message.Attachment> attachments = mc.getAttachments();
+            return attachments != null && attachments.size() > 0;
+        }
+        
+>>>>>>> 419478e... Add a warning for MTOM for the policy case as well
         public Set<String> getAfter() {
             return Collections.emptySet();
         }


Mime
View raw message