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 11:44:47 UTC
[cxf] 01/02: 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 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 5bb7d3b8cff7c6f4b9797465f5fe8c846e0fad2c
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
(cherry picked from commit f7adbdf31b0dd956d11b033acfd5e8fd109a48c5)
# Conflicts:
# services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/TokenProviderUtils.java
---
.../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 | 3 ++-
3 files changed, 9 insertions(+), 2 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 9336b1d..8c783ce 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 1be31c0..31da7be 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 c0794a1..1bb038e 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
@@ -74,7 +74,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();
}
--
To stop receiving notification emails like this one, please contact
coheigea@apache.org.