cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r530841 - in /incubator/cxf/trunk/rt/ws/security/src: main/java/org/apache/cxf/ws/security/ main/java/org/apache/cxf/ws/security/wss4j/ test/java/org/apache/cxf/ws/security/wss4j/
Date Fri, 20 Apr 2007 16:09:45 GMT
Author: dandiep
Date: Fri Apr 20 09:09:44 2007
New Revision: 530841

URL: http://svn.apache.org/viewvc?view=rev&rev=530841
Log:
Apply CXF-566: fix WS-Security test typos from Colm

Removed:
    incubator/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/AbstractWSSecurityFeature.java
    incubator/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/KeyStoreFactoryBean.java
    incubator/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityInfo.java
    incubator/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JSecurityFeature.java
Modified:
    incubator/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/RoundTripTest.java
    incubator/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
    incubator/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptorTest.java

Modified: incubator/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/RoundTripTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/RoundTripTest.java?view=diff&rev=530841&r1=530840&r2=530841
==============================================================================
--- incubator/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/RoundTripTest.java
(original)
+++ incubator/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/RoundTripTest.java
Fri Apr 20 09:09:44 2007
@@ -27,7 +27,6 @@
 import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.transport.local.LocalTransportFactory;
-import org.apache.ws.security.WSConstants;
 import org.apache.ws.security.handler.WSHandlerConstants;
 import org.junit.Before;
 import org.junit.Test;
@@ -62,7 +61,6 @@
         wsOut.setProperty(WSHandlerConstants.ENC_PROP_FILE, "META-INF/cxf/outsecurity.properties");
         wsOut.setProperty(WSHandlerConstants.USER, "myalias");
         wsOut.setProperty("password", "myAliasPassword");
-        wsOut.setProperty(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PASSWORD_TEXT);
         wsOut.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS, TestPwdCallback.class.getName());
         service.getOutInterceptors().add(wsOut);
 

Modified: incubator/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java?view=diff&rev=530841&r1=530840&r2=530841
==============================================================================
--- incubator/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
(original)
+++ incubator/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
Fri Apr 20 09:09:44 2007
@@ -39,7 +39,6 @@
 import org.apache.cxf.message.ExchangeImpl;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.staxutils.StaxUtils;
-import org.apache.ws.security.WSConstants;
 import org.apache.ws.security.WSSecurityEngineResult;
 import org.apache.ws.security.handler.WSHandlerConstants;
 import org.junit.Test;
@@ -73,7 +72,6 @@
         msg.put(WSHandlerConstants.SIG_PROP_FILE, "META-INF/cxf/outsecurity.properties");
         msg.put(WSHandlerConstants.USER, "myalias");
         msg.put("password", "myAliasPassword");
-        msg.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PASSWORD_TEXT);
 
         handler.handleMessage(msg);
 
@@ -136,7 +134,6 @@
         msg.put(WSHandlerConstants.USER, "myalias");
         msg.put(WSHandlerConstants.SIG_KEY_ID, "DirectReference");
         msg.put("password", "myAliasPassword");
-        msg.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PASSWORD_TEXT);
 
         handler.handleMessage(msg);
 

Modified: incubator/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptorTest.java?view=diff&rev=530841&r1=530840&r2=530841
==============================================================================
--- incubator/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptorTest.java
(original)
+++ incubator/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptorTest.java
Fri Apr 20 09:09:44 2007
@@ -33,8 +33,36 @@
  * @author <a href="mailto:tsztelak@gmail.com">Tomasz Sztelak</a>
  */
 public class WSS4JOutInterceptorTest extends AbstractSecurityTest {
+    
+    @Test
+    public void testUsernameTokenText() throws Exception {
+        SOAPMessage saaj = readSAAJDocument("wsse-request-clean.xml");
+
+        WSS4JOutInterceptor handler = new WSS4JOutInterceptor();
+
+        SoapMessage msg = new SoapMessage(new MessageImpl());
+        Exchange ex = new ExchangeImpl();
+        ex.setInMessage(msg);
+
+        msg.setContent(SOAPMessage.class, saaj);
+
+        msg.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
+        msg.put(WSHandlerConstants.SIG_PROP_FILE, "META-INF/cxf/outsecurity.properties");
+        msg.put(WSHandlerConstants.USER, "username");
+        msg.put("password", "myAliasPassword");
+        msg.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
+        handler.handleMessage(msg);
+
+        SOAPPart doc = saaj.getSOAPPart();
+        assertValid("//wsse:Security", doc);
+        assertValid("//wsse:Security/wsse:UsernameToken", doc);
+        assertValid("//wsse:Security/wsse:UsernameToken/wsse:Username[text()='username']",
doc);
+        // Test to see that the plaintext password is used in the header
+        assertValid("//wsse:Security/wsse:UsernameToken/wsse:Password[text()='myAliasPassword']",
doc);
+    }
+    
     @Test
-    public void testUsernameToken() throws Exception {
+    public void testUsernameTokenDigest() throws Exception {
         SOAPMessage saaj = readSAAJDocument("wsse-request-clean.xml");
 
         WSS4JOutInterceptor handler = new WSS4JOutInterceptor();
@@ -49,12 +77,15 @@
         msg.put(WSHandlerConstants.SIG_PROP_FILE, "META-INF/cxf/outsecurity.properties");
         msg.put(WSHandlerConstants.USER, "username");
         msg.put("password", "myAliasPassword");
+        msg.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_DIGEST);
         handler.handleMessage(msg);
 
         SOAPPart doc = saaj.getSOAPPart();
         assertValid("//wsse:Security", doc);
         assertValid("//wsse:Security/wsse:UsernameToken", doc);
         assertValid("//wsse:Security/wsse:UsernameToken/wsse:Username[text()='username']",
doc);
+        // Test to see that the password digest is used in the header
+        assertInvalid("//wsse:Security/wsse:UsernameToken/wsse:Password[text()='myAliasPassword']",
doc);
     }
 
     @Test
@@ -74,7 +105,6 @@
         msg.put(WSHandlerConstants.ENC_PROP_FILE, "META-INF/cxf/outsecurity.properties");
         msg.put(WSHandlerConstants.USER, "myalias");
         msg.put("password", "myAliasPassword");
-        msg.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PASSWORD_TEXT);
 
         handler.handleMessage(msg);
 
@@ -99,7 +129,6 @@
         msg.put(WSHandlerConstants.SIG_PROP_FILE, "META-INF/cxf/outsecurity.properties");
         msg.put(WSHandlerConstants.USER, "myAlias");
         msg.put("password", "myAliasPassword");
-        msg.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PASSWORD_TEXT);
 
         handler.handleMessage(msg);
 
@@ -124,7 +153,6 @@
         handler.setProperty(WSHandlerConstants.SIG_PROP_FILE, "META-INF/cxf/outsecurity.properties");
         msg.put(WSHandlerConstants.USER, "myalias");
         msg.put("password", "myAliasPassword");
-        handler.setProperty(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PASSWORD_TEXT);
 
         handler.handleMessage(msg);
 



Mime
View raw message