axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi...@apache.org
Subject svn commit: r279009 - in /webservices/axis2/trunk/java/modules: integration/test-resources/security/ integration/test/org/apache/axis2/security/ security/src/org/apache/axis2/security/util/
Date Tue, 06 Sep 2005 14:40:49 GMT
Author: ruchithf
Date: Tue Sep  6 07:37:19 2005
New Revision: 279009

URL: http://svn.apache.org/viewcvs?rev=279009&view=rev
Log:
Testcase added to test MTOM-Optimizing the //xenc:EncryptedData/xenc:CipherData/xenc:CipherValue
elements,  added the licence to MessageOptimizer and removed an unnecessary method from MessageOptimizer

Added:
    webservices/axis2/trunk/java/modules/integration/test-resources/security/secMtom.client.axis2.xml
    webservices/axis2/trunk/java/modules/integration/test-resources/security/secMtom.service.axis2.xml
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/MTOMOptimizedSecurityTest.java
Modified:
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/MessageOptimizer.java

Added: webservices/axis2/trunk/java/modules/integration/test-resources/security/secMtom.client.axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test-resources/security/secMtom.client.axis2.xml?rev=279009&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test-resources/security/secMtom.client.axis2.xml
(added)
+++ webservices/axis2/trunk/java/modules/integration/test-resources/security/secMtom.client.axis2.xml
Tue Sep  6 07:37:19 2005
@@ -0,0 +1,68 @@
+<axisconfig name="AxisJava2.0">
+    <parameter name="hotdeployment" locked="false">true</parameter>
+    <parameter name="hotupdate" locked="false">true</parameter>
+
+    <messageReceiver mep="INOUT" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+
+    <!-- Engage the security module -->
+    <module ref="security"/>
+
+    <!-- This is only till we get the service specific parameters fixed in service.xml
-->
+    <!-- Also we can switch back to hte normal parameter names when we can seperately
assign them to the flows -->
+
+    <!-- Scenario 3: Client's Configuration:START-->
+
+    <parameter name="OutAction" locked="false">Signature Encrypt Timestamp</parameter>
+    <parameter name="user" locked="false">alice</parameter>
+    <parameter name="OutPasswordCallbackClass" locked="false">org.apache.axis2.security.PWCallback</parameter>
+    <parameter name="OutSignaturePropFile" locked="false">interop.properties</parameter>
+    <parameter name="OutSignatureKeyIdentifier" locked="false">DirectReference</parameter>
+    <parameter name="encryptionKeyIdentifier" locked="false">SKIKeyIdentifier</parameter>
+    <parameter name="encryptionUser" locked="false">bob</parameter>
+
+
+    <parameter name="InAction" locked="false">Signature Encrypt Timestamp</parameter>
+    <parameter name="InPasswordCallbackClass" locked="false">org.apache.axis2.security.PWCallback</parameter>
+    <parameter name="InSignaturePropFile" locked="false">interop.properties</parameter>
+
+    <parameter name="InSignaturePropFile" locked="false">interop.properties</parameter>
+
+    <parameter name="optimizeParts" locked="false">//xenc:EncryptedData/xenc:CipherData/xenc:CipherValue</parameter>
+
+    <!-- Scenario 3: Client's Configuration:END-->
+
+
+    <transportReceiver name="http">
+    </transportReceiver>
+    <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL" locked="false">HTTP/1.0</parameter>
+    </transportSender>
+
+
+    
+    <phaseOrder type="inflow">
+        <!--  System pre defined phases       -->
+        <phase name="TransportIn"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch"/>
+        <phase name="PostDispatch"/>
+        <!--  System pre defined phases       -->
+        <!--   After Postdispatch phase module author or or service author can add any
phase he want      -->
+        <phase name="userphase1"/>
+    </phaseOrder>
+    <phaseOrder type="outflow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="userphase1"/>
+        <!--        This is temporray solution will be change soon-->
+        <phase name="security"/>
+    </phaseOrder>
+    <phaseOrder type="INfaultflow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="userphase1"/>
+    </phaseOrder>
+    <phaseOrder type="Outfaultflow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="userphase1"/>
+    </phaseOrder>
+</axisconfig>
+

Added: webservices/axis2/trunk/java/modules/integration/test-resources/security/secMtom.service.axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test-resources/security/secMtom.service.axis2.xml?rev=279009&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test-resources/security/secMtom.service.axis2.xml
(added)
+++ webservices/axis2/trunk/java/modules/integration/test-resources/security/secMtom.service.axis2.xml
Tue Sep  6 07:37:19 2005
@@ -0,0 +1,97 @@
+<axisconfig name="AxisJava2.0">
+    <parameter name="hotdeployment" locked="false">true</parameter>
+    <parameter name="hotupdate" locked="false">true</parameter>
+
+    <messageReceiver mep="INOUT" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+
+    <!-- Engage the security module -->
+    <module ref="security"/>
+
+    <!-- This is only till we get the service specific parameters fixed in service.xml
-->
+
+    <!-- Scenario 3: Service's Configuration: START-->
+    <!-- Also we can switch back to hte normal parameter names when we can seperately
assign them to the flows -->
+
+    <parameter name="InAction" locked="false">Signature Encrypt Timestamp</parameter>
+    <parameter name="InPasswordCallbackClass" locked="false">org.apache.axis2.security.PWCallback</parameter>
+    <parameter name="InSignaturePropFile" locked="false">interop.properties</parameter>
+
+    <parameter name="OutAction" locked="false">Signature Encrypt Timestamp</parameter>
+    <parameter name="user" locked="false">bob</parameter>
+    <parameter name="OutPasswordCallbackClass" locked="false">org.apache.axis2.security.PWCallback</parameter>
+    <parameter name="OutSignaturePropFile" locked="false">interop.properties</parameter>
+    <parameter name="OutSignatureKeyIdentifier" locked="false">DirectReference</parameter>
+    <parameter name="encryptionKeyIdentifier" locked="false">SKIKeyIdentifier</parameter>
+    <parameter name="encryptionUser" locked="false">alice</parameter>
+
+    <!-- Scenario 3: Service's Configuration: END-->
+
+    <!-- ================================================= -->
+    <!-- Transport Ins -->
+    <!-- ================================================= -->
+    <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer">
+        <parameter name="port" locked="false">6060</parameter>
+    </transportReceiver>
+
+    <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport
Receiver
+    <transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener">
+          <parameter name="transport.mail.pop3.host" locked="false">127.0.0.1</parameter>
+          <parameter name="transport.mail.pop3.user" locked="false">axis2</parameter>
+          <parameter name="transport.mail.pop3.password" locked="false">axis2</parameter>
+          <parameter name="transport.mail.pop3.port" locked="false">110</parameter>
+          <parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter>
+      </transportReceiver> -->
+
+    <transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPServer">
+        <parameter name="port" locked="false">6060</parameter>
+    </transportReceiver>
+
+    <!-- ================================================= -->
+    <!-- Transport Outs -->
+    <!-- ================================================= -->
+
+    <transportSender name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+    <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/>
+    <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL" locked="false">HTTP/1.0</parameter>
+    </transportSender>
+    <transportSender name="https" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
+    </transportSender>
+
+    <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport
Receiver
+   <transportSender name="mail" class="org.apache.axis2.transport.mail.MailTransportSender">
+       <parameter name="transport.mail.smtp.host" locked="false">127.0.0.1</parameter>
+       <parameter name="transport.mail.smtp.user" locked="false">axis2</parameter>
+       <parameter name="transport.mail.smtp.password" locked="false">axis2</parameter>
+       <parameter name="transport.mail.smtp.port" locked="false">25</parameter>
+   </transportSender>
+   -->
+
+    
+    <phaseOrder type="inflow">
+        <!--  System pre defined phases       -->
+        <phase name="TransportIn"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch"/>
+        <phase name="PostDispatch"/>
+        <!--  System pre defined phases       -->
+        <!--   After Postdispatch phase module author or or service author can add any
phase he want      -->
+        <phase name="userphase1"/>
+    </phaseOrder>
+    <phaseOrder type="outflow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="userphase1"/>
+        <!--        This is temporray solution will be change soon-->
+        <phase name="security"/>
+    </phaseOrder>
+    <phaseOrder type="INfaultflow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="userphase1"/>
+    </phaseOrder>
+    <phaseOrder type="Outfaultflow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="userphase1"/>
+    </phaseOrder>
+</axisconfig>
+

Added: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/MTOMOptimizedSecurityTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/MTOMOptimizedSecurityTest.java?rev=279009&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/MTOMOptimizedSecurityTest.java
(added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/MTOMOptimizedSecurityTest.java
Tue Sep  6 07:37:19 2005
@@ -0,0 +1,33 @@
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.axis2.security;
+
+/**
+ * Testing optimizing the base 64 elements with 
+ * <code><parameter name="optimizeParts" locked="false">//xenc:EncryptedData/xenc:CipherData/xenc:CipherValue</parameter></code>
+ * 
+ * @author Ruchith Fernando (ruchith.fernando@gmail.com)
+ */
+public class MTOMOptimizedSecurityTest extends InteropTestBase {
+
+	protected void setUp() throws Exception {
+		this.setClientRepo(MTOM_SEC_CLIENT_REPOSITORY);
+		this.setServiceRepo(MTOM_SEC_SERVICE_REPOSITORY);
+		super.setUp();
+	}
+	
+}

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/MessageOptimizer.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/MessageOptimizer.java?rev=279009&r1=279008&r2=279009&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/MessageOptimizer.java
(original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/util/MessageOptimizer.java
Tue Sep  6 07:37:19 2005
@@ -1,12 +1,25 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
 
 package org.apache.axis2.security.util;
 
 import java.util.Iterator;
 import java.util.List;
-import java.util.Vector;
 
 import org.apache.axis2.om.OMElement;
-import org.apache.axis2.om.OMNode;
 import org.apache.axis2.om.OMText;
 import org.apache.axis2.om.xpath.AXIOMXPath;
 import org.apache.axis2.soap.SOAPEnvelope;
@@ -16,10 +29,15 @@
 import org.jaxen.SimpleNamespaceContext;
 import org.jaxen.XPath;
 
+/**
+ * Utility class to handle MTOM-Optimizing Base64 Text values
+ *  
+ * @author Ruchith Fernando (ruchith.fernando@gmail.com)
+ */
 public class MessageOptimizer {
 
 	/**
-	 * 
+	 * Mark the requied Base64 text values as optimized
 	 * @param env
 	 * @param optimizeParts This is a set of xPath expressions 
 	 * (NOTE: Right now we support only one expression)
@@ -67,43 +85,5 @@
 	}
 	
 	
-	/**
-	 * Returns all the child elements under the given parent
-	 * It is assumend that the children of the given of elements
-	 * will not be of the same 
-	 * @param env
-	 * @param ln
-	 * @param ns
-	 * @return
-	 */
-	public void findElements(OMNode elem, String ln, String ns, Vector elements ) {
-		
-		if(elem == null || ln == null || ns == null) {
-			return;
-		}
-		
-		OMNode startNode = elem;
-		if (startNode.getType() == OMNode.ELEMENT_NODE
-				&& ((OMElement) startNode).getLocalName().equals(ln)
-				&& ns.equals(((OMElement) startNode).getNamespace().getName())) {
-
-			// An element found
-			elements.add(startNode);
-
-			// move to the next sibling
-			OMNode node = startNode.getNextSibling();
-			
-			if (startNode != null) {
-				findElements(node, ln, ns, elements);
-			}
-		} else {
-			if(startNode.getType() == OMNode.ELEMENT_NODE) {
-				OMNode node = ((OMElement)startNode).getFirstChild();
-				findElements(node, ln, ns, elements);
-			}
-		}
-		
-		
-	}
 	
 }



Mime
View raw message