cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1428302 - in /cxf/branches/2.5.x-fixes/services/sts: sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/cxf-service.xml
Date Thu, 03 Jan 2013 11:46:17 GMT
Author: coheigea
Date: Thu Jan  3 11:46:16 2013
New Revision: 1428302

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

........
  r1428300 | coheigea | 2013-01-03 11:39:22 +0000 (Thu, 03 Jan 2013) | 10 lines

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

  ........
    r1428285 | coheigea | 2013-01-03 11:20:30 +0000 (Thu, 03 Jan 2013) | 2 lines

    [CXF-4728] - STS KeyIdentifier AttachedReference shouldn't use a URI fragment

  ........

........

Modified:
    cxf/branches/2.5.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
    cxf/branches/2.5.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/cxf-service.xml

Modified: cxf/branches/2.5.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java?rev=1428302&r1=1428301&r2=1428302&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
(original)
+++ cxf/branches/2.5.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
Thu Jan  3 11:46:16 2013
@@ -185,14 +185,6 @@ public abstract class AbstractOperation 
         SecurityTokenReferenceType securityTokenReferenceType = 
             QNameConstants.WSSE_FACTORY.createSecurityTokenReferenceType();
         
-        // Create the identifier according to whether it is an attached reference or not
-        String identifier = tokenReference.getIdentifier();
-        if (attached && identifier.charAt(0) != '#') {
-            identifier = "#" + identifier;
-        } else if (!attached && identifier.charAt(0) == '#') {
-            identifier = identifier.substring(1);
-        }
-        
         // TokenType
         String tokenType = tokenReference.getWsse11TokenType();
         if (tokenType != null) {
@@ -200,6 +192,11 @@ public abstract class AbstractOperation 
         }
         
         if (tokenReference.isUseKeyIdentifier()) {
+            String identifier = tokenReference.getIdentifier();
+            if (identifier.charAt(0) == '#') {
+                identifier = identifier.substring(1);
+            }
+            
             KeyIdentifierType keyIdentifierType = 
                 QNameConstants.WSSE_FACTORY.createKeyIdentifierType();
             keyIdentifierType.setValue(identifier);
@@ -211,6 +208,13 @@ public abstract class AbstractOperation 
                 QNameConstants.WSSE_FACTORY.createKeyIdentifier(keyIdentifierType);
             securityTokenReferenceType.getAny().add(keyIdentifier);
         } else if (tokenReference.isUseDirectReference()) {
+            String identifier = tokenReference.getIdentifier();
+            if (attached && identifier.charAt(0) != '#') {
+                identifier = "#" + identifier;
+            } else if (!attached && identifier.charAt(0) == '#') {
+                identifier = identifier.substring(1);
+            }
+            
             ReferenceType referenceType = QNameConstants.WSSE_FACTORY.createReferenceType();
             referenceType.setURI(identifier);
             

Modified: cxf/branches/2.5.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/cxf-service.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/cxf-service.xml?rev=1428302&r1=1428301&r2=1428302&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/cxf-service.xml
(original)
+++ cxf/branches/2.5.x-fixes/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/cxf-service.xml
Thu Jan  3 11:46:16 2013
@@ -52,6 +52,7 @@
          <entry key="ws-security.callback-handler" 
                 value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
          <entry key="ws-security.signature.properties" value="serviceKeystore.properties"/>
+         <entry key="ws-security.is-bsp-compliant" value="false"/>
       </jaxws:properties> 
    </jaxws:endpoint>
    



Mime
View raw message