cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1463914 - in /cxf/branches/wss4j2.0-port: rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/ rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/ services/sts/systests/advanced/src/test/resources/org/ap...
Date Wed, 03 Apr 2013 11:03:11 GMT
Author: coheigea
Date: Wed Apr  3 11:03:10 2013
New Revision: 1463914

URL: http://svn.apache.org/r1463914
Log:
Fixing remaining SecureConversation tests

Modified:
    cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/WSSecurityPolicyLoader.java
    cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
    cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/DoubleIt.wsdl

Modified: cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/WSSecurityPolicyLoader.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/WSSecurityPolicyLoader.java?rev=1463914&r1=1463913&r2=1463914&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/WSSecurityPolicyLoader.java
(original)
+++ cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/WSSecurityPolicyLoader.java
Wed Apr  3 11:03:10 2013
@@ -52,6 +52,7 @@ import org.apache.neethi.builders.xml.XM
 import org.apache.wss4j.policy.SP11Constants;
 import org.apache.wss4j.policy.SP12Constants;
 import org.apache.wss4j.policy.SP13Constants;
+import org.apache.wss4j.policy.SPConstants;
 import org.apache.wss4j.policy.builders.AsymmetricBindingBuilder;
 import org.apache.wss4j.policy.builders.BootstrapPolicyBuilder;
 import org.apache.wss4j.policy.builders.ContentEncryptedElementsBuilder;
@@ -211,7 +212,7 @@ public final class WSSecurityPolicyLoade
             SP12Constants.MUST_NOT_SEND_RENEW,            
             
             // Backwards compatibility thing
-            new QName("http://schemas.microsoft.com/ws/2005/07/securitypolicy", "MustNotSendCancel"),
+            new QName("http://schemas.microsoft.com/ws/2005/07/securitypolicy", SPConstants.MUST_NOT_SEND_CANCEL),
             
             // SCT
             SP12Constants.REQUIRE_EXTERNAL_URI_REFERENCE,

Modified: cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java?rev=1463914&r1=1463913&r2=1463914&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
(original)
+++ cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
Wed Apr  3 11:03:10 2013
@@ -25,6 +25,8 @@ import java.util.Date;
 import java.util.List;
 import java.util.logging.Logger;
 
+import javax.xml.namespace.QName;
+
 import org.w3c.dom.Element;
 
 import org.apache.cxf.binding.soap.SoapBindingConstants;
@@ -104,7 +106,7 @@ class SecureConversationInInterceptor ex
                 for (AssertionInfo ai : ais) {
                     ai.setAsserted(true);
                 }
-                NegotiationUtils.assertPolicy(aim, SPConstants.BOOTSTRAP_POLICY);
+                assertPolicies(aim);
                 
                 Object s = message.getContextualProperty(SecurityConstants.STS_TOKEN_DO_CANCEL);
                 if (s != null && (Boolean.TRUE.equals(s) || "true".equalsIgnoreCase(s.toString())))
{
@@ -214,9 +216,22 @@ class SecureConversationInInterceptor ex
                 message.getInterceptorChain().add(SecureConversationTokenFinderInterceptor.INSTANCE);
             }
             
-            NegotiationUtils.assertPolicy(aim, SPConstants.BOOTSTRAP_POLICY);
+            assertPolicies(aim);
         }
     }
+    
+    private void assertPolicies(AssertionInfoMap aim) {
+        NegotiationUtils.assertPolicy(aim, SPConstants.BOOTSTRAP_POLICY);
+        NegotiationUtils.assertPolicy(aim, SPConstants.MUST_NOT_SEND_AMEND);
+        NegotiationUtils.assertPolicy(aim, SPConstants.MUST_NOT_SEND_CANCEL);
+        NegotiationUtils.assertPolicy(aim, SPConstants.MUST_NOT_SEND_RENEW);
+        QName oldCancelQName = 
+            new QName(
+                "http://schemas.microsoft.com/ws/2005/07/securitypolicy", 
+                SPConstants.MUST_NOT_SEND_CANCEL
+            );
+        NegotiationUtils.assertPolicy(aim, oldCancelQName);
+    }
 
     private void unmapSecurityProps(Message message) {
         Exchange ex = message.getExchange();

Modified: cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/DoubleIt.wsdl
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/DoubleIt.wsdl?rev=1463914&r1=1463913&r2=1463914&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/DoubleIt.wsdl
(original)
+++ cxf/branches/wss4j2.0-port/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/DoubleIt.wsdl
Wed Apr  3 11:03:10 2013
@@ -108,7 +108,6 @@
                         <sp:SecureConversationToken
                             sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
                             <wsp:Policy>
-                                <sp:RequireDerivedKeys />
                                 <sp:BootstrapPolicy>
                                     <wsp:Policy>
                                         <sp:TransportBinding>



Mime
View raw message