cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r790679 - in /cxf/branches/2.1.x-fixes: ./ rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/ rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/
Date Thu, 02 Jul 2009 17:04:10 GMT
Author: dkulp
Date: Thu Jul  2 17:04:09 2009
New Revision: 790679

URL: http://svn.apache.org/viewvc?rev=790679&view=rev
Log:
Merged revisions 790651,790659 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes

................
  r790651 | dkulp | 2009-07-02 12:26:20 -0400 (Thu, 02 Jul 2009) | 9 lines
  
  Merged revisions 790639 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r790639 | dkulp | 2009-07-02 12:19:19 -0400 (Thu, 02 Jul 2009) | 1 line
    
    [CXF-2298] Add a better search for  RECV_RESULTS
  ........
................
  r790659 | dkulp | 2009-07-02 12:36:25 -0400 (Thu, 02 Jul 2009) | 15 lines
  
  Merged revisions 790643-790644 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r790643 | dkulp | 2009-07-02 12:19:52 -0400 (Thu, 02 Jul 2009) | 2 lines
    
    Fix SignatureConfirmation with the old interceptors which has never
    worked due to looking in the wrong place for RECV_RESULTS and SND_SIGS.
  ........
    r790644 | dkulp | 2009-07-02 12:20:01 -0400 (Thu, 02 Jul 2009) | 2 lines
    
    Fix broken test.   Use JUnit assert* instead of JDK assert so if -ea is
    not specified (like default in eclipse), the failures are consistent.
  ........
................

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JInterceptor.java
    cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
    cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
    cxf/branches/2.1.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jul  2 17:04:09 2009
@@ -1,2 +1,2 @@
-/cxf/branches/2.2.x-fixes:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025,776218,776429,776459,777189,777224,777243,777481,777505,777572,777580,780033,780184,780213,780421,780664,780800,780902,780911,781497,781841,782733,782735-782736,783099,783407,784064,784197,785293,785296,785298-785299,785301,785656,786158,786587,786589,786591-786592,786640,787272,787276,787282-787283,787285,787295,787307,787324,7873
 67,788824-788825,788827-788828,788830,789423,789429,789707,789709-789710,789712,789721,789905,789908,789910,789912,790295,790646-790647,790654-790655
-/cxf/trunk:782181,782728-782730,783097,783396,784059,784181,784895,785279-785282,785468,786142,786271,786395,786582-786583,786638,786647,787269,787277-787279,787290,787305,787323,787366,788060,788187,788703,788774,788820,789371,789420,789527-789529,789704-789705,789896,789898-789900,790294,790637-790638,790640-790642
+/cxf/branches/2.2.x-fixes:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025,776218,776429,776459,777189,777224,777243,777481,777505,777572,777580,780033,780184,780213,780421,780664,780800,780902,780911,781497,781841,782733,782735-782736,783099,783407,784064,784197,785293,785296,785298-785299,785301,785656,786158,786587,786589,786591-786592,786640,787272,787276,787282-787283,787285,787295,787307,787324,7873
 67,788824-788825,788827-788828,788830,789423,789429,789707,789709-789710,789712,789721,789905,789908,789910,789912,790295,790646-790647,790651,790654-790655,790659
+/cxf/trunk:782181,782728-782730,783097,783396,784059,784181,784895,785279-785282,785468,786142,786271,786395,786582-786583,786638,786647,787269,787277-787279,787290,787305,787323,787366,788060,788187,788703,788774,788820,789371,789420,789527-789529,789704-789705,789896,789898-789900,790294,790637-790644

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JInterceptor.java?rev=790679&r1=790678&r2=790679&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JInterceptor.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JInterceptor.java
Thu Jul  2 17:04:09 2009
@@ -32,6 +32,7 @@
 import org.apache.cxf.binding.soap.interceptor.SoapInterceptor;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageUtils;
 import org.apache.cxf.phase.PhaseInterceptor;
 import org.apache.ws.security.WSConstants;
 import org.apache.ws.security.WSSecurityException;
@@ -144,7 +145,23 @@
     public void setBefore(Set<String> before) {
         this.before = before;
     }
-    
+
+
+    protected boolean isRequestor(Message message) {
+        return MessageUtils.isRequestor(message);
+    }
+
+    protected boolean decodeEnableSignatureConfirmation(RequestData reqData) throws WSSecurityException
{
+        String value = getString(WSHandlerConstants.ENABLE_SIGNATURE_CONFIRMATION,
+                reqData.getMsgContext());
+
+        //we need the default to be false to not break older applications and such
+        if (value == null) {
+            return false;
+        }
+        return super.decodeEnableSignatureConfirmation(reqData);
+    }
+
     public Crypto loadSignatureCrypto(RequestData reqData) 
         throws WSSecurityException {
         Crypto crypto = null;

Modified: cxf/branches/2.1.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.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java?rev=790679&r1=790678&r2=790679&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
Thu Jul  2 17:04:09 2009
@@ -108,6 +108,20 @@
         return doc;
     }
     
+    @Override
+    public Object getProperty(Object msgContext, String key) {
+        // use the superclass first
+        Object result = super.getProperty(msgContext, key);
+        
+        // handle the special case of the SEND_SIGV
+        if (result == null 
+            && key == WSHandlerConstants.SEND_SIGV
+            && this.isRequestor((SoapMessage)msgContext)) {
+            result = ((SoapMessage)msgContext).getExchange().getOutMessage().get(key);
+        }               
+        return result;
+    }
+
     public void handleMessage(SoapMessage msg) throws Fault {
         SOAPMessage doc = getSOAPMessage(msg);
         

Modified: cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java?rev=790679&r1=790678&r2=790679&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
Thu Jul  2 17:04:09 2009
@@ -82,6 +82,21 @@
     public void setAllowMTOM(boolean allowMTOM) {
         this.mtomEnabled = allowMTOM;
     }
+    
+
+    @Override
+    public Object getProperty(Object msgContext, String key) {
+        // use the superclass first
+        Object result = super.getProperty(msgContext, key);
+        
+        // handle the special case of the RECV_RESULTS
+        if (result == null 
+            && key == WSHandlerConstants.RECV_RESULTS
+            && !this.isRequestor((SoapMessage)msgContext)) {
+            result = ((SoapMessage)msgContext).getExchange().getInMessage().get(key);
+        }               
+        return result;
+    }
 
     public void handleMessage(SoapMessage mc) throws Fault {
         //must turn off mtom when using WS-Sec so binary is inlined so it can

Modified: cxf/branches/2.1.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java?rev=790679&r1=790678&r2=790679&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java
Thu Jul  2 17:04:09 2009
@@ -77,6 +77,7 @@
         msg.setContent(SOAPMessage.class, saajMsg);
 
         msg.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
+        msg.put(WSHandlerConstants.ENABLE_SIGNATURE_CONFIRMATION, "true");
         msg.put(WSHandlerConstants.SIG_PROP_FILE, "META-INF/cxf/outsecurity.properties");
         msg.put(WSHandlerConstants.USER, "myalias");
         msg.put("password", "myAliasPassword");
@@ -97,9 +98,9 @@
         // Save the signature for future confirmation
         //
         Object sigv = msg.get(WSHandlerConstants.SEND_SIGV);
-        assert sigv != null;
-        assert sigv instanceof List;
-        assert ((List<Object>)sigv).size() != 0;
+        assertNotNull(sigv);
+        assertTrue(sigv instanceof List);
+        assertTrue(((List<Object>)sigv).size() != 0);
         List<Object> sigSaved = (List<Object>)sigv;
         
         XMLStreamReader reader = StaxUtils.createXMLStreamReader(new ByteArrayInputStream(docbytes));
@@ -123,6 +124,7 @@
 
         inHandler.setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
         inHandler.setProperty(WSHandlerConstants.SIG_PROP_FILE, "META-INF/cxf/insecurity.properties");
+        inHandler.setProperty(WSHandlerConstants.ENABLE_SIGNATURE_CONFIRMATION, "true");
 
         inHandler.handleMessage(inmsg);
         
@@ -134,8 +136,8 @@
         assertNotNull(result);
         
         List<Object> sigReceived = (List<Object>)inmsg.get(WSHandlerConstants.RECV_RESULTS);
-        assert sigReceived != null;
-        assert sigReceived.size() != 0;
+        assertNotNull(sigReceived);
+        assertTrue(sigReceived.size() != 0);
         
         testSignatureConfirmationResponse(sigSaved, sigReceived);
     }



Mime
View raw message