axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Theodore W. Leung" <twle...@sauria.com>
Subject Re: cvs commit: xml-axis/java/test build_functional_tests.xml
Date Thu, 24 Jan 2002 20:18:33 GMT
Thanks for these.

Turns out we have some buggy usage of the C14n stuff.  I'm looking at it
today.  Patches tonight (I hope)

On Tue, 2002-01-22 at 07:11, dims@apache.org wrote:
> dims        02/01/22 07:11:12
> 
>   Modified:    java/samples/security SignedSOAPEnvelope.java
>                java/test build_functional_tests.xml
>   Added:       java/samples/security ClientSigningHandler.java
>                         clientsecuritydeploy.wsdd
>                         clientsecurityundeploy.wsdd
>   Log:
>   - Added ClientSigningHandler from "Theodore W. Leung" <twleung@sauria.com>
>   - Added (but commented out!!!) section in build_functional_tests.xml to add the client
side handler for automated tests.
>   
>   Revision  Changes    Path
>   1.3       +9 -0      xml-axis/java/samples/security/SignedSOAPEnvelope.java
>   
>   Index: SignedSOAPEnvelope.java
>   ===================================================================
>   RCS file: /home/cvs/xml-axis/java/samples/security/SignedSOAPEnvelope.java,v
>   retrieving revision 1.2
>   retrieving revision 1.3
>   diff -u -r1.2 -r1.3
>   --- SignedSOAPEnvelope.java	14 Jan 2002 14:21:03 -0000	1.2
>   +++ SignedSOAPEnvelope.java	22 Jan 2002 15:11:12 -0000	1.3
>   @@ -96,7 +96,15 @@
>            org.apache.xml.security.Init.init();
>        }
>    
>   +    public SignedSOAPEnvelope (SOAPEnvelope env, String baseURI, String keystoreFile)
{
>   +        init(env, baseURI, keystoreFile);
>   +    }
>   +
>        public SignedSOAPEnvelope (SOAPEnvelope env, String baseURI) {
>   +            init(env, baseURI, keystoreFile);
>   +    }
>   +
>   +    private void init (SOAPEnvelope env, String baseURI, String keystoreFile) {
>            try {
>                env.addMapping(new Mapping(SOAPSECNS,SOAPSECprefix));
>                env.addAttribute(Constants.URI_SOAP_ENV,"actor","some-uri");
>   @@ -145,4 +153,5 @@
>                throw new RuntimeException( e.toString() );
>            }
>        }
>   +
>    }
>   
>   
>   
>   1.1                  xml-axis/java/samples/security/ClientSigningHandler.java
>   
>   Index: ClientSigningHandler.java
>   ===================================================================
>   /*
>    * The Apache Software License, Version 1.1
>    *
>    *
>    * Copyright (c) 2001 The Apache Software Foundation.  All rights
>    * reserved.
>    *
>    * Redistribution and use in source and binary forms, with or without
>    * modification, are permitted provided that the following conditions
>    * are met:
>    *
>    * 1. Redistributions of source code must retain the above copyright
>    *    notice, this list of conditions and the following disclaimer.
>    *
>    * 2. Redistributions in binary form must reproduce the above copyright
>    *    notice, this list of conditions and the following disclaimer in
>    *    the documentation and/or other materials provided with the
>    *    distribution.
>    *
>    * 3. The end-user documentation included with the redistribution,
>    *    if any, must include the following acknowledgment:
>    *       "This product includes software developed by the
>    *        Apache Software Foundation (http://www.apache.org/)."
>    *    Alternately, this acknowledgment may appear in the software itself,
>    *    if and wherever such third-party acknowledgments normally appear.
>    *
>    * 4. The names "Axis" and "Apache Software Foundation" must
>    *    not be used to endorse or promote products derived from this
>    *    software without prior written permission. For written
>    *    permission, please contact apache@apache.org.
>    *
>    * 5. Products derived from this software may not be called "Apache",
>    *    nor may "Apache" appear in their name, without prior written
>    *    permission of the Apache Software Foundation.
>    *
>    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
>    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
>    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
>    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
>    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
>    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
>    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
>    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
>    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
>    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>    * SUCH DAMAGE.
>    * ====================================================================
>    *
>    * This software consists of voluntary contributions made by many
>    * individuals on behalf of the Apache Software Foundation.  For more
>    * information on the Apache Software Foundation, please see
>    * <http://www.apache.org/>.
>    */
>   
>   package samples.security;
>   
>   import org.apache.axis.AxisFault;
>   import org.apache.axis.Handler;
>   import org.apache.axis.MessageContext;
>   import org.apache.axis.handlers.BasicHandler;
>   import org.apache.axis.AxisFault;
>   import org.apache.axis.Message;
>   import org.apache.axis.MessageContext;
>   import org.apache.axis.message.SOAPEnvelope;
>   import org.apache.axis.utils.JavaUtils;
>   import org.apache.log4j.Category;
>   import org.apache.xml.security.signature.XMLSignature;
>   import org.apache.xml.security.utils.Constants;
>   import org.apache.xpath.CachedXPathAPI;
>   
>   import org.w3c.dom.Document;
>   import org.w3c.dom.Element;
>   
>   import java.io.FileWriter;
>   import java.io.PrintWriter;
>   import java.io.FileOutputStream;
>   import java.io.PrintWriter;
>   import java.util.Date;
>   
>   public class ClientSigningHandler extends BasicHandler {
>       static Category category =
>               Category.getInstance(ClientSigningHandler.class.getName());
>   
>       public void invoke(MessageContext msgContext) throws AxisFault
>       {
>           /** Sign the SOAPEnvelope
>            */
>           try {
>               Handler serviceHandler = msgContext.getServiceHandler();
>               String filename = (String)getOption("keystore");
>               if ((filename == null) || (filename.equals("")))
>                   throw new AxisFault("Server.NoKeyStoreFile",
>                                    "No KeyStore file configured for the ClientSigningHandler!",
>                                       null, null);
>   			Message requestMessage = msgContext.getRequestMessage();
>   			SOAPEnvelope unsignedEnvelope = requestMessage.getSOAPEnvelope();
>   			// need to correctly compute baseuri
>   			SignedSOAPEnvelope signedEnvelope = new SignedSOAPEnvelope(unsignedEnvelope,"http://xml-security",filename);
>   			requestMessage = new Message(signedEnvelope);
>   			msgContext.setCurrentMessage(requestMessage);
>               // and then pass on to next handler
>               requestMessage.getSOAPPart().writeTo(System.out);
>           } catch (Exception e) {
>               throw AxisFault.makeFault(e);
>   		}
>       }
>   
>       public void undo(MessageContext msgContext)
>       {
>           try {
>               // probably needs to fault.
>           } catch( Exception e ) {
>               category.error( e );
>           }
>       }
>   }
>   
>   
>   
>   1.1                  xml-axis/java/samples/security/clientsecuritydeploy.wsdd
>   
>   Index: clientsecuritydeploy.wsdd
>   ===================================================================
>   <deployment xmlns="http://xml.apache.org/axis/wsdd/"
>               xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
>    <globalConfiguration>
>     <requestFlow>
>      <!-- define the client Signing handler configuration -->
>      <handler type="java:samples.security.ClientSigningHandler">
>       <parameter name="keystore" value="samples/security/keystore.jks"/>
>      </handler>
>     </requestFlow>
>    </globalConfiguration>
>   </deployment>
>   
>   
>   
>   
>   1.1                  xml-axis/java/samples/security/clientsecurityundeploy.wsdd
>   
>   Index: clientsecurityundeploy.wsdd
>   ===================================================================
>   <undeployment xmlns="http://xml.apache.org/axis/wsdd/"
>               xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
>    <globalConfiguration>
>     <requestFlow>
>      <!-- define the client Signing handler configuration -->
>      <handler type="java:samples.security.ClientSigningHandler">
>       <parameter name="keystore" value="samples/security/keystore.jks"/>
>      </handler>
>     </requestFlow>
>    </globalConfiguration>
>   </undeployment>
>   
>   
>   
>   
>   1.31      +21 -0     xml-axis/java/test/build_functional_tests.xml
>   
>   Index: build_functional_tests.xml
>   ===================================================================
>   RCS file: /home/cvs/xml-axis/java/test/build_functional_tests.xml,v
>   retrieving revision 1.30
>   retrieving revision 1.31
>   diff -u -r1.30 -r1.31
>   --- build_functional_tests.xml	16 Jan 2002 14:07:58 -0000	1.30
>   +++ build_functional_tests.xml	22 Jan 2002 15:11:12 -0000	1.31
>   @@ -78,6 +78,16 @@
>    
>        <!--...not to mention the sample user list -->
>        <copy file="samples/stock/users.lst" todir="build"/>
>   +
>   +    <!-- Uncomment following section to enable transparent Signing 
>   +         of SOAP Messages sent from the client -->
>   +    <!--
>   +    <java classname="org.apache.axis.utils.Admin" fork="yes">
>   +      <classpath refid="test-classpath" />
>   +      <arg value="client"/>
>   +      <arg value="samples/security/clientsecuritydeploy.wsdd"/>
>   +    </java>
>   +    -->
>        
>        <java classname="org.apache.axis.client.AdminClient" fork="yes">
>          <classpath refid="test-classpath" />
>   @@ -102,6 +112,17 @@
>          <classpath refid="test-classpath" />
>          <arg line="${undeploy.xml.property}"/>
>        </java>
>   +
>   +    <!-- Uncomment following section to enable transparent Signing 
>   +         of SOAP Messages sent from the client -->
>   +    <!--
>   +    <java classname="org.apache.axis.utils.Admin" fork="yes">
>   +      <classpath refid="test-classpath" />
>   +      <arg value="client"/>
>   +      <arg value="samples/security/clientsecurityundeploy.wsdd"/>
>   +    </java>
>   +    -->
>   +
>      </target>
>    
>      <!-- =================================================================== -->
>   
>   
>   



Mime
View raw message