cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r745583 - in /cxf/trunk: api/src/main/java/org/apache/cxf/ws/policy/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/ rt/ws/security/src/main/java/org/apache/cxf/ws/securi...
Date Wed, 18 Feb 2009 17:42:33 GMT
Author: dkulp
Date: Wed Feb 18 17:42:32 2009
New Revision: 745583

URL: http://svn.apache.org/viewvc?rev=745583&view=rev
Log:
Update sub-policy parsing to account for other policy namespaces

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyConstants.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/SPConstants.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/HttpsTokenBuilder.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/KeyValueTokenBuilder.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/LayoutBuilder.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SecurityContextTokenBuilder.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/Trust13Builder.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/UsernameTokenBuilder.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS10Builder.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS11Builder.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/AlgorithmSuite.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyConstants.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyConstants.java?rev=745583&r1=745582&r2=745583&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyConstants.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyConstants.java Wed Feb 18 17:42:32
2009
@@ -30,6 +30,7 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
 
 import org.apache.cxf.helpers.DOMUtils;
 
@@ -137,6 +138,17 @@
         return null;
     }
 
+    public static Element findPolicyElement(Element parent) {
+        Node nd = parent.getFirstChild();
+        while (nd != null) {
+            if (POLICY_ELEM_NAME.equals(nd.getLocalName())
+                && SUPPORTED_NAMESPACES.contains(nd.getNamespaceURI())) {
+                return (Element)nd;
+            }
+            nd = nd.getNextSibling();
+        }
+        return null;
+    }
     public static boolean isOptionalAttribute(QName qn) {
         return OPTIONAL_ATTR_NAME.equals(qn.getLocalPart())
             && SUPPORTED_NAMESPACES.contains(qn.getNamespaceURI());

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java?rev=745583&r1=745582&r2=745583&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java Wed Feb
18 17:42:32 2009
@@ -21,6 +21,7 @@
 
 import java.security.AccessController;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.Executor;
@@ -186,6 +187,9 @@
         if (server != null) {
             return server.getEndpoint();
         }
+        if (properties == null) {
+            properties = new HashMap<String, Object>();
+        }
         return properties;
     }
 

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/SPConstants.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/SPConstants.java?rev=745583&r1=745582&r2=745583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/SPConstants.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/SPConstants.java
Wed Feb 18 17:42:32 2009
@@ -341,7 +341,7 @@
     
     public static final String MUST_SUPPORT_REF_THUMBPRINT = "MustSupportRefThumbprint";
     
-    public static final String MUST_SUPPORT_REF_ENCRYPTED_KEY = "MustSupportRefEncryptedkey";
+    public static final String MUST_SUPPORT_REF_ENCRYPTED_KEY = "MustSupportRefEncryptedKey";
     
     ////////////////////////////////////////////////////////////////////////////////////////////////
     

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/HttpsTokenBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/HttpsTokenBuilder.java?rev=745583&r1=745582&r2=745583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/HttpsTokenBuilder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/HttpsTokenBuilder.java
Wed Feb 18 17:42:32 2009
@@ -29,6 +29,7 @@
 import org.apache.cxf.ws.policy.AssertionBuilder;
 import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyBuilder;
+import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.policy.SP11Constants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
 import org.apache.cxf.ws.security.policy.SPConstants;
@@ -75,7 +76,7 @@
                 httpsToken.setRequireClientCertificate("true".equals(attr));
             }
         } else if (consts.getVersion() == SPConstants.Version.SP_V11) {
-            Element polEl = DOMUtils.getFirstChildWithName(element, SPConstants.POLICY);
+            Element polEl = PolicyConstants.findPolicyElement(element);
              
             if (polEl != null) {
                 Element child = DOMUtils.getFirstElement(polEl);

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/KeyValueTokenBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/KeyValueTokenBuilder.java?rev=745583&r1=745582&r2=745583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/KeyValueTokenBuilder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/KeyValueTokenBuilder.java
Wed Feb 18 17:42:32 2009
@@ -28,6 +28,7 @@
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.ws.policy.AssertionBuilder;
 import org.apache.cxf.ws.policy.PolicyAssertion;
+import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.policy.SP11Constants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
 import org.apache.cxf.ws.security.policy.SPConstants;
@@ -53,7 +54,7 @@
             token.setInclusion(consts.getInclusionFromAttributeValue(attribute));
         }
 
-        Element polEl = DOMUtils.getFirstChildWithName(element, SPConstants.POLICY);
+        Element polEl = PolicyConstants.findPolicyElement(element);
         if (polEl != null) {
             Element child = DOMUtils.getFirstElement(polEl);
             if (child != null) {

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/LayoutBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/LayoutBuilder.java?rev=745583&r1=745582&r2=745583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/LayoutBuilder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/LayoutBuilder.java
Wed Feb 18 17:42:32 2009
@@ -29,6 +29,7 @@
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.ws.policy.AssertionBuilder;
 import org.apache.cxf.ws.policy.PolicyAssertion;
+import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.policy.SP11Constants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
 import org.apache.cxf.ws.security.policy.SPConstants;
@@ -58,7 +59,7 @@
     }
 
     public void processAlternative(Element element, Layout parent, SPConstants consts) {
-        Element polEl = DOMUtils.getFirstChildWithName(element, SPConstants.POLICY);
+        Element polEl = PolicyConstants.findPolicyElement(element);
         if (polEl != null) {
             Element child = DOMUtils.getFirstElement(polEl);
             if (child != null) {

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SecurityContextTokenBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SecurityContextTokenBuilder.java?rev=745583&r1=745582&r2=745583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SecurityContextTokenBuilder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SecurityContextTokenBuilder.java
Wed Feb 18 17:42:32 2009
@@ -28,6 +28,7 @@
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.ws.policy.AssertionBuilder;
 import org.apache.cxf.ws.policy.PolicyAssertion;
+import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.policy.SP11Constants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
 import org.apache.cxf.ws.security.policy.SPConstants;
@@ -56,7 +57,7 @@
             contextToken.setInclusion(consts.getInclusionFromAttributeValue(includeAttr));
         }
 
-        element = DOMUtils.getFirstChildWithName(element, SPConstants.POLICY);
+        element = PolicyConstants.findPolicyElement(element);
 
         if (element != null) {
 

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/Trust13Builder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/Trust13Builder.java?rev=745583&r1=745582&r2=745583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/Trust13Builder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/Trust13Builder.java
Wed Feb 18 17:42:32 2009
@@ -28,15 +28,15 @@
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.ws.policy.AssertionBuilder;
 import org.apache.cxf.ws.policy.PolicyAssertion;
+import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
-import org.apache.cxf.ws.security.policy.SPConstants;
 import org.apache.cxf.ws.security.policy.model.Trust13;
 
 
 public class Trust13Builder implements AssertionBuilder {
 
     public PolicyAssertion build(Element element) {
-        element = DOMUtils.getFirstChildWithName(element, SPConstants.POLICY);
+        element = PolicyConstants.findPolicyElement(element);
 
         if (element == null) {
             throw new IllegalArgumentException(

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/UsernameTokenBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/UsernameTokenBuilder.java?rev=745583&r1=745582&r2=745583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/UsernameTokenBuilder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/UsernameTokenBuilder.java
Wed Feb 18 17:42:32 2009
@@ -29,6 +29,7 @@
 import org.apache.cxf.ws.policy.AssertionBuilder;
 import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyBuilder;
+import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.policy.SP11Constants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
 import org.apache.cxf.ws.security.policy.SPConstants;
@@ -56,7 +57,7 @@
             usernameToken.setInclusion(consts.getInclusionFromAttributeValue(attribute));
         }
 
-        Element polEl = DOMUtils.getFirstChildWithName(element, SPConstants.POLICY);
+        Element polEl = PolicyConstants.findPolicyElement(element);
         if (polEl != null) {
             Element child = DOMUtils.getFirstElement(polEl);
             if (child != null) {

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS10Builder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS10Builder.java?rev=745583&r1=745582&r2=745583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS10Builder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS10Builder.java
Wed Feb 18 17:42:32 2009
@@ -28,6 +28,7 @@
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.ws.policy.AssertionBuilder;
 import org.apache.cxf.ws.policy.PolicyAssertion;
+import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.policy.SP11Constants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
 import org.apache.cxf.ws.security.policy.SPConstants;
@@ -56,7 +57,7 @@
     }
 
     private void processAlternative(Element element, Wss10 parent, SPConstants consts) {
-        Element polEl = DOMUtils.getFirstChildWithName(element, SPConstants.POLICY);
+        Element polEl = PolicyConstants.findPolicyElement(element);
         if (polEl != null) {
             Element child = DOMUtils.getFirstElement(polEl);
             while (child != null) {

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS11Builder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS11Builder.java?rev=745583&r1=745582&r2=745583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS11Builder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS11Builder.java
Wed Feb 18 17:42:32 2009
@@ -28,6 +28,7 @@
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.ws.policy.AssertionBuilder;
 import org.apache.cxf.ws.policy.PolicyAssertion;
+import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.policy.SP11Constants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
 import org.apache.cxf.ws.security.policy.SPConstants;
@@ -55,7 +56,7 @@
         return KNOWN_ELEMENTS;
     }
     private void processAlternative(Element element, Wss11 parent, SPConstants consts) {
-        Element polEl = DOMUtils.getFirstChildWithName(element, SPConstants.POLICY);
+        Element polEl = PolicyConstants.findPolicyElement(element);
         if (polEl != null) {
             Element child = DOMUtils.getFirstElement(polEl);
             while (child != null) {

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/AlgorithmSuite.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/AlgorithmSuite.java?rev=745583&r1=745582&r2=745583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/AlgorithmSuite.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/AlgorithmSuite.java
Wed Feb 18 17:42:32 2009
@@ -257,7 +257,8 @@
         writer.writeNamespace(prefix, namespaceURI);
 
         // <wsp:Policy>
-        writer.writeStartElement(SPConstants.POLICY.getPrefix(), SPConstants.POLICY.getLocalPart(),
+        writer.writeStartElement(SPConstants.POLICY.getPrefix(),
+                                 SPConstants.POLICY.getLocalPart(),
                                  SPConstants.POLICY.getNamespaceURI());
 
         //



Mime
View raw message