cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1559723 - in /cxf/trunk: rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/ services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/ services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ services/sts/sy...
Date Mon, 20 Jan 2014 15:02:27 GMT
Author: coheigea
Date: Mon Jan 20 15:02:27 2014
New Revision: 1559723

URL: http://svn.apache.org/r1559723
Log:
[CXF-5505] - Adding a test for using an STS with SenderVouches

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenValidator.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java
    cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTTokenValidator.java
    cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/sts_sender_vouches/STSSenderVouchesTest.java
    cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/sts_sender_vouches/stax-cxf-sts.xml

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenValidator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenValidator.java?rev=1559723&r1=1559722&r2=1559723&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenValidator.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenValidator.java
Mon Jan 20 15:02:27 2014
@@ -119,7 +119,7 @@ public class STSTokenValidator implement
         } catch (RuntimeException e) {
             throw e;
         } catch (Exception e) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
null, e);
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
e);
         }
     }
     
@@ -154,7 +154,7 @@ public class STSTokenValidator implement
             } catch (RuntimeException e) {
                 throw e;
             } catch (Exception e) {
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
null, e);
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
e);
             }
         }
         return false;

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java?rev=1559723&r1=1559722&r2=1559723&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
Mon Jan 20 15:02:27 2014
@@ -339,7 +339,7 @@ public class SAMLTokenRenewer implements
             // Parse the HOK subject if it exists
             
             WSDocInfo docInfo = new WSDocInfo(((Element)tokenToRenew.getToken()).getOwnerDocument());
-            assertion.parseHOKSubject(
+            assertion.parseSubject(
                 new WSSSAMLKeyInfoProcessor(requestData, docInfo), sigCrypto, callbackHandler
             );
             

Modified: cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java?rev=1559723&r1=1559722&r2=1559723&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java
Mon Jan 20 15:02:27 2014
@@ -807,7 +807,7 @@ public class IssueSamlUnitTest extends o
         data.setCallbackHandler(new PasswordCallbackHandler());
         data.setWssConfig(WSSConfig.getNewInstance());
         
-        assertionWrapper.parseHOKSubject(
+        assertionWrapper.parseSubject(
             new WSSSAMLKeyInfoProcessor(data, new WSDocInfo(assertion.getOwnerDocument())),

                                         data.getSigVerCrypto(), data.getCallbackHandler()
         );

Modified: cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTTokenValidator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTTokenValidator.java?rev=1559723&r1=1559722&r2=1559723&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTTokenValidator.java
(original)
+++ cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTTokenValidator.java
Mon Jan 20 15:02:27 2014
@@ -46,7 +46,7 @@ public class SCTTokenValidator extends S
 
         Document doc = transformedToken.getElement().getOwnerDocument();
         
-        transformedToken.parseHOKSubject(
+        transformedToken.parseSubject(
             new WSSSAMLKeyInfoProcessor(data, new WSDocInfo(doc)), data.getSigVerCrypto(),

             data.getCallbackHandler()
         );

Modified: cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/sts_sender_vouches/STSSenderVouchesTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/sts_sender_vouches/STSSenderVouchesTest.java?rev=1559723&r1=1559722&r2=1559723&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/sts_sender_vouches/STSSenderVouchesTest.java
(original)
+++ cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/sts_sender_vouches/STSSenderVouchesTest.java
Mon Jan 20 15:02:27 2014
@@ -50,7 +50,6 @@ public class STSSenderVouchesTest extend
     private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
 
     private static final String PORT = allocatePort(Server.class);
-    private static final String STAX_PORT = allocatePort(StaxServer.class);
 
     final TestParam test;
     
@@ -70,12 +69,6 @@ public class STSSenderVouchesTest extend
                    "Server failed to launch",
                    // run the server in the same process
                    // set this to false to fork
-                   launchServer(StaxServer.class, true)
-        );
-        assertTrue(
-                   "Server failed to launch",
-                   // run the server in the same process
-                   // set this to false to fork
                    launchServer(STSServer.class, true)
         );
         assertTrue(
@@ -90,14 +83,7 @@ public class STSSenderVouchesTest extend
     public static Collection<TestParam[]> data() {
        
         return Arrays.asList(new TestParam[][] {{new TestParam(PORT, false, STSPORT)},
-                                                {new TestParam(PORT, true, STSPORT)},
-                                                {new TestParam(STAX_PORT, false, STSPORT)},
-                                                {new TestParam(STAX_PORT, true, STSPORT)},
-                                                
                                                 {new TestParam(PORT, false, STAX_STSPORT)},
-                                                {new TestParam(PORT, true, STAX_STSPORT)},
-                                                {new TestParam(STAX_PORT, false, STAX_STSPORT)},
-                                                {new TestParam(STAX_PORT, true, STAX_STSPORT)},
         });
     }
     
@@ -108,7 +94,6 @@ public class STSSenderVouchesTest extend
     }
 
     @org.junit.Test
-    @org.junit.Ignore
     public void testSAML2SenderVouches() throws Exception {
 
         SpringBusFactory bf = new SpringBusFactory();

Modified: cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/sts_sender_vouches/stax-cxf-sts.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/sts_sender_vouches/stax-cxf-sts.xml?rev=1559723&r1=1559722&r2=1559723&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/sts_sender_vouches/stax-cxf-sts.xml
(original)
+++ cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/sts_sender_vouches/stax-cxf-sts.xml
Mon Jan 20 15:02:27 2014
@@ -24,37 +24,35 @@
             <cxf:logging/>
         </cxf:features>
     </cxf:bus>
-    <bean id="x509STSProviderBean" class="org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider">
-        <property name="issueOperation" ref="x509IssueDelegate"/>
+    <bean id="utSTSProviderBean" class="org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider">
+        <property name="issueOperation" ref="utIssueDelegate"/>
     </bean>
-    <bean id="x509IssueDelegate" class="org.apache.cxf.sts.operation.TokenIssueOperation">
-        <property name="tokenProviders" ref="x509SamlTokenProvider"/>
-        <property name="services" ref="x509Service"/>
-        <property name="stsProperties" ref="x509STSProperties"/>
-        <property name="encryptIssuedToken" value="true"/>
-    </bean>
-    <bean id="x509SamlTokenProvider" class="org.apache.cxf.sts.token.provider.SAMLTokenProvider">
-        </bean>
-    <bean id="x509Service" class="org.apache.cxf.sts.service.StaticService">
-        <property name="endpoints" ref="x509Endpoints"/>
-        <property name="encryptionProperties" ref="encProperties"/>
+    <bean id="utIssueDelegate" class="org.apache.cxf.sts.operation.TokenIssueOperation">
+        <property name="tokenProviders" ref="utSamlTokenProvider"/>
+        <property name="services" ref="utService"/>
+        <property name="stsProperties" ref="utSTSProperties"/>
     </bean>
-    <util:list id="x509Endpoints">
-        <value>https://localhost:(\d)*/doubleit/services/doubleittransport.*
+    <bean id="subjectProviderBean" class="org.apache.cxf.systest.sts.sts_sender_vouches.SVSubjectProvider">
+    </bean>
+    <bean id="utSamlTokenProvider" class="org.apache.cxf.sts.token.provider.SAMLTokenProvider">
+        <property name="subjectProvider" ref="subjectProviderBean" />
+    </bean>
+    <bean id="utService" class="org.apache.cxf.sts.service.StaticService">
+        <property name="endpoints" ref="utEndpoints"/>
+    </bean>
+    <util:list id="utEndpoints">
+        <value>http://localhost:(\d)*/(doubleit|metrowsp)/services/doubleit(UT|.*symmetric.*|.*)
                 </value>
     </util:list>
-    <bean id="encProperties" class="org.apache.cxf.sts.service.EncryptionProperties">
-        <property name="encryptionAlgorithm" value="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
-    </bean>
-    <bean id="x509STSProperties" class="org.apache.cxf.sts.StaticSTSProperties">
+    <bean id="utSTSProperties" class="org.apache.cxf.sts.StaticSTSProperties">
         <property name="signaturePropertiesFile" value="stsKeystore.properties"/>
         <property name="signatureUsername" value="mystskey"/>
         <property name="callbackHandlerClass" value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
         <property name="encryptionPropertiesFile" value="stsKeystore.properties"/>
         <property name="issuer" value="DoubleItSTSIssuer"/>
-        <property name="encryptionUsername" value="useReqSigCert"/>
+        <property name="encryptionUsername" value="myservicekey"/>
     </bean>
-    <jaxws:endpoint xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/" id="X509STS"
implementor="#x509STSProviderBean" address="http://localhost:${testutil.ports.StaxSTSServer}/SecurityTokenService/X509"
wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/asymmetric_encr/ws-trust-1.4-service.wsdl"
serviceName="ns1:SecurityTokenService" endpointName="ns1:X509_Port">
+    <jaxws:endpoint xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/" id="UTSTS"
implementor="#utSTSProviderBean" address="http://localhost:${testutil.ports.StaxSTSServer}/SecurityTokenService/UT"
wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/sts_sender_vouches/ws-trust-1.4-service.wsdl"
serviceName="ns1:SecurityTokenService" endpointName="ns1:UT_Port">
         <jaxws:properties>
             <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
             <entry key="ws-security.signature.properties" value="stsKeystore.properties"/>



Mime
View raw message