ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1829289 - in /webservices/wss4j/trunk: ./ ws-security-dom/src/main/java/org/apache/wss4j/dom/util/ ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/
Date Mon, 16 Apr 2018 14:36:21 GMT
Author: coheigea
Date: Mon Apr 16 14:36:21 2018
New Revision: 1829289

URL: http://svn.apache.org/viewvc?rev=1829289&view=rev
Log:
WSS-627 - Java 10 SAAJ support

Modified:
    webservices/wss4j/trunk/pom.xml
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenActionTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SignedSamlTokenHOKTest.java

Modified: webservices/wss4j/trunk/pom.xml
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/pom.xml?rev=1829289&r1=1829288&r2=1829289&view=diff
==============================================================================
--- webservices/wss4j/trunk/pom.xml (original)
+++ webservices/wss4j/trunk/pom.xml Mon Apr 16 14:36:21 2018
@@ -394,9 +394,9 @@
             </build>
          </profile>
          <profile>
-            <id>jdk19</id>
+            <id>jdk19-plus</id>
             <activation>
-                <jdk>9</jdk>
+                <jdk>[9,)</jdk>
             </activation>
             <build>
                 <pluginManagement>

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=1829289&r1=1829288&r2=1829289&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 Apr 16 14:36:21 2018
@@ -65,15 +65,15 @@ import javax.security.auth.callback.Unsu
  * WS-Security Utility methods. <p/>
  */
 public final class WSSecurityUtil {
-    
+
     private static boolean isJava9SAAJ = false;
-        
+
     private static final org.slf4j.Logger LOG =
         org.slf4j.LoggerFactory.getLogger(WSSecurityUtil.class);
-    
+
     static {
-        if (System.getProperty("java.version").startsWith("9")) {
-            
+        if (System.getProperty("java.version").startsWith("9") || System.getProperty("java.version").startsWith("10"))
{
+
             try {
                 Method[] methods = WSSecurityUtil.class.getClassLoader().
                     loadClass("com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl").getMethods();
@@ -93,8 +93,8 @@ public final class WSSecurityUtil {
     private WSSecurityUtil() {
         // Complete
     }
-    
-    
+
+
     public static Element getSOAPHeader(Document doc) {
         String soapNamespace = WSSecurityUtil.getSOAPNamespace(doc.getDocumentElement());
         return
@@ -288,8 +288,8 @@ public final class WSSecurityUtil {
         String nsUri = parent.getNamespaceURI();
         return parent.getOwnerDocument().createElementNS(nsUri, qName);
     }
-    
-    
+
+
 
 
     /**
@@ -376,12 +376,12 @@ public final class WSSecurityUtil {
                         doc.importNode(header, true);
                         header = (Element)getDomElement(header);
                         header = prependChildElement(envelope, header);
-                        
+
                     } catch (Exception e) {
                         e.printStackTrace();
                         throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY);
                     }
-                    
+
                 } else {
                     header = createElementInSameNamespace(envelope, WSConstants.ELEM_HEADER);
                     header = prependChildElement(envelope, header);
@@ -431,7 +431,7 @@ public final class WSSecurityUtil {
             foundSecurityHeader.setAttributeNS(WSConstants.XMLNS_NS, "xmlns:wsse", WSConstants.WSSE_NS);
             doc.importNode(foundSecurityHeader, true);
             foundSecurityHeader = (Element)getDomElement(foundSecurityHeader);
-            
+
             return prependChildElement(header, foundSecurityHeader);
         }
         return null;
@@ -607,12 +607,12 @@ public final class WSSecurityUtil {
             }
         }
     }
-    
+
     /**
      * Register the javax.xml.soap.Node with new Cloned Dom Node with java9
      * @param doc The SOAPDocumentImpl
      * @param clonedElement The cloned Element
-     * @return new clonedElement which already associated with the SAAJ Node 
+     * @return new clonedElement which already associated with the SAAJ Node
      * @throws WSSecurityException
      */
     public static Element cloneElement(Document doc, Element clonedElement) throws WSSecurityException
{
@@ -624,16 +624,16 @@ public final class WSSecurityUtil {
         }
         return clonedElement;
     }
-    
+
     /**
-     * Try to get the DOM Node from the SAAJ Node with JAVA9 
+     * Try to get the DOM Node from the SAAJ Node with JAVA9
      * @param node The original node we need check
      * @return The DOM node
      * @throws WSSecurityException
      */
     private static Node getDomElement(Node node) throws WSSecurityException {
         if (node != null && isJava9SAAJ) {
-            
+
             try {
                 Method method = node.getClass().getMethod("getDomElement");
                 node = (Node)method.invoke(node);

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenActionTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenActionTest.java?rev=1829289&r1=1829288&r2=1829289&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenActionTest.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenActionTest.java
Mon Apr 16 14:36:21 2018
@@ -138,8 +138,8 @@ public class SamlTokenActionTest extends
 
         verify(doc, callbackHandler);
     }
-    
-    
+
+
     @Test
     public void testSignedAssertionAction() throws Exception {
         final WSSConfig cfg = WSSConfig.getNewInstance();

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SignedSamlTokenHOKTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SignedSamlTokenHOKTest.java?rev=1829289&r1=1829288&r2=1829289&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SignedSamlTokenHOKTest.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SignedSamlTokenHOKTest.java
Mon Apr 16 14:36:21 2018
@@ -51,6 +51,7 @@ import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
 import javax.security.auth.callback.CallbackHandler;
+import javax.xml.crypto.XMLStructure;
 import javax.xml.crypto.dom.DOMCryptoContext;
 import javax.xml.crypto.dom.DOMStructure;
 import javax.xml.crypto.dsig.XMLSignatureFactory;
@@ -727,7 +728,7 @@ public class SignedSamlTokenHOKTest exte
 
         // KeyValue
         KeyValue keyValue = keyInfoFactory.newKeyValue(publicKey);
-        List<Object> keyInfoContent = Arrays.asList(x509Data, keyValue);
+        List<? extends XMLStructure> keyInfoContent = Arrays.asList(x509Data, keyValue);
         KeyInfo keyInfo = keyInfoFactory.newKeyInfo(keyInfoContent, null);
 
         // Marshal the KeyInfo to DOM



Mime
View raw message