cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [04/27] cxf git commit: Refactor of STS Transport test config
Date Mon, 08 Aug 2016 01:50:24 GMT
Refactor of STS Transport test config


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/00377a68
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/00377a68
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/00377a68

Branch: refs/heads/master-jaxrs-2.1
Commit: 00377a6880d88c7f45e5e0d7c3c3c79d4e6ac860
Parents: 78e7e8d
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Wed Aug 3 16:10:38 2016 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Wed Aug 3 16:10:38 2016 +0100

----------------------------------------------------------------------
 .../systest/sts/common/SAMLRealmCNCodec.java    |  6 ++-
 .../systest/sts/deployment/cxf-transport.xml    | 47 ++------------------
 .../sts/deployment/stax-cxf-transport.xml       | 47 ++------------------
 3 files changed, 13 insertions(+), 87 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/00377a68/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/SAMLRealmCNCodec.java
----------------------------------------------------------------------
diff --git a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/SAMLRealmCNCodec.java
b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/SAMLRealmCNCodec.java
index 18fe09d..c3c9346 100644
--- a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/SAMLRealmCNCodec.java
+++ b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/SAMLRealmCNCodec.java
@@ -25,7 +25,11 @@ public class SAMLRealmCNCodec implements SAMLRealmCodec {
 
     @Override
     public String getRealmFromToken(SamlAssertionWrapper assertion) {
-        return assertion.getIssuerString();
+        String issuer = assertion.getIssuerString();
+        if (issuer != null && issuer.contains("a-issuer")) {
+            return issuer;
+        }
+        return null;
     }
 }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/00377a68/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-transport.xml
----------------------------------------------------------------------
diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-transport.xml
b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-transport.xml
index 8d721d9..0a6548d 100644
--- a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-transport.xml
+++ b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-transport.xml
@@ -35,34 +35,6 @@
         <ref bean="utDelegationHandler"/>
     </util:list>
     
-    <bean id="transportSTSProviderBean2" class="org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider">
-        <property name="issueOperation" ref="transportIssueDelegate2"/>
-        <property name="validateOperation" ref="transportValidateDelegate2"/>
-    </bean>
-    <bean id="transportIssueDelegate2" class="org.apache.cxf.sts.operation.TokenIssueOperation">
-        <property name="tokenProviders" ref="transportTokenProviders2"/>
-        <property name="tokenValidators" ref="transportTokenValidators"/>
-        <property name="services" ref="transportService"/>
-        <property name="stsProperties" ref="transportSTSProperties"/>
-        <property name="delegationHandlers" ref="hokDelegationHandler"/>
-        <property name="claimsManager" ref="claimsManager"/>
-    </bean>
-    <bean id="transportValidateDelegate2" class="org.apache.cxf.sts.operation.TokenValidateOperation">
-        <property name="tokenValidators" ref="transportTokenValidators2"/>
-        <property name="stsProperties" ref="transportSTSProperties"/>
-    </bean>
-    <util:list id="transportTokenValidators2">
-        <ref bean="transportSamlTokenValidator2"/>
-    </util:list>
-    <util:list id="transportTokenProviders2">
-        <ref bean="transportSamlTokenProvider2"/>
-    </util:list>
-    <bean id="transportSamlTokenValidator2" class="org.apache.cxf.sts.token.validator.SAMLTokenValidator">
-        <property name="samlRealmCodec" ref="samlRealmCodec"/>
-    </bean>
-    <bean id="transportSamlTokenProvider2" class="org.apache.cxf.sts.token.provider.SAMLTokenProvider">
-        <property name="realmMap" ref="realms"/>
-    </bean>
     <bean id="transportIssueDelegate" class="org.apache.cxf.sts.operation.TokenIssueOperation">
         <property name="tokenProviders" ref="transportTokenProviders"/>
         <property name="tokenValidators" ref="transportTokenValidators"/>
@@ -85,8 +57,10 @@
         <ref bean="transportSamlTokenProvider"/>
     </util:list>
     <bean id="transportSamlTokenValidator" class="org.apache.cxf.sts.token.validator.SAMLTokenValidator">
+        <property name="samlRealmCodec" ref="samlRealmCodec"/>
     </bean>
     <bean id="transportSamlTokenProvider" class="org.apache.cxf.sts.token.provider.SAMLTokenProvider">
+        <property name="realmMap" ref="realms"/>
     </bean>
     <bean id="transportSTSProviderBean" class="org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider">
         <property name="issueOperation" ref="transportIssueDelegate"/>
@@ -133,26 +107,13 @@
             <entry key="security.callback-handler" value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
         </jaxws:properties>
     </jaxws:endpoint>
-    <jaxws:endpoint xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/" id="transportSTS-realmB"
implementor="#transportSTSProviderBean2" address="https://localhost:${testutil.ports.STSServer}/SecurityTokenService/b-issuer/Transport"
wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/deployment/ws-trust-1.4-service.wsdl"
serviceName="ns1:SecurityTokenService" endpointName="ns1:Transport_SAML_Port" depends-on="ClientAuthHttpsSettings">
+    <jaxws:endpoint xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/" id="transportSTS-realmB"
implementor="#transportSTSProviderBean" address="https://localhost:${testutil.ports.STSServer}/SecurityTokenService/b-issuer/Transport"
wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/deployment/ws-trust-1.4-service.wsdl"
serviceName="ns1:SecurityTokenService" endpointName="ns1:Transport_SAML_Port" depends-on="ClientAuthHttpsSettings">
         <jaxws:properties>
             <entry key="security.callback-handler" value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
             <entry key="security.signature.properties" value="stsKeystore.properties"/>
         </jaxws:properties>
     </jaxws:endpoint>
-    <!--
-    <jaxws:endpoint id="transportSTS-realmB" implementor="#transportSTSProviderBean2"
-        address="https://localhost:${testutil.ports.STSServer}/SecurityTokenService/b-issuer/Transport"
-        wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/deployment/ws-trust-1.4-service.wsdl"
-        xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
-        serviceName="ns1:SecurityTokenService" endpointName="ns1:Transport_Port"
-                depends-on="ClientAuthHttpsSettings">
-        <jaxws:properties>
-            <entry key="security.callback-handler"
-                value="org.apache.cxf.systest.sts.common.CommonCallbackHandler" />
-            <entry key="security.signature.properties" value="stsKeystore.properties"/>
-        </jaxws:properties>
-    </jaxws:endpoint>
-    -->
+
     <httpj:engine-factory id="ClientAuthHttpsSettings" bus="cxf">
         <httpj:engine port="${testutil.ports.STSServer}">
             <httpj:tlsServerParameters>

http://git-wip-us.apache.org/repos/asf/cxf/blob/00377a68/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-transport.xml
----------------------------------------------------------------------
diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-transport.xml
b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-transport.xml
index 8405022..07dbc64 100644
--- a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-transport.xml
+++ b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-transport.xml
@@ -28,33 +28,6 @@
     <import resource="realms.xml" />
     
     <bean id="hokDelegationHandler" class="org.apache.cxf.sts.token.delegation.HOKDelegationHandler"/>
-    <bean id="transportSTSProviderBean2" class="org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider">
-        <property name="issueOperation" ref="transportIssueDelegate2"/>
-        <property name="validateOperation" ref="transportValidateDelegate2"/>
-    </bean>
-    <bean id="transportIssueDelegate2" class="org.apache.cxf.sts.operation.TokenIssueOperation">
-        <property name="tokenProviders" ref="transportTokenProviders2"/>
-        <property name="tokenValidators" ref="transportTokenValidators"/>
-        <property name="services" ref="transportService"/>
-        <property name="stsProperties" ref="transportSTSProperties"/>
-        <property name="delegationHandlers" ref="hokDelegationHandler"/>
-    </bean>
-    <bean id="transportValidateDelegate2" class="org.apache.cxf.sts.operation.TokenValidateOperation">
-        <property name="tokenValidators" ref="transportTokenValidators2"/>
-        <property name="stsProperties" ref="transportSTSProperties"/>
-    </bean>
-    <util:list id="transportTokenValidators2">
-        <ref bean="transportSamlTokenValidator2"/>
-    </util:list>
-    <util:list id="transportTokenProviders2">
-        <ref bean="transportSamlTokenProvider2"/>
-    </util:list>
-    <bean id="transportSamlTokenValidator2" class="org.apache.cxf.sts.token.validator.SAMLTokenValidator">
-        <property name="samlRealmCodec" ref="samlRealmCodec"/>
-    </bean>
-    <bean id="transportSamlTokenProvider2" class="org.apache.cxf.sts.token.provider.SAMLTokenProvider">
-        <property name="realmMap" ref="realms"/>
-    </bean>
     <bean id="transportIssueDelegate" class="org.apache.cxf.sts.operation.TokenIssueOperation">
         <property name="tokenProviders" ref="transportTokenProviders"/>
         <property name="tokenValidators" ref="transportTokenValidators"/>
@@ -73,8 +46,10 @@
         <ref bean="transportSamlTokenProvider"/>
     </util:list>
     <bean id="transportSamlTokenValidator" class="org.apache.cxf.sts.token.validator.SAMLTokenValidator">
+        <property name="samlRealmCodec" ref="samlRealmCodec"/>
     </bean>
     <bean id="transportSamlTokenProvider" class="org.apache.cxf.sts.token.provider.SAMLTokenProvider">
+        <property name="realmMap" ref="realms"/>
     </bean>
     <bean id="transportSTSProviderBean" class="org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider">
         <property name="issueOperation" ref="transportIssueDelegate"/>
@@ -115,28 +90,14 @@
             <entry key="ws-security.enable.streaming" value="true"/>
         </jaxws:properties>
     </jaxws:endpoint>
-    <jaxws:endpoint xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/" id="transportSTS-realmB"
implementor="#transportSTSProviderBean2" address="https://localhost:${testutil.ports.StaxSTSServer}/SecurityTokenService/b-issuer/Transport"
wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/deployment/ws-trust-1.4-service.wsdl"
serviceName="ns1:SecurityTokenService" endpointName="ns1:Transport_SAML_Port" depends-on="ClientAuthHttpsSettings">
+    <jaxws:endpoint xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/" id="transportSTS-realmB"
implementor="#transportSTSProviderBean" address="https://localhost:${testutil.ports.StaxSTSServer}/SecurityTokenService/b-issuer/Transport"
wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/deployment/ws-trust-1.4-service.wsdl"
serviceName="ns1:SecurityTokenService" endpointName="ns1:Transport_SAML_Port" depends-on="ClientAuthHttpsSettings">
         <jaxws:properties>
             <entry key="security.callback-handler" value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
             <entry key="security.signature.properties" value="stsKeystore.properties"/>
             <entry key="ws-security.enable.streaming" value="true"/>
         </jaxws:properties>
     </jaxws:endpoint>
-    <!--
-    <jaxws:endpoint id="transportSTS-realmB" implementor="#transportSTSProviderBean2"
-        address="https://localhost:${testutil.ports.StaxSTSServer}/SecurityTokenService/b-issuer/Transport"
-        wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/deployment/ws-trust-1.4-service.wsdl"
-        xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
-        serviceName="ns1:SecurityTokenService" endpointName="ns1:Transport_Port"
-                depends-on="ClientAuthHttpsSettings">
-        <jaxws:properties>
-            <entry key="security.callback-handler"
-                value="org.apache.cxf.systest.sts.common.CommonCallbackHandler" />
-            <entry key="security.signature.properties" value="stsKeystore.properties"/>
-            <entry key="ws-security.enable.streaming" value="true"/>
-        </jaxws:properties>
-    </jaxws:endpoint>
-    -->
+
     <httpj:engine-factory id="ClientAuthHttpsSettings" bus="cxf">
         <httpj:engine port="${testutil.ports.StaxSTSServer}">
             <httpj:tlsServerParameters>


Mime
View raw message