You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2018/01/22 10:51:48 UTC

[cxf] branch master updated: CXF-7619 - Support deprecated 1.5 WS-Policy URI in the STS

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new f7adbdf  CXF-7619 - Support deprecated 1.5 WS-Policy URI in the STS
f7adbdf is described below

commit f7adbdf31b0dd956d11b033acfd5e8fd109a48c5
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Mon Jan 22 10:51:29 2018 +0000

    CXF-7619 - Support deprecated 1.5 WS-Policy URI in the STS
---
 .../sts/sts-core/src/main/java/org/apache/cxf/sts/STSConstants.java  | 5 +++++
 .../src/main/java/org/apache/cxf/sts/request/RequestParser.java      | 3 ++-
 .../java/org/apache/cxf/sts/token/provider/TokenProviderUtils.java   | 5 +++--
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSConstants.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSConstants.java
index 489c074..2366679 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSConstants.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSConstants.java
@@ -73,6 +73,11 @@ public final class STSConstants {
     public static final String WSP_NS_04 = "http://schemas.xmlsoap.org/ws/2004/09/policy";
 
     /**
+     * WS-Policy 2006 namespace (deprecated)
+     */
+    public static final String WSP_NS_06 = "http://www.w3.org/2006/07/ws-policy";
+
+    /**
      * WS-Addressing 2005 namespace
      */
     public static final String WSA_NS_05 = "http://www.w3.org/2005/08/addressing";
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
index bf794e2..1ba65ab 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
@@ -148,7 +148,8 @@ public class RequestParser {
                     parseSecondaryParameters(element, claimsParsers, tokenRequirements, keyRequirements);
                 } else if ("AppliesTo".equals(element.getLocalName())
                     && (STSConstants.WSP_NS.equals(element.getNamespaceURI())
-                        || STSConstants.WSP_NS_04.equals(element.getNamespaceURI()))) {
+                        || STSConstants.WSP_NS_04.equals(element.getNamespaceURI())
+                        || STSConstants.WSP_NS_06.equals(element.getNamespaceURI()))) {
                     tokenRequirements.setAppliesTo(element);
                     LOG.fine("Found AppliesTo element");
                 } else if (allowCustomContent) {
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/TokenProviderUtils.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/TokenProviderUtils.java
index f96e156..b4cb1a7 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/TokenProviderUtils.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/TokenProviderUtils.java
@@ -76,7 +76,8 @@ public final class TokenProviderUtils {
                     LOG.fine("Found address element");
                     return address.getTextContent();
                 }
-            } else if ((STSConstants.WSP_NS.equals(namespace) || STSConstants.WSP_NS_04.equals(namespace))
+            } else if ((STSConstants.WSP_NS.equals(namespace) || STSConstants.WSP_NS_04.equals(namespace)
+                || STSConstants.WSP_NS_06.equals(namespace))
                 && "URI".equals(localName)) {
                 return ((Element)participants).getTextContent();
             }
@@ -172,7 +173,7 @@ public final class TokenProviderUtils {
 
         builder.prepare(stsProperties.getEncryptionCrypto());
         builder.encryptForRef(null, Collections.singletonList(encryptionPart));
-        
+
         return (Element)frag.getFirstChild();
     }
 

-- 
To stop receiving notification emails like this one, please contact
coheigea@apache.org.