ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1626810 - in /webservices/wss4j/trunk: policy/src/main/java/org/apache/wss4j/policy/builders/ ws-security-dom/src/main/java/org/apache/wss4j/dom/ ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/ ws-security-dom/src/main/ja...
Date Mon, 22 Sep 2014 15:37:42 GMT
Author: coheigea
Date: Mon Sep 22 15:37:41 2014
New Revision: 1626810

URL: http://svn.apache.org/r1626810
Log:
Some namespace enabled DOM calls

Modified:
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/builders/SignedElementsBuilder.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSDocInfo.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedAssertionProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/builders/SignedElementsBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/builders/SignedElementsBuilder.java?rev=1626810&r1=1626809&r2=1626810&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/builders/SignedElementsBuilder.java
(original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/builders/SignedElementsBuilder.java
Mon Sep 22 15:37:41 2014
@@ -78,7 +78,7 @@ public class SignedElementsBuilder imple
                     && spVersion.getSPConstants().getXPath2Expression().getNamespaceURI().equals(child.getNamespaceURI()))
{
                 Map<String, String> declaredNamespaces = new HashMap<String, String>();
                 addDeclaredNamespaces(child, declaredNamespaces);
-                String filter = child.getAttribute(SPConstants.FILTER);
+                String filter = child.getAttributeNS(null, SPConstants.FILTER);
                 if (filter == null || "".equals(filter)) {
                     throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                 }
@@ -90,7 +90,7 @@ public class SignedElementsBuilder imple
     }
 
     protected String getXPathVersion(Element element) {
-        String xPathVersion = element.getAttribute(SPConstants.XPATH_VERSION);
+        String xPathVersion = element.getAttributeNS(null, SPConstants.XPATH_VERSION);
         if (xPathVersion == null || "".equals(xPathVersion)) {
             xPathVersion = "1.0";
         }

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSDocInfo.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSDocInfo.java?rev=1626810&r1=1626809&r2=1626810&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSDocInfo.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSDocInfo.java
Mon Sep 22 15:37:41 2014
@@ -157,8 +157,8 @@ public class WSDocInfo {
                 String samlId = elem.getAttributeNS(null, "AssertionID");
                 String samlId2 = elem.getAttributeNS(null, "ID");
                 if (elem.hasAttributeNS(WSConstants.WSU_NS, "Id") && id.equals(cId)
-                    || elem.hasAttribute("AssertionID") && id.equals(samlId)
-                    || elem.hasAttribute("ID") && id.equals(samlId2)) {
+                    || elem.hasAttributeNS(null, "AssertionID") && id.equals(samlId)
+                    || elem.hasAttributeNS(null, "ID") && id.equals(samlId2)) {
                     return elem;
                 }
             }

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java?rev=1626810&r1=1626809&r2=1626810&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java
Mon Sep 22 15:37:41 2014
@@ -178,7 +178,7 @@ public class UsernameToken {
         }
         
         if (elementPassword != null) {
-            if (elementPassword.hasAttribute(WSConstants.PASSWORD_TYPE_ATTR)) {
+            if (elementPassword.hasAttributeNS(null, WSConstants.PASSWORD_TYPE_ATTR)) {
                 passwordType = elementPassword.getAttributeNS(null, WSConstants.PASSWORD_TYPE_ATTR);
             } else if (elementPassword.hasAttributeNS(
                 WSConstants.WSSE_NS, WSConstants.PASSWORD_TYPE_ATTR)

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedAssertionProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedAssertionProcessor.java?rev=1626810&r1=1626809&r2=1626810&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedAssertionProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedAssertionProcessor.java
Mon Sep 22 15:37:41 2014
@@ -59,7 +59,7 @@ public class EncryptedAssertionProcessor
         }
         
         // Type must be "Element" if specified
-        String typeStr = encryptedDataElement.getAttribute("Type");
+        String typeStr = encryptedDataElement.getAttributeNS(null, "Type");
         if (typeStr != null && !(WSConstants.ENC_NS + "Element").equals(typeStr))
{
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.INVALID_SECURITY, "badElement", "Element",

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java?rev=1626810&r1=1626809&r2=1626810&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
Mon Sep 22 15:37:41 2014
@@ -323,7 +323,7 @@ public class ReferenceListProcessor impl
         dataRef.setWsuId(dataRefURI);
         dataRef.setAlgorithm(symEncAlgo);
 
-        String typeStr = encData.getAttribute("Type");
+        String typeStr = encData.getAttributeNS(null, "Type");
         if (typeStr != null &&
             (WSConstants.SWA_ATTACHMENT_ENCRYPTED_DATA_TYPE_CONTENT_ONLY.equals(typeStr)
||
             WSConstants.SWA_ATTACHMENT_ENCRYPTED_DATA_TYPE_COMPLETE.equals(typeStr))) {

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java?rev=1626810&r1=1626809&r2=1626810&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java
Mon Sep 22 15:37:41 2014
@@ -400,8 +400,8 @@ public final class WSSecurityUtil {
             // start node processing at this point
             if (startNode.getNodeType() == Node.ELEMENT_NODE) {
                 Element se = (Element) startNode;
-                if (se.hasAttribute("ID") && value.equals(se.getAttributeNS(null,
"ID"))
-                    || se.hasAttribute("AssertionID") 
+                if (se.hasAttributeNS(null, "ID") && value.equals(se.getAttributeNS(null,
"ID"))
+                    || se.hasAttributeNS(null, "AssertionID") 
                         && value.equals(se.getAttributeNS(null, "AssertionID")))
{
                     if (foundElement == null) {
                         foundElement = se; // Continue searching to find duplicates



Mime
View raw message