You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by na...@apache.org on 2008/06/26 08:29:49 UTC

svn commit: r671801 - in /webservices/rampart/trunk/java/modules/rampart-integration: ./ src/main/java/org/apache/rampart/ src/test/java/org/apache/rampart/ src/test/resources/rampart/ src/test/resources/rampart/policy/

Author: nandana
Date: Wed Jun 25 23:29:48 2008
New Revision: 671801

URL: http://svn.apache.org/viewvc?rev=671801&view=rev
Log:
RAMPART-177 Adding a test case for issue

Added:
    webservices/rampart/trunk/java/modules/rampart-integration/src/main/java/org/apache/rampart/RampartConfigUpdater.java
    webservices/rampart/trunk/java/modules/rampart-integration/src/test/resources/rampart/policy/21.xml
    webservices/rampart/trunk/java/modules/rampart-integration/src/test/resources/rampart/services-21.xml
Modified:
    webservices/rampart/trunk/java/modules/rampart-integration/pom.xml
    webservices/rampart/trunk/java/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java

Modified: webservices/rampart/trunk/java/modules/rampart-integration/pom.xml
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/java/modules/rampart-integration/pom.xml?rev=671801&r1=671800&r2=671801&view=diff
==============================================================================
--- webservices/rampart/trunk/java/modules/rampart-integration/pom.xml (original)
+++ webservices/rampart/trunk/java/modules/rampart-integration/pom.xml Wed Jun 25 23:29:48 2008
@@ -277,6 +277,12 @@
                                       tofile="target/temp-ramp/META-INF/services.xml"/>
                                 <jar jarfile="target/test-resources/rampart_service_repo/services/SecureService20.aar"
                                      basedir="target/temp-ramp"/>  
+                               <!-- Service 21 -->
+                               <copy overwrite="yes"
+                                      file="src/test/resources/rampart/services-21.xml"
+                                      tofile="target/temp-ramp/META-INF/services.xml"/>
+                                <jar jarfile="target/test-resources/rampart_service_repo/services/SecureService21.aar"
+                                     basedir="target/temp-ramp"/>
                                 <!-- Service SC-1 -->
                                 <copy overwrite="yes"
                                       file="src/test/resources/rampart/issuer.properties"

Added: webservices/rampart/trunk/java/modules/rampart-integration/src/main/java/org/apache/rampart/RampartConfigUpdater.java
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/java/modules/rampart-integration/src/main/java/org/apache/rampart/RampartConfigUpdater.java?rev=671801&view=auto
==============================================================================
--- webservices/rampart/trunk/java/modules/rampart-integration/src/main/java/org/apache/rampart/RampartConfigUpdater.java (added)
+++ webservices/rampart/trunk/java/modules/rampart-integration/src/main/java/org/apache/rampart/RampartConfigUpdater.java Wed Jun 25 23:29:48 2008
@@ -0,0 +1,28 @@
+/*
+ * 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.rampart;
+
+import org.apache.rampart.policy.model.RampartConfig;
+
+public class RampartConfigUpdater implements RampartConfigCallbackHandler{
+
+    public void update(RampartConfig rampartConfig) {
+        rampartConfig.setUser("alice");
+        
+    }
+
+}

Modified: webservices/rampart/trunk/java/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/java/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java?rev=671801&r1=671800&r2=671801&view=diff
==============================================================================
--- webservices/rampart/trunk/java/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java (original)
+++ webservices/rampart/trunk/java/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java Wed Jun 25 23:29:48 2008
@@ -74,7 +74,7 @@
                         "Unlimited Strength Jurisdiction Policy !!!");
             }
             
-            for (int i = 1; i <= 20; i++) { //<-The number of tests we have
+            for (int i = 1; i <= 21; i++) { //<-The number of tests we have
                 if(!basic256Supported && (i == 3 || i == 4 || i == 5)) {
                     //Skip the Basic256 tests
                     continue;

Added: webservices/rampart/trunk/java/modules/rampart-integration/src/test/resources/rampart/policy/21.xml
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/java/modules/rampart-integration/src/test/resources/rampart/policy/21.xml?rev=671801&view=auto
==============================================================================
--- webservices/rampart/trunk/java/modules/rampart-integration/src/test/resources/rampart/policy/21.xml (added)
+++ webservices/rampart/trunk/java/modules/rampart-integration/src/test/resources/rampart/policy/21.xml Wed Jun 25 23:29:48 2008
@@ -0,0 +1,70 @@
+<wsp:Policy wsu:Id="SigOnly" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+	<wsp:ExactlyOne>
+		<wsp:All>
+			<sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+				<wsp:Policy>
+					<sp:InitiatorToken>
+						<wsp:Policy>
+							<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+								<wsp:Policy>
+									<sp:WssX509V3Token10/>
+								</wsp:Policy>
+							</sp:X509Token>
+						</wsp:Policy>
+					</sp:InitiatorToken>
+					<sp:RecipientToken>
+						<wsp:Policy>
+							<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
+								<wsp:Policy>
+									<sp:WssX509V3Token10/>
+								</wsp:Policy>
+							</sp:X509Token>
+						</wsp:Policy>
+					</sp:RecipientToken>
+					<sp:AlgorithmSuite>
+						<wsp:Policy>
+							<sp:Basic256/>
+						</wsp:Policy>
+					</sp:AlgorithmSuite>
+					<sp:Layout>
+						<wsp:Policy>
+							<sp:Strict/>
+						</wsp:Policy>
+					</sp:Layout>
+					<sp:IncludeTimestamp/>
+					<sp:OnlySignEntireHeadersAndBody/>
+				</wsp:Policy>
+			</sp:AsymmetricBinding>
+			<sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+				<wsp:Policy>
+					<sp:MustSupportRefKeyIdentifier/>
+					<sp:MustSupportRefIssuerSerial/>
+				</wsp:Policy>
+			</sp:Wss10>
+			<sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+				<sp:Body/>
+			</sp:SignedParts>
+			<ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"> 
+				<ramp:user>not-used</ramp:user>
+				<ramp:encryptionUser>bob</ramp:encryptionUser>
+				<ramp:rampartConfigCallbackClass>org.apache.rampart.RampartConfigUpdater</ramp:rampartConfigCallbackClass> 
+				<ramp:passwordCallbackClass>org.apache.rampart.PWCallback</ramp:passwordCallbackClass>
+				
+				<ramp:signatureCrypto>
+					<ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
+						<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
+						<ramp:property name="org.apache.ws.security.crypto.merlin.file">rampart/store.jks</ramp:property>
+						<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">password</ramp:property>
+					</ramp:crypto>
+				</ramp:signatureCrypto>
+				<ramp:encryptionCypto>
+					<ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
+						<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
+						<ramp:property name="org.apache.ws.security.crypto.merlin.file">rampart/store.jks</ramp:property>
+						<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">password</ramp:property>
+					</ramp:crypto>
+				</ramp:encryptionCypto>
+			</ramp:RampartConfig>
+		</wsp:All>
+	</wsp:ExactlyOne>
+</wsp:Policy>

Added: webservices/rampart/trunk/java/modules/rampart-integration/src/test/resources/rampart/services-21.xml
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/java/modules/rampart-integration/src/test/resources/rampart/services-21.xml?rev=671801&view=auto
==============================================================================
--- webservices/rampart/trunk/java/modules/rampart-integration/src/test/resources/rampart/services-21.xml (added)
+++ webservices/rampart/trunk/java/modules/rampart-integration/src/test/resources/rampart/services-21.xml Wed Jun 25 23:29:48 2008
@@ -0,0 +1,76 @@
+<service name="SecureService21">
+
+	<module ref="addressing"/>
+	<module ref="rampart"/>
+
+	<parameter locked="false" name="ServiceClass">org.apache.rampart.Service</parameter>
+
+	<operation name="echo">
+		<messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+		<actionMapping>urn:echo</actionMapping>
+	</operation>
+	
+	<wsp:Policy wsu:Id="SigOnly" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+	<wsp:ExactlyOne>
+		<wsp:All>
+			<sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+				<wsp:Policy>
+					<sp:InitiatorToken>
+						<wsp:Policy>
+							<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+								<wsp:Policy>
+									<sp:WssX509V3Token10/>
+								</wsp:Policy>
+							</sp:X509Token>
+						</wsp:Policy>
+					</sp:InitiatorToken>
+					<sp:RecipientToken>
+						<wsp:Policy>
+							<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
+								<wsp:Policy>
+									<sp:WssX509V3Token10/>
+								</wsp:Policy>
+							</sp:X509Token>
+						</wsp:Policy>
+					</sp:RecipientToken>
+					<sp:AlgorithmSuite>
+						<wsp:Policy>
+							<sp:Basic256/>
+						</wsp:Policy>
+					</sp:AlgorithmSuite>
+					<sp:Layout>
+						<wsp:Policy>
+							<sp:Strict/>
+						</wsp:Policy>
+					</sp:Layout>
+					<sp:IncludeTimestamp/>
+					<sp:OnlySignEntireHeadersAndBody/>
+				</wsp:Policy>
+			</sp:AsymmetricBinding>
+			<sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+				<wsp:Policy>
+					<sp:MustSupportRefKeyIdentifier/>
+					<sp:MustSupportRefIssuerSerial/>
+				</wsp:Policy>
+			</sp:Wss10>
+			<sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+				<sp:Body/>
+			</sp:SignedParts>
+			<ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"> 
+				<ramp:user>alice</ramp:user>
+				<ramp:encryptionUser>bob</ramp:encryptionUser>
+				<ramp:passwordCallbackClass>org.apache.rampart.PWCallback</ramp:passwordCallbackClass>
+				
+				<ramp:signatureCrypto>
+					<ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
+						<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
+						<ramp:property name="org.apache.ws.security.crypto.merlin.file">rampart/store.jks</ramp:property>
+						<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">password</ramp:property>
+					</ramp:crypto>
+				</ramp:signatureCrypto>
+			</ramp:RampartConfig>
+		</wsp:All>
+	</wsp:ExactlyOne>
+</wsp:Policy>
+
+</service>