cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dval...@apache.org
Subject svn commit: r979681 - in /cxf/branches/2.2.x-fixes: ./ rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java
Date Tue, 27 Jul 2010 12:51:07 GMT
Author: dvaleri
Date: Tue Jul 27 12:51:06 2010
New Revision: 979681

URL: http://svn.apache.org/viewvc?rev=979681&view=rev
Log:
Merged revisions 979457 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r979457 | dvaleri | 2010-07-26 17:43:47 -0400 (Mon, 26 Jul 2010) | 1 line
  
  [CXF-2909] Fixed usage of SecondaryParameters in WS-T 1.3+
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
    cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 27 12:51:06 2010
@@ -1 +1 @@
-/cxf/trunk:979459
+/cxf/trunk:979457,979459

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java?rev=979681&r1=979680&r2=979681&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
Tue Jul 27 12:51:06 2010
@@ -376,8 +376,14 @@ public class STSClient implements Config
         writer.writeStartElement("wst", "RequestSecurityToken", namespace);
         writer.writeNamespace("wst", namespace);
         boolean wroteKeySize = false;
+        
         String keyType = null;
+        
         if (template != null) {
+            if (this.useSecondaryParameters()) {
+                writer.writeStartElement("wst", "SecondaryParameters", namespace);
+            }
+            
             Element tl = DOMUtils.getFirstElement(template);
             while (tl != null) {
                 StaxUtils.copy(tl, writer);
@@ -389,11 +395,13 @@ public class STSClient implements Config
                 }
                 tl = DOMUtils.getNextElement(tl);
             }
+            
+            if (this.useSecondaryParameters()) {
+                writer.writeEndElement();
+            }
         }
 
-        writer.writeStartElement("wst", "RequestType", namespace);
-        writer.writeCharacters(namespace + requestType);
-        writer.writeEndElement();
+        addRequestType(requestType, writer);
         addAppliesTo(writer, appliesTo);
         keyType = writeKeyType(writer, keyType);
 
@@ -472,6 +480,12 @@ public class STSClient implements Config
         }
         return token;
     }
+
+    private void addRequestType(String requestType, W3CDOMStreamWriter writer) throws XMLStreamException
{
+        writer.writeStartElement("wst", "RequestType", namespace);
+        writer.writeCharacters(namespace + requestType);
+        writer.writeEndElement();
+    }
     
     private Element getDocumentElement(DOMSource ds) {
         Node nd = ds.getNode();
@@ -642,6 +656,10 @@ public class STSClient implements Config
             LOG.log(Level.WARNING, "Problem cancelling token", ex);
         }
     }
+    
+    private boolean useSecondaryParameters() {
+        return !STSUtils.WST_NS_05_02.equals(namespace);
+    }
 
     private String writeKeyType(W3CDOMStreamWriter writer, String keyType) throws XMLStreamException
{
         if (isSecureConv) {

Modified: cxf/branches/2.2.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.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java?rev=979681&r1=979680&r2=979681&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java
Tue Jul 27 12:51:06 2010
@@ -48,9 +48,12 @@ import org.apache.neethi.Policy;
  * 
  */
 public final class STSUtils {
+    /**
+     * WS-T 1.0 Namespace.
+     */
     public static final String WST_NS_05_02 = "http://schemas.xmlsoap.org/ws/2005/02/trust";
     /**
-     * WS-T 1.3 Namespace
+     * WS-T 1.3 Namespace.
      */
     public static final String WST_NS_05_12 = "http://docs.oasis-open.org/ws-sx/ws-trust/200512";
     /**



Mime
View raw message