Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 68554 invoked from network); 6 Mar 2009 17:43:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Mar 2009 17:43:51 -0000 Received: (qmail 4544 invoked by uid 500); 6 Mar 2009 17:43:51 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 4503 invoked by uid 500); 6 Mar 2009 17:43:51 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 4494 invoked by uid 99); 6 Mar 2009 17:43:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Mar 2009 09:43:51 -0800 X-ASF-Spam-Status: No, hits=-1998.5 required=10.0 tests=ALL_TRUSTED,NORMAL_HTTP_TO_IP,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Mar 2009 17:43:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id F04A92388999; Fri, 6 Mar 2009 17:43:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r751000 - in /cxf/sandbox/interopfest/wssec10/src/main: java/interop/client/ java/interop/server/ resources/etc/ Date: Fri, 06 Mar 2009 17:43:17 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090306174317.F04A92388999@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Fri Mar 6 17:43:17 2009 New Revision: 751000 URL: http://svn.apache.org/viewvc?rev=751000&view=rev Log: [CXF-2090] Patch from Eamonn Dwyer applied to get full roundtrips for wssec10 Added: cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/KeystorePasswordCallback.java (with props) cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/MutualCertificate10SignEncrypt.java (with props) Modified: cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/Client.java cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/UTPasswordCallback.java cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/MutualCertificate10SignEncryptRsa15TripleDes.java cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/Server.java cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/UserNameOverTransport.java cxf/sandbox/interopfest/wssec10/src/main/resources/etc/client.xml cxf/sandbox/interopfest/wssec10/src/main/resources/etc/server.xml Modified: cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/Client.java URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/Client.java?rev=751000&r1=750999&r2=751000&view=diff ============================================================================== --- cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/Client.java (original) +++ cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/Client.java Fri Mar 6 17:43:17 2009 @@ -23,6 +23,8 @@ package interop.client; +import java.net.MalformedURLException; +import java.net.URL; import java.util.ArrayList; import java.util.List; @@ -31,8 +33,8 @@ import org.apache.cxf.bus.spring.SpringBusFactory; -import interopbaseaddress.interop.PingService10; import interopbaseaddress.interop.IPingService; +import interopbaseaddress.interop.PingService10; public final class Client { @@ -60,9 +62,17 @@ new SpringBusFactory().createBus("etc/client.xml"); List results = new ArrayList(); + URL wsdlLocation = null; for (String portPrefix : argv) { try { - final PingService10 svc = new PingService10(); + PingService10 svc = null; + boolean isLocal = false; + if (isLocal) { + wsdlLocation = getWsdlLocation(portPrefix); + svc = new PingService10(wsdlLocation); + } else { + svc = new PingService10(); + } final IPingService port = svc.getPort( new QName( @@ -91,11 +101,27 @@ } } catch (Throwable t) { results.add("Exception: " + t); + t.printStackTrace(); } } for (int x = 0; x < argv.length; x++) { System.out.println(argv[x] + ": " + results.get(x)); } } + + private static URL getWsdlLocation(String portPrefix) { + try { + if ("UserNameOverTransport".equals(portPrefix)) { + return new URL("https://localhost:9001/" + portPrefix + "?wsdl"); + } else if ("MutualCertificate10SignEncrypt".equals(portPrefix)) { + return new URL("http://localhost:9002/" + portPrefix + "?wsdl"); + } else if ("MutualCertificate10SignEncryptRsa15TripleDes".equals(portPrefix)) { + return new URL("http://localhost:9000/" + portPrefix + "?wsdl"); + } + } catch (MalformedURLException mue) { + return null; + } + return null; + } } Modified: cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/UTPasswordCallback.java URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/UTPasswordCallback.java?rev=751000&r1=750999&r2=751000&view=diff ============================================================================== --- cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/UTPasswordCallback.java (original) +++ cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/UTPasswordCallback.java Fri Mar 6 17:43:17 2009 @@ -26,6 +26,8 @@ public UTPasswordCallback() { passwords.put("Alice", "ecilA"); passwords.put("Frank", "invalid-password"); + //for MS clients + passwords.put("abcd", "dcba"); } /** Added: cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/KeystorePasswordCallback.java URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/KeystorePasswordCallback.java?rev=751000&view=auto ============================================================================== --- cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/KeystorePasswordCallback.java (added) +++ cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/KeystorePasswordCallback.java Fri Mar 6 17:43:17 2009 @@ -0,0 +1,63 @@ +/** + * Copyright (c) 1993-2006 IONA Technologies PLC. + * All Rights Reserved. + */ +package interop.server; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.CallbackHandler; +import javax.security.auth.callback.UnsupportedCallbackException; + +import org.apache.ws.security.WSPasswordCallback; + +/** + */ + +public class KeystorePasswordCallback implements CallbackHandler { + private Map passwords = + new HashMap(); + + public KeystorePasswordCallback() { + passwords.put("Alice", "abcd!1234"); + passwords.put("alice", "abcd!1234"); + passwords.put("Bob", "abcd!1234"); + passwords.put("bob", "abcd!1234"); + passwords.put("abcd", "dcba"); + passwords.put("6e0e88f36ebb8744d470f62f604d03ea4ebe5094", "password"); + } + + /** + * It attempts to get the password from the private + * alias/passwords map. + */ + public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { + for (int i = 0; i < callbacks.length; i++) { + WSPasswordCallback pc = (WSPasswordCallback)callbacks[i]; + try { + Integer.parseInt(pc.getIdentifier()); + //Its an alias generated for a pfx file, + //this seems to be the way sun seem to load + //.pfc files into keystores, assigning an int value + //as the key aliases, + //The above is an issue when doing encrypt or signing only. + //Perhaps using a more suitable keystore format like .jks would be better + pc.setPassword("password"); + return; + } catch (NumberFormatException nfe) { + //not a pfx alias, carry on to next + } + + String pass = passwords.get(pc.getIdentifier()); + if (pass != null) { + pc.setPassword(pass); + return; + } else { + pc.setPassword("password"); + } + } + } +} Propchange: cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/KeystorePasswordCallback.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/KeystorePasswordCallback.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Added: cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/MutualCertificate10SignEncrypt.java URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/MutualCertificate10SignEncrypt.java?rev=751000&view=auto ============================================================================== --- cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/MutualCertificate10SignEncrypt.java (added) +++ cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/MutualCertificate10SignEncrypt.java Fri Mar 6 17:43:17 2009 @@ -0,0 +1,16 @@ +/** + * Copyright (c) 1993-2007 IONA Technologies PLC. + * All Rights Reserved. + */ +package interop.server; + +@javax.jws.WebService( + targetNamespace = "http://InteropBaseAddress/interop", + serviceName = "PingService10", + portName = "MutualCertificate10SignEncrypt_IPingService", + endpointInterface = "interopbaseaddress.interop.IPingService", + wsdlLocation = "target/wsdl2/WsSecurity10.wsdl" +) +public class MutualCertificate10SignEncrypt extends PingServiceBase { + // complete +} Propchange: cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/MutualCertificate10SignEncrypt.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/MutualCertificate10SignEncrypt.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Modified: cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/MutualCertificate10SignEncryptRsa15TripleDes.java URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/MutualCertificate10SignEncryptRsa15TripleDes.java?rev=751000&r1=750999&r2=751000&view=diff ============================================================================== --- cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/MutualCertificate10SignEncryptRsa15TripleDes.java (original) +++ cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/MutualCertificate10SignEncryptRsa15TripleDes.java Fri Mar 6 17:43:17 2009 @@ -8,7 +8,8 @@ targetNamespace = "http://InteropBaseAddress/interop", serviceName = "PingService10", portName = "MutualCertificate10SignEncryptRsa15TripleDes_IPingService", - endpointInterface = "interopbaseaddress.interop.IPingService" + endpointInterface = "interopbaseaddress.interop.IPingService", + wsdlLocation = "target/wsdl2/WsSecurity10.wsdl" ) public class MutualCertificate10SignEncryptRsa15TripleDes extends PingServiceBase { // complete Modified: cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/Server.java URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/Server.java?rev=751000&r1=750999&r2=751000&view=diff ============================================================================== --- cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/Server.java (original) +++ cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/Server.java Fri Mar 6 17:43:17 2009 @@ -30,22 +30,7 @@ public class Server { protected Server() throws Exception { - new SpringBusFactory().createBus("server.xml"); - - // - // Scenario 3.1 - // - Endpoint.publish( - "https://localhost:9001/UserNameOverTransport", - new UserNameOverTransport() - ); - // - // Scenario 3.4 - // - Endpoint.publish( - "http://localhost:9000/MutualCertificate10SignEncryptRsa15TripleDes", - new MutualCertificate10SignEncryptRsa15TripleDes() - ); + new SpringBusFactory().createBus("etc/server.xml"); } public static void main(String args[]) throws Exception { @@ -57,3 +42,4 @@ System.exit(0); } } + Modified: cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/UserNameOverTransport.java URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/UserNameOverTransport.java?rev=751000&r1=750999&r2=751000&view=diff ============================================================================== --- cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/UserNameOverTransport.java (original) +++ cxf/sandbox/interopfest/wssec10/src/main/java/interop/server/UserNameOverTransport.java Fri Mar 6 17:43:17 2009 @@ -8,8 +8,10 @@ targetNamespace = "http://InteropBaseAddress/interop", serviceName = "PingService10", portName = "UserNameOverTransportLocal_IPingService", - endpointInterface = "interopbaseaddress.interop.IPingService" + endpointInterface = "interopbaseaddress.interop.IPingService", + wsdlLocation = "target/wsdl2/WsSecurity10.wsdl" ) public class UserNameOverTransport extends PingServiceBase { // complete } + \ No newline at end of file Modified: cxf/sandbox/interopfest/wssec10/src/main/resources/etc/client.xml URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssec10/src/main/resources/etc/client.xml?rev=751000&r1=750999&r2=751000&view=diff ============================================================================== --- cxf/sandbox/interopfest/wssec10/src/main/resources/etc/client.xml (original) +++ cxf/sandbox/interopfest/wssec10/src/main/resources/etc/client.xml Fri Mar 6 17:43:17 2009 @@ -24,6 +24,8 @@ + + @@ -33,14 +35,7 @@ - - - - - - - - + @@ -49,20 +44,7 @@ - - - - - - - - - - - - - - + @@ -75,15 +57,7 @@ - - - - - - - - - + @@ -96,14 +70,5 @@ - - - - - - - - - Modified: cxf/sandbox/interopfest/wssec10/src/main/resources/etc/server.xml URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssec10/src/main/resources/etc/server.xml?rev=751000&r1=750999&r2=751000&view=diff ============================================================================== --- cxf/sandbox/interopfest/wssec10/src/main/resources/etc/server.xml (original) +++ cxf/sandbox/interopfest/wssec10/src/main/resources/etc/server.xml Fri Mar 6 17:43:17 2009 @@ -10,28 +10,41 @@ xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration" xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:security="http://schemas.iona.com/soa/security-config" + xmlns:interop="http://InteropBaseAddress/interop" + xmlns:cxf="http://cxf.apache.org/core" + xmlns:p="http://cxf.apache.org/policy" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd + http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd + http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd http://schemas.iona.com/soa/security-config http://schemas.iona.com/soa/security-config.xsd "> + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + +