You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2014/02/20 18:24:52 UTC

[1/2] git commit: Workaround to get the exceptional responses ignored by XML security out interceptors

Repository: cxf
Updated Branches:
  refs/heads/master 3085f0fb4 -> 2841fc7c2


Workaround to get the exceptional responses ignored by XML security out interceptors


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

Branch: refs/heads/master
Commit: c4b5bf8b52a7d83a5047c145ca20b37ee608c216
Parents: 2be0649
Author: Sergey Beryozkin <sb...@talend.com>
Authored: Thu Feb 20 17:23:39 2014 +0000
Committer: Sergey Beryozkin <sb...@talend.com>
Committed: Thu Feb 20 17:23:39 2014 +0000

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java    | 1 +
 .../cxf/rs/security/xml/AbstractXmlSecOutInterceptor.java       | 3 +++
 .../org/apache/cxf/rs/security/xml/XmlSecOutInterceptor.java    | 5 +++++
 .../apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java  | 4 ----
 4 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c4b5bf8b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
index e382712..9c140fa 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
@@ -227,6 +227,7 @@ public class JAXRSInInterceptor extends AbstractPhaseInterceptor<Message> {
                 : ExceptionUtils.toInternalServerErrorException(ex, null);
         }
         message.getExchange().put(Response.class, excResponse);
+        message.getExchange().put(Throwable.class, ex);
     }
     
     private void setExchangeProperties(Message message, OperationResourceInfo ori, 

http://git-wip-us.apache.org/repos/asf/cxf/blob/c4b5bf8b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecOutInterceptor.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecOutInterceptor.java
index 884962b..61a30cd 100644
--- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecOutInterceptor.java
+++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecOutInterceptor.java
@@ -56,6 +56,9 @@ public abstract class AbstractXmlSecOutInterceptor extends AbstractPhaseIntercep
     } 
 
     public void handleMessage(Message message) throws Fault {
+        if (message.getExchange().get(Throwable.class) != null) {
+            return;
+        }
         try {
             Document doc = getDomDocument(message);
             if (doc == null) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c4b5bf8b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecOutInterceptor.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecOutInterceptor.java
index f9f7a6a..aa6f381 100644
--- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecOutInterceptor.java
+++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecOutInterceptor.java
@@ -102,6 +102,11 @@ public class XmlSecOutInterceptor implements PhaseInterceptor<Message> {
     }
 
     public void handleMessage(Message message) throws Fault {
+        
+        if (message.getExchange().get(Throwable.class) != null) {
+            return;
+        }
+        
         OutputStream os = message.getContent(OutputStream.class);
         String encoding = getEncoding(message);
         

http://git-wip-us.apache.org/repos/asf/cxf/blob/c4b5bf8b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
index e2e2f25..68c8047 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
@@ -347,10 +347,6 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase {
     
     @Test
     public void testPostEncryptedSignedBookInvalid() throws Exception {
-        if (STAX_PORT.equals(test.port)) {
-            // TODO Problem with error handling on the server side
-            return;
-        }
         String address = "https://localhost:" + test.port + "/xmlsec-validate/bookstore/books";
         Map<String, Object> properties = new HashMap<String, Object>();
         properties.put("ws-security.callback-handler", 


[2/2] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cxf

Posted by se...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cxf


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

Branch: refs/heads/master
Commit: 2841fc7c25de8a38d4189c9f31f2f3cda2261be8
Parents: c4b5bf8 3085f0f
Author: Sergey Beryozkin <sb...@talend.com>
Authored: Thu Feb 20 17:24:20 2014 +0000
Committer: Sergey Beryozkin <sb...@talend.com>
Committed: Thu Feb 20 17:24:20 2014 +0000

----------------------------------------------------------------------
 .../ws/policy/selector/BaseAlternativeSelector.java   | 14 +++++++++-----
 .../org/apache/cxf/ws/security/wss4j/WSS4JUtils.java  | 10 ++++++++--
 .../cxf/systest/ws/algsuite/AlgorithmSuiteTest.java   |  2 ++
 3 files changed, 19 insertions(+), 7 deletions(-)
----------------------------------------------------------------------