ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1609062 - /webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/
Date Wed, 09 Jul 2014 09:27:32 GMT
Author: coheigea
Date: Wed Jul  9 09:27:31 2014
New Revision: 1609062

URL: http://svn.apache.org/r1609062
Log:
Only store an Id if it is non-empty

Modified:
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/BinarySecurityTokenProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/DerivedKeyTokenProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedDataProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.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/processor/SAMLTokenProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SecurityContextTokenProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureConfirmationProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/TimestampProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/BinarySecurityTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/BinarySecurityTokenProcessor.java?rev=1609062&r1=1609061&r2=1609062&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/BinarySecurityTokenProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/BinarySecurityTokenProcessor.java
Wed Jul  9 09:27:31 2014
@@ -81,7 +81,9 @@ public class BinarySecurityTokenProcesso
         WSSecurityEngineResult result = 
             new WSSecurityEngineResult(WSConstants.BST, token, certs);
         wsDocInfo.addTokenElement(elem);
-        result.put(WSSecurityEngineResult.TAG_ID, id);
+        if (!"".equals(id)) {
+            result.put(WSSecurityEngineResult.TAG_ID, id);
+        }
         
         if (validator != null) {
             // Hook to allow the user to validate the BinarySecurityToken

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/DerivedKeyTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/DerivedKeyTokenProcessor.java?rev=1609062&r1=1609061&r2=1609062&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/DerivedKeyTokenProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/DerivedKeyTokenProcessor.java
Wed Jul  9 09:27:31 2014
@@ -22,7 +22,6 @@ package org.apache.wss4j.dom.processor;
 import java.util.List;
 
 import org.w3c.dom.Element;
-
 import org.apache.wss4j.dom.WSConstants;
 import org.apache.wss4j.dom.WSDocInfo;
 import org.apache.wss4j.dom.WSSecurityEngineResult;
@@ -78,7 +77,10 @@ public class DerivedKeyTokenProcessor im
         WSSecurityEngineResult result =
             new WSSecurityEngineResult(WSConstants.DKT, null, keyBytes, null);
         wsDocInfo.addTokenElement(elem);
-        result.put(WSSecurityEngineResult.TAG_ID, dkt.getID());
+        String tokenId = dkt.getID();
+        if (!"".equals(tokenId)) {
+            result.put(WSSecurityEngineResult.TAG_ID, tokenId);
+        }
         result.put(WSSecurityEngineResult.TAG_DERIVED_KEY_TOKEN, dkt);
         result.put(WSSecurityEngineResult.TAG_SECRET, secret);
         result.put(WSSecurityEngineResult.TAG_TOKEN_ELEMENT, dkt.getElement());

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedDataProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedDataProcessor.java?rev=1609062&r1=1609061&r2=1609062&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedDataProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedDataProcessor.java
Wed Jul  9 09:27:31 2014
@@ -144,7 +144,9 @@ public class EncryptedDataProcessor impl
 
         WSSecurityEngineResult result =
                 new WSSecurityEngineResult(WSConstants.ENCR, Collections.singletonList(dataRef));
-        result.put(WSSecurityEngineResult.TAG_ID, encryptedDataId);
+        if (!"".equals(encryptedDataId)) {
+            result.put(WSSecurityEngineResult.TAG_ID, encryptedDataId);
+        }
         wsDocInfo.addResult(result);
         wsDocInfo.addTokenElement(elem);
         

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java?rev=1609062&r1=1609061&r2=1609062&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java
Wed Jul  9 09:27:31 2014
@@ -222,7 +222,10 @@ public class EncryptedKeyProcessor imple
             WSSecurityEngineResult.TAG_ENCRYPTED_KEY_TRANSPORT_METHOD, 
             encryptedKeyTransportMethod
         );
-        result.put(WSSecurityEngineResult.TAG_ID, elem.getAttributeNS(null, "Id"));
+        String tokenId = elem.getAttributeNS(null, "Id");
+        if (!"".equals(tokenId)) {
+            result.put(WSSecurityEngineResult.TAG_ID, tokenId);
+        }
         result.put(WSSecurityEngineResult.TAG_X509_REFERENCE_TYPE, strParser.getCertificatesReferenceType());
         wsDocInfo.addResult(result);
         wsDocInfo.addTokenElement(elem);

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=1609062&r1=1609061&r2=1609062&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
Wed Jul  9 09:27:31 2014
@@ -80,7 +80,10 @@ public class ReferenceListProcessor impl
         List<WSDataRef> dataRefs = handleReferenceList(elem, data, wsDocInfo);
         WSSecurityEngineResult result = 
             new WSSecurityEngineResult(WSConstants.ENCR, dataRefs);
-        result.put(WSSecurityEngineResult.TAG_ID, elem.getAttributeNS(null, "Id"));
+        String tokenId = elem.getAttributeNS(null, "Id");
+        if (!"".equals(tokenId)) {
+            result.put(WSSecurityEngineResult.TAG_ID, tokenId);
+        }
         wsDocInfo.addTokenElement(elem);
         wsDocInfo.addResult(result);
         return java.util.Collections.singletonList(result);

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java?rev=1609062&r1=1609061&r2=1609062&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java
Wed Jul  9 09:27:31 2014
@@ -103,7 +103,9 @@ public class SAMLTokenProcessor implemen
             result = new WSSecurityEngineResult(WSConstants.ST_UNSIGNED, samlAssertion);
         }
         
-        result.put(WSSecurityEngineResult.TAG_ID, samlAssertion.getId());
+        if (!"".equals(id)) {
+            result.put(WSSecurityEngineResult.TAG_ID, id);
+        }
 
         if (validator != null) {
             result.put(WSSecurityEngineResult.TAG_VALIDATED_TOKEN, Boolean.TRUE);

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SecurityContextTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SecurityContextTokenProcessor.java?rev=1609062&r1=1609061&r2=1609062&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SecurityContextTokenProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SecurityContextTokenProcessor.java
Wed Jul  9 09:27:31 2014
@@ -62,7 +62,10 @@ public class SecurityContextTokenProcess
             
             Credential returnedCredential = validator.validate(credential, data);
             result.put(WSSecurityEngineResult.TAG_VALIDATED_TOKEN, Boolean.TRUE);
-            result.put(WSSecurityEngineResult.TAG_ID, sct.getID());
+            String tokenId = sct.getID();
+            if (!"".equals(tokenId)) {
+                result.put(WSSecurityEngineResult.TAG_ID, tokenId);
+            }
             result.put(WSSecurityEngineResult.TAG_SECRET, returnedCredential.getSecretKey());
         } else {
             String id = sct.getID();

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureConfirmationProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureConfirmationProcessor.java?rev=1609062&r1=1609061&r2=1609062&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureConfirmationProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureConfirmationProcessor.java
Wed Jul  9 09:27:31 2014
@@ -48,7 +48,10 @@ public class SignatureConfirmationProces
 
         WSSecurityEngineResult result = 
             new WSSecurityEngineResult(WSConstants.SC, sigConf);
-        result.put(WSSecurityEngineResult.TAG_ID, sigConf.getID());
+        String tokenId = sigConf.getID();
+        if (!"".equals(tokenId)) {
+            result.put(WSSecurityEngineResult.TAG_ID, tokenId);
+        }
         wsDocInfo.addResult(result);
         wsDocInfo.addTokenElement(elem);
         return java.util.Collections.singletonList(result);

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java?rev=1609062&r1=1609061&r2=1609062&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java
Wed Jul  9 09:27:31 2014
@@ -252,7 +252,10 @@ public class SignatureProcessor implemen
                 certs, dataRefs, signatureValue);
         result.put(WSSecurityEngineResult.TAG_SIGNATURE_METHOD, signatureMethod);
         result.put(WSSecurityEngineResult.TAG_CANONICALIZATION_METHOD, c14nMethod);
-        result.put(WSSecurityEngineResult.TAG_ID, elem.getAttributeNS(null, "Id"));
+        String tokenId = elem.getAttributeNS(null, "Id");
+        if (!"".equals(tokenId)) {
+            result.put(WSSecurityEngineResult.TAG_ID, tokenId);
+        }
         result.put(WSSecurityEngineResult.TAG_SECRET, secretKey);
         result.put(WSSecurityEngineResult.TAG_PUBLIC_KEY, publicKey);
         result.put(WSSecurityEngineResult.TAG_X509_REFERENCE_TYPE, referenceType);

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/TimestampProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/TimestampProcessor.java?rev=1609062&r1=1609061&r2=1609062&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/TimestampProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/TimestampProcessor.java
Wed Jul  9 09:27:31 2014
@@ -53,7 +53,10 @@ public class TimestampProcessor implemen
         
         WSSecurityEngineResult result = 
             new WSSecurityEngineResult(WSConstants.TS, timestamp);
-        result.put(WSSecurityEngineResult.TAG_ID, timestamp.getID());
+        String tokenId = timestamp.getID();
+        if (!"".equals(tokenId)) {
+            result.put(WSSecurityEngineResult.TAG_ID, tokenId);
+        }
         
         Validator validator = data.getValidator(WSSecurityEngine.TIMESTAMP);
         if (validator != null) {

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java?rev=1609062&r1=1609061&r2=1609062&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java
Wed Jul  9 09:27:31 2014
@@ -79,7 +79,10 @@ public class UsernameTokenProcessor impl
             } 
         }
         WSSecurityEngineResult result = new WSSecurityEngineResult(action, token);
-        result.put(WSSecurityEngineResult.TAG_ID, token.getID());
+        String tokenId = token.getID();
+        if (!"".equals(tokenId)) {
+            result.put(WSSecurityEngineResult.TAG_ID, tokenId);
+        }
         result.put(WSSecurityEngineResult.TAG_SECRET, secretKey);
         
         if (validator != null) {



Mime
View raw message