You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2009/07/08 21:13:58 UTC

svn commit: r792271 - in /cxf/trunk: rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java systests/src/test/resources/wsdl_systest/DoubleIt.wsdl

Author: dkulp
Date: Wed Jul  8 19:13:58 2009
New Revision: 792271

URL: http://svn.apache.org/viewvc?rev=792271&view=rev
Log:
[CXF-2333] Add test (and fix) for the SignedElements token

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
    cxf/trunk/systests/src/test/resources/wsdl_systest/DoubleIt.wsdl

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java?rev=792271&r1=792270&r2=792271&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java Wed Jul  8 19:13:58 2009
@@ -333,6 +333,17 @@
                                     }
                                 }
                             }
+                            if (!found && "signed".equals(type)) {
+                                for (int x = 0; x < list.getLength(); x++) {
+                                    Element el = (Element)list.item(x);
+                                    for (WSDataRef r : refs) {
+                                        if (r.getName().equals(new QName(el.getNamespaceURI(),
+                                                                     el.getLocalName()))) {
+                                            found = true;
+                                        }
+                                    }
+                                }
+                            }
                             if (!found) {
                                 ai.setNotAsserted("No " + type 
                                                   + " element found matching XPath " + expression);

Modified: cxf/trunk/systests/src/test/resources/wsdl_systest/DoubleIt.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/resources/wsdl_systest/DoubleIt.wsdl?rev=792271&r1=792270&r2=792271&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/resources/wsdl_systest/DoubleIt.wsdl (original)
+++ cxf/trunk/systests/src/test/resources/wsdl_systest/DoubleIt.wsdl Wed Jul  8 19:13:58 2009
@@ -392,6 +392,10 @@
 					xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
 					<sp:XPath xmlns:example1="http://cxf.apache.org/policytest/DoubleIt">//example1:DoubleIt/numberToDouble</sp:XPath>
 				</sp:EncryptedElements>
+				<sp:SignedElements
+					xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+					<sp:XPath xmlns:example1="http://cxf.apache.org/policytest/DoubleIt">//example1:DoubleIt/numberToDouble</sp:XPath>
+				</sp:SignedElements>
 				<sp:RequiredElements
 					xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
 					<sp:XPath xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">wsse:Security</sp:XPath>