cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1368178 - in /cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security: policy/interceptors/ trust/
Date Wed, 01 Aug 2012 18:30:19 GMT
Author: dkulp
Date: Wed Aug  1 18:30:19 2012
New Revision: 1368178

URL: http://svn.apache.org/viewvc?rev=1368178&view=rev
Log:
Merged revisions 1368169 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes

........
  r1368169 | dkulp | 2012-08-01 14:28:24 -0400 (Wed, 01 Aug 2012) | 19 lines

  Merged revisions 1368159 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

  ........
    r1368159 | dkulp | 2012-08-01 14:23:41 -0400 (Wed, 01 Aug 2012) | 11 lines

    Merged revisions 1368154 via  git cherry-pick from
    https://svn.apache.org/repos/asf/cxf/trunk

    ........
      r1368154 | dkulp | 2012-08-01 14:18:14 -0400 (Wed, 01 Aug 2012) | 3 lines

      If creating the STS endpoint for SecConv, adjust some of the names and
      actions and such to match the SecConv spec

    ........

  ........

........

Modified:
    cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
    cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
    cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SpnegoContextTokenInInterceptor.java
    cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java

Modified: cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java?rev=1368178&r1=1368177&r2=1368178&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
Wed Aug  1 18:30:19 2012
@@ -184,7 +184,8 @@ final class NegotiationUtils {
         SoapMessage message, 
         String namespace, 
         Policy policy,
-        Invoker invoker
+        Invoker invoker,
+        boolean secConv
     ) {
         Exchange ex = message.getExchange();
         Bus bus = ex.getBus();
@@ -201,13 +202,22 @@ final class NegotiationUtils {
                 store = new MemoryTokenStore();
                 endpoint.getEndpointInfo().setProperty(TokenStore.class.getName(), store);
             }
-            endpoint = STSUtils.createSTSEndpoint(bus, 
-                    namespace,
-                    endpoint.getEndpointInfo().getTransportId(),
-                    destination.getAddress().getAddress().getValue(),
-                    message.getVersion().getBindingId(), 
-                    policy,
-                    null);
+            if (secConv) {
+                endpoint = STSUtils.createSCEndpoint(bus, 
+                                                     namespace,
+                                                     endpoint.getEndpointInfo().getTransportId(),
+                                                     destination.getAddress().getAddress().getValue(),
+                                                     message.getVersion().getBindingId(),

+                                                     policy);
+            } else {
+                endpoint = STSUtils.createSTSEndpoint(bus, 
+                                                      namespace,
+                                                      endpoint.getEndpointInfo().getTransportId(),
+                                                      destination.getAddress().getAddress().getValue(),
+                                                      message.getVersion().getBindingId(),

+                                                      policy,
+                                                      null);
+            } 
             endpoint.getEndpointInfo().setProperty(TokenStore.class.getName(), store);
             message.getExchange().put(TokenStore.class.getName(), store);
 

Modified: cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java?rev=1368178&r1=1368177&r2=1368178&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
Wed Aug  1 18:30:19 2012
@@ -180,7 +180,9 @@ class SecureConversationInInterceptor ex
                 if (s.startsWith(STSUtils.WST_NS_05_02)) {
                     ns = STSUtils.WST_NS_05_02;
                 }
-                NegotiationUtils.recalcEffectivePolicy(message, ns, pol, new SecureConversationSTSInvoker());
+                NegotiationUtils.recalcEffectivePolicy(message, ns, pol, 
+                                                       new SecureConversationSTSInvoker(),
+                                                       true);
             } else {
                 message.getInterceptorChain().add(SecureConversationTokenFinderInterceptor.INSTANCE);
             }

Modified: cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SpnegoContextTokenInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SpnegoContextTokenInInterceptor.java?rev=1368178&r1=1368177&r2=1368178&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SpnegoContextTokenInInterceptor.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SpnegoContextTokenInInterceptor.java
Wed Aug  1 18:30:19 2012
@@ -108,7 +108,7 @@ class SpnegoContextTokenInInterceptor ex
                 if (s.startsWith(STSUtils.WST_NS_05_02)) {
                     ns = STSUtils.WST_NS_05_02;
                 }
-                NegotiationUtils.recalcEffectivePolicy(message, ns, p, new SpnegoSTSInvoker());
+                NegotiationUtils.recalcEffectivePolicy(message, ns, p, new SpnegoSTSInvoker(),
false);
             } else {
                 message.getInterceptorChain().add(SpnegoContextTokenFinderInterceptor.INSTANCE);
             }

Modified: cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java?rev=1368178&r1=1368177&r2=1368178&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java
Wed Aug  1 18:30:19 2012
@@ -96,7 +96,6 @@ public final class STSUtils {
         }
         return client;
     }
-    
     public static Endpoint createSTSEndpoint(Bus bus, 
                                              String namespace,
                                              String transportId,
@@ -104,11 +103,34 @@ public final class STSUtils {
                                              String soapVersion,
                                              Policy policy,
                                              QName epName) throws BusException, EndpointException
{
+        return createSTSEndpoint(bus, namespace, transportId, location, soapVersion, policy,
epName, false);
+    }     
+    public static Endpoint createSCEndpoint(Bus bus, 
+                                             String namespace,
+                                             String transportId,
+                                             String location,
+                                             String soapVersion,
+                                             Policy policy) throws BusException, EndpointException
{
+        return createSTSEndpoint(bus, namespace, transportId, location, soapVersion, policy,
null, true);
+    }     
+    
+    
+    //CHECKSTYLE:OFF
+    private static Endpoint createSTSEndpoint(Bus bus, 
+                                             String namespace,
+                                             String transportId,
+                                             String location,
+                                             String soapVersion,
+                                             Policy policy,
+                                             QName epName,
+                                             boolean sc) throws BusException, EndpointException
{
+        //CHECKSTYLE:ON
+
         Service service = null;
         String ns = namespace + "/wsdl";
         ServiceInfo si = new ServiceInfo();
         
-        QName iName = new QName(ns, "SecurityTokenService");
+        QName iName = new QName(ns, sc ? "SecureConversationTokenService" : "SecurityTokenService");
         si.setName(iName);
         InterfaceInfo ii = new InterfaceInfo(si, iName);
         
@@ -143,7 +165,7 @@ public final class STSUtils {
             soi = new SoapOperationInfo();
             boi.addExtensor(soi);
         }
-        soi.setAction(namespace + "/RST/Issue");
+        soi.setAction(namespace + (sc ? "/RST/SCT" : "/RST/Issue"));
         
         boi = bi.getOperation(coi);
         soi = boi.getExtensor(SoapOperationInfo.class);



Mime
View raw message