cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1531013 - in /cxf/trunk/systests/ws-security/src/test: java/org/apache/cxf/systest/ws/spnego/ resources/org/apache/cxf/systest/ws/spnego/
Date Thu, 10 Oct 2013 15:07:09 GMT
Author: coheigea
Date: Thu Oct 10 15:07:09 2013
New Revision: 1531013

URL: http://svn.apache.org/r1531013
Log:
Added a SPNEGO EncryptBeforeSigning Test

Modified:
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/spnego/SpnegoTokenTest.java
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/spnego/DoubleItSpnego.wsdl
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/spnego/client.xml
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/spnego/server.xml

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/spnego/SpnegoTokenTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/spnego/SpnegoTokenTest.java?rev=1531013&r1=1531012&r2=1531013&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/spnego/SpnegoTokenTest.java
(original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/spnego/SpnegoTokenTest.java
Thu Oct 10 15:07:09 2013
@@ -128,4 +128,32 @@ public class SpnegoTokenTest extends Abs
         bus.shutdown(true);
     }
     
+    @org.junit.Test
+    public void testSpnegoOverSymmetricEncryptBeforeSigning() throws Exception {
+        
+        if (!unrestrictedPoliciesInstalled) {
+            return;
+        }
+
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = SpnegoTokenTest.class.getResource("client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+
+        URL wsdl = SpnegoTokenTest.class.getResource("DoubleItSpnego.wsdl");
+        Service service = Service.create(wsdl, SERVICE_QNAME);
+        QName portQName = new QName(NAMESPACE, "DoubleItSpnegoSymmetricEncryptBeforeSigningPort");
+        DoubleItPortType spnegoPort = 
+                service.getPort(portQName, DoubleItPortType.class);
+        updateAddressPort(spnegoPort, PORT);
+        
+        int result = spnegoPort.doubleIt(25);
+        assertTrue(result == 50);
+        
+        ((java.io.Closeable)spnegoPort).close();
+        bus.shutdown(true);
+    }
+    
 }

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/spnego/DoubleItSpnego.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/spnego/DoubleItSpnego.wsdl?rev=1531013&r1=1531012&r2=1531013&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/spnego/DoubleItSpnego.wsdl
(original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/spnego/DoubleItSpnego.wsdl
Thu Oct 10 15:07:09 2013
@@ -70,6 +70,27 @@
         </wsdl:operation>
     </wsdl:binding>
     
+    <wsdl:binding name="DoubleItSpnegoSymmetricProtectionEncryptBeforeSigningBinding"

+                  type="tns:DoubleItPortType">
+        <wsp:PolicyReference URI="#DoubleItSpnegoSymmetricProtectionEncryptBeforeSigningPolicy"
/>
+        <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:fault name="DoubleItFault">
+                <soap:body use="literal" name="DoubleItFault" />
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    
     <wsdl:service name="DoubleItService">
         <wsdl:port name="DoubleItSpnegoSymmetricPort" 
                    binding="tns:DoubleItSpnegoSymmetricProtectionBinding">
@@ -79,6 +100,10 @@
                    binding="tns:DoubleItSpnegoSymmetricProtectionDerivedBinding">
             <soap:address location="http://localhost:9001/DoubleItSpnegoSymmetricDerived"
/>
         </wsdl:port>
+        <wsdl:port name="DoubleItSpnegoSymmetricEncryptBeforeSigningPort" 
+                   binding="tns:DoubleItSpnegoSymmetricProtectionEncryptBeforeSigningBinding">
+            <soap:address location="http://localhost:9001/DoubleItSpnegoSymmetricEncryptBeforeSigning"
/>
+        </wsdl:port>
     </wsdl:service>
 
     <wsp:Policy wsu:Id="DoubleItSpnegoSymmetricProtectionPolicy">
@@ -160,6 +185,46 @@
       </wsp:ExactlyOne>
     </wsp:Policy>
     
+    <wsp:Policy wsu:Id="DoubleItSpnegoSymmetricProtectionEncryptBeforeSigningPolicy">
+      <wsp:ExactlyOne>
+         <wsp:All>
+            <sp:SymmetricBinding>
+               <wsp:Policy>
+                  <sp:ProtectionToken>
+                     <wsp:Policy>
+                         <sp:SpnegoContextToken
+                            sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Once">
+                            <wsp:Policy>
+                            </wsp:Policy>
+                         </sp:SpnegoContextToken>
+                     </wsp:Policy>
+                  </sp:ProtectionToken>
+                  <sp:Layout>
+                     <wsp:Policy>
+                        <sp:Lax/>
+                     </wsp:Policy>
+                  </sp:Layout>
+                  <sp:IncludeTimestamp/>
+                  <sp:OnlySignEntireHeadersAndBody/>
+                  <sp:EncryptBeforeSigning/>
+                  <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>
+         </wsp:All>
+      </wsp:ExactlyOne>
+    </wsp:Policy>
+    
     <wsp:Policy wsu:Id="DoubleItBinding_DoubleIt_Input_Policy">
       <wsp:ExactlyOne>
          <wsp:All>

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/spnego/client.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/spnego/client.xml?rev=1531013&r1=1531012&r2=1531013&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/spnego/client.xml
(original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/spnego/client.xml
Thu Oct 10 15:07:09 2013
@@ -57,4 +57,12 @@
        </jaxws:properties>
     </jaxws:client>
     
+    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSpnegoSymmetricEncryptBeforeSigningPort"

+                  createdFromAPI="true">
+       <jaxws:properties>
+           <entry key="ws-security.kerberos.jaas.context" value="alice" />
+           <entry key="ws-security.kerberos.spn" value="bob@service.ws.apache.org" />
+       </jaxws:properties>
+    </jaxws:client>
+    
 </beans>

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/spnego/server.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/spnego/server.xml?rev=1531013&r1=1531012&r2=1531013&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/spnego/server.xml
(original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/spnego/server.xml
Thu Oct 10 15:07:09 2013
@@ -74,4 +74,19 @@
      
     </jaxws:endpoint>  
     
+    <jaxws:endpoint 
+       id="SpnegoOverSymmetricEncryptBeforeSigning"
+       address="http://localhost:${testutil.ports.Server}/DoubleItSpnegoSymmetricEncryptBeforeSigning"

+       serviceName="s:DoubleItService"
+       endpointName="s:DoubleItSpnegoSymmetricEncryptBeforeSigningPort"
+       xmlns:s="http://www.example.org/contract/DoubleIt"
+       implementor="org.apache.cxf.systest.ws.common.DoubleItImpl"
+       wsdlLocation="org/apache/cxf/systest/ws/spnego/DoubleItSpnego.wsdl">
+        
+       <jaxws:properties>
+           <entry key="ws-security.kerberos.jaas.context" value="bob" />
+       </jaxws:properties> 
+     
+    </jaxws:endpoint>  
+    
 </beans>



Mime
View raw message