You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2013/04/22 17:58:44 UTC
svn commit: r1470594 - in
/cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test:
java/org/apache/cxf/systest/sts/symmetric/
resources/org/apache/cxf/systest/sts/symmetric/
Author: coheigea
Date: Mon Apr 22 15:58:43 2013
New Revision: 1470594
URL: http://svn.apache.org/r1470594
Log:
Merged revisions 1470588 via git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1470588 | coheigea | 2013-04-22 16:50:18 +0100 (Mon, 22 Apr 2013) | 2 lines
[CXF-4977] - Adding @Ignore'd testcase
........
Modified:
cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java
cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/DoubleIt.wsdl
cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-client.xml
cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-service.xml
Modified: cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java?rev=1470594&r1=1470593&r2=1470594&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java (original)
+++ cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java Mon Apr 22 15:58:43 2013
@@ -157,6 +157,33 @@ public class SymmetricBindingTest extend
((java.io.Closeable)symmetricSaml1Port).close();
bus.shutdown(true);
}
+
+ @org.junit.Test
+ @org.junit.Ignore
+ public void testUsernameTokenSAML2SecureConversation() throws Exception {
+
+ SpringBusFactory bf = new SpringBusFactory();
+ URL busFile = SymmetricBindingTest.class.getResource("cxf-client.xml");
+
+ Bus bus = bf.createBus(busFile.toString());
+ SpringBusFactory.setDefaultBus(bus);
+ SpringBusFactory.setThreadDefaultBus(bus);
+
+ URL wsdl = SymmetricBindingTest.class.getResource("DoubleIt.wsdl");
+ Service service = Service.create(wsdl, SERVICE_QNAME);
+ QName portQName = new QName(NAMESPACE, "DoubleItSymmetricSAML2SecureConversationPort");
+ DoubleItPortType symmetricSaml2Port =
+ service.getPort(portQName, DoubleItPortType.class);
+ updateAddressPort(symmetricSaml2Port, PORT);
+ if (standalone) {
+ TokenTestUtils.updateSTSPort((BindingProvider)symmetricSaml2Port, STSPORT2);
+ }
+
+ doubleIt(symmetricSaml2Port, 30);
+
+ ((java.io.Closeable)symmetricSaml2Port).close();
+ bus.shutdown(true);
+ }
private static void doubleIt(DoubleItPortType port, int numToDouble) {
int resp = port.doubleIt(numToDouble);
Modified: cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/DoubleIt.wsdl
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/DoubleIt.wsdl?rev=1470594&r1=1470593&r2=1470594&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/DoubleIt.wsdl (original)
+++ cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/DoubleIt.wsdl Mon Apr 22 15:58:43 2013
@@ -60,6 +60,22 @@
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
+ <wsdl:binding name="DoubleItSymmetricSAML2SecureConversationBinding" type="tns:DoubleItPortType">
+ <wsp:PolicyReference URI="#DoubleItSymmetricBindingSecureConversationSAML2Policy" />
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="DoubleIt">
+ <soap:operation soapAction="" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ <wsp:PolicyReference URI="#DoubleItBinding_DoubleIt_Input_Policy" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ <wsp:PolicyReference URI="#DoubleItBinding_DoubleIt_Output_Policy" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
<wsdl:service name="DoubleItService">
<wsdl:port name="DoubleItSymmetricSAML1Port" binding="tns:DoubleItSymmetricSAML1Binding">
@@ -70,6 +86,10 @@
<soap:address
location="http://localhost:8082/doubleit/services/doubleitsymmetricsaml2" />
</wsdl:port>
+ <wsdl:port name="DoubleItSymmetricSAML2SecureConversationPort" binding="tns:DoubleItSymmetricSAML2SecureConversationBinding">
+ <soap:address
+ location="http://localhost:8082/doubleit/services/doubleitsymmetricsaml2SecureConversation" />
+ </wsdl:port>
<wsdl:port name="DoubleItSymmetricSAML1EncryptedPort" binding="tns:DoubleItSymmetricSAML1Binding">
<soap:address
location="http://localhost:8082/doubleit/services/doubleitsymmetricsaml1encrypted" />
@@ -213,6 +233,99 @@
</wsp:ExactlyOne>
</wsp:Policy>
+ <wsp:Policy wsu:Id="DoubleItSymmetricBindingSecureConversationSAML2Policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <wsam:Addressing wsp:Optional="false">
+ <wsp:Policy />
+ </wsam:Addressing>
+ <sp:SymmetricBinding>
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:SecureConversationToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
+ <wsp:Policy>
+ <sp:BootstrapPolicy>
+ <wsp:Policy>
+ <sp:SignedParts>
+ <sp:Body/>
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing"/>
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing"/>
+ </sp:SignedParts>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SymmetricBinding>
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:IssuedToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
+ <sp:RequestSecurityTokenTemplate>
+ <t:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0</t:TokenType>
+ <t:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/SymmetricKey</t:KeyType>
+ <t:KeySize>128</t:KeySize>
+ </sp:RequestSecurityTokenTemplate>
+ <wsp:Policy>
+ <sp:RequireInternalReference />
+ </wsp:Policy>
+ <sp:Issuer>
+ <wsaw:Address>http://localhost:8080/SecurityTokenService/UT
+ </wsaw:Address>
+ </sp:Issuer>
+ </sp:IssuedToken>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic128 />
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ </wsp:Policy>
+ </sp:BootstrapPolicy>
+ </wsp:Policy>
+ </sp:SecureConversationToken>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Lax />
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp />
+ <sp:OnlySignEntireHeadersAndBody />
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic128 />
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ <sp:Wss11>
+ <wsp:Policy>
+ <sp:MustSupportRefIssuerSerial />
+ <sp:MustSupportRefThumbprint />
+ <sp:MustSupportRefEncryptedKey />
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust13>
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens />
+ <sp:RequireClientEntropy />
+ <sp:RequireServerEntropy />
+ </wsp:Policy>
+ </sp:Trust13>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
<wsp:Policy wsu:Id="DoubleItBinding_DoubleIt_Input_Policy">
<wsp:ExactlyOne>
<wsp:All>
Modified: cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-client.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-client.xml?rev=1470594&r1=1470593&r2=1470594&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-client.xml (original)
+++ cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-client.xml Mon Apr 22 15:58:43 2013
@@ -96,5 +96,12 @@ http://cxf.apache.org/configuration/secu
</jaxws:properties>
</jaxws:client>
+ <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSymmetricSAML2SecureConversationPort"
+ createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.sts.client" value-ref="stsClient"/>
+ </jaxws:properties>
+ </jaxws:client>
+
</beans>
Modified: cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-service.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-service.xml?rev=1470594&r1=1470593&r2=1470594&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-service.xml (original)
+++ cxf/branches/2.7.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/symmetric/cxf-service.xml Mon Apr 22 15:58:43 2013
@@ -87,5 +87,21 @@
</jaxws:properties>
</jaxws:endpoint>
+ <jaxws:endpoint id="doubleitsymmetricsaml2secureconv"
+ implementor="org.apache.cxf.systest.sts.common.DoubleItPortTypeImpl"
+ endpointName="s:DoubleItSymmetricSAML2SecureConversationPort"
+ serviceName="s:DoubleItService"
+ address="http://localhost:${testutil.ports.Server}/doubleit/services/doubleitsymmetricsaml2SecureConversation"
+ wsdlLocation="org/apache/cxf/systest/sts/symmetric/DoubleIt.wsdl"
+ xmlns:s="http://www.example.org/contract/DoubleIt">
+
+ <jaxws:properties>
+ <entry key="ws-security.callback-handler"
+ value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
+ <entry key="ws-security.signature.properties" value="serviceKeystore.properties"/>
+ <entry key="ws-security.is-bsp-compliant" value="false"/>
+ </jaxws:properties>
+ </jaxws:endpoint>
+
</beans>