cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1558436 - in /cxf/trunk/distribution/src/main/release/samples/ws_security: sign_enc/ sign_enc/src/main/java/demo/wssec/client/ sign_enc/src/main/java/demo/wssec/server/ sign_enc/src/main/resources/etc/ stax_sign_enc/ stax_sign_enc/src/main...
Date Wed, 15 Jan 2014 15:44:47 GMT
Author: coheigea
Date: Wed Jan 15 15:44:46 2014
New Revision: 1558436

URL: http://svn.apache.org/r1558436
Log:
Consolidating WS-Security DOM + StAX functionality into a single demo

Added:
    cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/client/StaxClient.java
      - copied, changed from r1558415, cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/java/demo/wssec/client/Client.java
    cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/server/StaxServer.java
      - copied, changed from r1558415, cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/java/demo/wssec/server/Server.java
Removed:
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/README.txt
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/logging.properties
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/pom.xml
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/java/demo/wssec/client/Client.java
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/java/demo/wssec/client/UTPasswordCallback.java
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/java/demo/wssec/client/wssec.xml
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/java/demo/wssec/common/ConciseFormatter.java
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/java/demo/wssec/server/GreeterImpl.java
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/java/demo/wssec/server/Server.java
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/java/demo/wssec/server/UTPasswordCallback.java
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/java/demo/wssec/server/wssec.xml
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/resources/etc/Client_Encrypt.properties
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/resources/etc/Client_Sign.properties
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/resources/etc/Server_Decrypt.properties
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/resources/etc/Server_SignVerf.properties
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/resources/keystore/client-keystore.jks
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/resources/keystore/client-truststore.jks
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/resources/keystore/server-keystore.jks
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/resources/keystore/server-truststore.jks
    cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/wsdl/hello_world_wssec.wsdl
Modified:
    cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/README.txt
    cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/pom.xml
    cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/client/Client.java
    cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/server/Server.java
    cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Client_Encrypt.properties
    cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Client_Sign.properties
    cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Server_Decrypt.properties
    cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Server_SignVerf.properties

Modified: cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/README.txt
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/README.txt?rev=1558436&r1=1558435&r2=1558436&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/README.txt (original)
+++ cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/README.txt Wed Jan
15 15:44:46 2014
@@ -9,11 +9,14 @@ incoming interceptors. Various Actions l
 Signature, Encryption, etc., can be applied to the interceptors by passing
 appropriate configuration properties.
 
-This demo also shows how the DefaultCryptoCoverageChecker can be used to
-make sure that the correct Elements were signed and/or encrypted.
+CXF 3.0.0 supports both a DOM-based (in-memory) and StAX-based (streaming)
+approach to WS-Security. This demo shows how to use both approaches.
 
-The logging feature is used to log the inbound and outbound
-SOAP messages and display these to the console.
+This demo also shows how a CryptoCoverageChecker can be used to make sure that
+the correct Elements were signed and/or encrypted.
+
+The logging feature is used to log the inbound and outbound SOAP messages and
+display these to the console.
 
 In all other respects this demo is based on the basic hello_world sample.
 
@@ -48,20 +51,27 @@ Building and running the demo using Mave
 From the base directory of this sample (i.e., where this README file is
 located), the maven pom.xml file can be used to build and run the demo.
 
-
 Using either UNIX or Windows:
 
   mvn install (builds the demo)
+
+To use the DOM-based WS-Security functionality:
+
   mvn -Pserver  (from one command line window)
   mvn -Pclient  (from a second command line window)
 
+To use the StAX-based WS-Security functionality:
+
+  mvn -Pstax-server  (from one command line window)
+  mvn -Pstax-client  (from a second command line window)
+
+You can also run the DOM client against the StAX server, and vice versa.
+
 On startup, the client makes a sequence of 4 two-way invocations.
 
 To remove the code generated from the WSDL file and the .class
 files, run "mvn clean".
 
-
-
 Building the demo using wsdl2java and javac
 -------------------------------------------
 

Modified: cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/pom.xml?rev=1558436&r1=1558435&r2=1558436&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/pom.xml (original)
+++ cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/pom.xml Wed Jan 15
15:44:46 2014
@@ -100,6 +100,29 @@
             </build>
         </profile>
         <profile>
+            <id>stax-server</id>
+            <build>
+                <defaultGoal>test</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>test</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>demo.wssec.server.StaxServer</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
             <id>client</id>
             <build>
                 <defaultGoal>test</defaultGoal>
@@ -122,6 +145,29 @@
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <id>stax-client</id>
+            <build>
+                <defaultGoal>test</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <phase>test</phase>
+                                <goals>
+                                    <goal>java</goal>
+                                </goals>
+                                <configuration>
+                                    <mainClass>demo.wssec.client.StaxClient</mainClass>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
     <dependencies>
         <dependency>

Modified: cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/client/Client.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/client/Client.java?rev=1558436&r1=1558435&r2=1558436&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/client/Client.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/client/Client.java
Wed Jan 15 15:44:46 2014
@@ -35,7 +35,9 @@ import org.apache.cxf.ws.security.wss4j.
 import org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor;
 import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
 
-
+/**
+ * A DOM-based client
+ */
 public final class Client {
 
     private static final String WSSE_NS 

Copied: cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/client/StaxClient.java
(from r1558415, cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/java/demo/wssec/client/Client.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/client/StaxClient.java?p2=cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/client/StaxClient.java&p1=cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/java/demo/wssec/client/Client.java&r1=1558415&r2=1558436&rev=1558436&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/java/demo/wssec/client/Client.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/client/StaxClient.java
Wed Jan 15 15:44:46 2014
@@ -41,27 +41,28 @@ import org.apache.wss4j.stax.securityTok
 import org.apache.xml.security.stax.ext.SecurePart;
 import org.apache.xml.security.stax.ext.XMLSecurityConstants;
 
-import demo.wssec.server.Server;
 import demo.wssec.server.UTPasswordCallback;
 
+/**
+ * A StAX-based client
+ */
+public final class StaxClient {
 
-public final class Client {
-
-    private Client() {
+    private StaxClient() {
     }
 
     public static void main(String args[]) throws Exception {
         try {
 
             SpringBusFactory bf = new SpringBusFactory();
-            URL busFile = Client.class.getResource("wssec.xml");
+            URL busFile = StaxClient.class.getResource("wssec.xml");
             Bus bus = bf.createBus(busFile.toString());
             BusFactory.setDefaultBus(bus);
 
             Properties encCryptoProperties = 
-                CryptoFactory.getProperties("etc/Client_Encrypt.properties", Server.class.getClassLoader());
+                CryptoFactory.getProperties("etc/Client_Encrypt.properties", StaxClient.class.getClassLoader());
             Properties sigCryptoProperties = 
-                CryptoFactory.getProperties("etc/Client_Sign.properties", Server.class.getClassLoader());
+                CryptoFactory.getProperties("etc/Client_Sign.properties", StaxClient.class.getClassLoader());
             
             WSSSecurityProperties properties = new WSSSecurityProperties();
             properties.addAction(WSSConstants.USERNAMETOKEN);

Modified: cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/server/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/server/Server.java?rev=1558436&r1=1558435&r2=1558436&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/server/Server.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/server/Server.java
Wed Jan 15 15:44:46 2014
@@ -33,6 +33,9 @@ import org.apache.cxf.ws.security.wss4j.
 import org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor;
 import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
 
+/**
+ * A DOM-based server
+ */
 public class Server {
     private static final String WSSE_NS 
         = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
@@ -42,7 +45,6 @@ public class Server {
     protected Server() throws Exception {
         System.out.println("Starting Server");
 
-
         Object implementor = new GreeterImpl();
         String address = "http://localhost:9000/SoapContext/GreeterPort";
         EndpointImpl endpoint = (EndpointImpl)Endpoint.publish(address, implementor);

Copied: cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/server/StaxServer.java
(from r1558415, cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/java/demo/wssec/server/Server.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/server/StaxServer.java?p2=cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/server/StaxServer.java&p1=cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/java/demo/wssec/server/Server.java&r1=1558415&r2=1558436&rev=1558436&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/ws_security/stax_sign_enc/src/main/java/demo/wssec/server/Server.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/java/demo/wssec/server/StaxServer.java
Wed Jan 15 15:44:46 2014
@@ -38,11 +38,13 @@ import org.apache.wss4j.stax.securityTok
 import org.apache.xml.security.stax.ext.SecurePart;
 import org.apache.xml.security.stax.ext.XMLSecurityConstants;
 
-public class Server {
-
-    protected Server() throws Exception {
-        System.out.println("Starting Server");
+/**
+ * A StAX-based server
+ */
+public class StaxServer {
 
+    protected StaxServer() throws Exception {
+        System.out.println("Starting StaxServer");
 
         Object implementor = new GreeterImpl();
         String address = "http://localhost:9000/SoapContext/GreeterPort";
@@ -56,9 +58,9 @@ public class Server {
         Bus bus = bf.createBus(busFile.toString());
 
         Properties decCryptoProperties = 
-            CryptoFactory.getProperties("etc/Server_Decrypt.properties", Server.class.getClassLoader());
+            CryptoFactory.getProperties("etc/Server_Decrypt.properties", StaxServer.class.getClassLoader());
         Properties sigVerCryptoProperties = 
-            CryptoFactory.getProperties("etc/Server_SignVerf.properties", Server.class.getClassLoader());
+            CryptoFactory.getProperties("etc/Server_SignVerf.properties", StaxServer.class.getClassLoader());
         
         WSSSecurityProperties properties = new WSSSecurityProperties();
         properties.addAction(WSSConstants.USERNAMETOKEN);
@@ -119,13 +121,13 @@ public class Server {
 
         BusFactory.setDefaultBus(bus);
 
-        new Server();
-        System.out.println("Server ready...");
+        new StaxServer();
+        System.out.println("StaxServer ready...");
 
         Thread.sleep(5 * 60 * 1000);
 
         bus.shutdown(true);
-        System.out.println("Server exiting");
+        System.out.println("StaxServer exiting");
         System.exit(0);
     }
 }

Modified: cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Client_Encrypt.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Client_Encrypt.properties?rev=1558436&r1=1558435&r2=1558436&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Client_Encrypt.properties
(original)
+++ cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Client_Encrypt.properties
Wed Jan 15 15:44:46 2014
@@ -1,4 +1,4 @@
-org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.provider=org.apache.wss4j.common.crypto.Merlin
 org.apache.ws.security.crypto.merlin.keystore.type=jks
 org.apache.ws.security.crypto.merlin.keystore.password=storepassword
 org.apache.ws.security.crypto.merlin.keystore.alias=serverx509v1

Modified: cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Client_Sign.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Client_Sign.properties?rev=1558436&r1=1558435&r2=1558436&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Client_Sign.properties
(original)
+++ cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Client_Sign.properties
Wed Jan 15 15:44:46 2014
@@ -1,4 +1,4 @@
-org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.provider=org.apache.wss4j.common.crypto.Merlin
 org.apache.ws.security.crypto.merlin.keystore.type=jks
 org.apache.ws.security.crypto.merlin.keystore.password=storepassword
 org.apache.ws.security.crypto.merlin.keystore.alias=clientx509v1

Modified: cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Server_Decrypt.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Server_Decrypt.properties?rev=1558436&r1=1558435&r2=1558436&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Server_Decrypt.properties
(original)
+++ cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Server_Decrypt.properties
Wed Jan 15 15:44:46 2014
@@ -1,4 +1,4 @@
-org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.provider=org.apache.wss4j.common.crypto.Merlin
 org.apache.ws.security.crypto.merlin.keystore.type=jks
 org.apache.ws.security.crypto.merlin.keystore.password=storepassword
 org.apache.ws.security.crypto.merlin.keystore.alias=serverx509v1

Modified: cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Server_SignVerf.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Server_SignVerf.properties?rev=1558436&r1=1558435&r2=1558436&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Server_SignVerf.properties
(original)
+++ cxf/trunk/distribution/src/main/release/samples/ws_security/sign_enc/src/main/resources/etc/Server_SignVerf.properties
Wed Jan 15 15:44:46 2014
@@ -1,4 +1,4 @@
-org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.provider=org.apache.wss4j.common.crypto.Merlin
 org.apache.ws.security.crypto.merlin.keystore.type=jks
 org.apache.ws.security.crypto.merlin.keystore.password=storepassword
 org.apache.ws.security.crypto.merlin.keystore.alias=clientx509v1



Mime
View raw message