You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2014/05/12 14:04:16 UTC

[1/3] git commit: Adding a test-case for adding + parsing a BinarySecurityToken

Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes f6d9f8114 -> ad1c0971c


Adding a test-case for adding + parsing a BinarySecurityToken

Conflicts:
	rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/KerberosTokenInterceptor.java
	systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/DoubleItTokens.wsdl
	systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/client.xml


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/87f0669f
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/87f0669f
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/87f0669f

Branch: refs/heads/2.7.x-fixes
Commit: 87f0669f930e87a2979ed322d6aa72e36c97caed
Parents: f6d9f81
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Mon May 12 12:49:54 2014 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Mon May 12 12:50:53 2014 +0100

----------------------------------------------------------------------
 .../wss4j/BinarySecurityTokenInterceptor.java   | 179 +++++++++++++++++++
 .../wss4j/KerberosTokenInterceptor.java         |  39 ++--
 .../apache/cxf/systest/ws/tokens/BSTServer.java |  47 +++++
 .../ws/tokens/BinarySecurityTokenTest.java      | 104 +++++++++++
 .../cxf/systest/ws/tokens/DoubleItBSTImpl.java  |  72 ++++++++
 .../cxf/systest/ws/tokens/DoubleItTokens.wsdl   |  21 +++
 .../apache/cxf/systest/ws/tokens/bst-server.xml |  36 ++++
 .../org/apache/cxf/systest/ws/tokens/client.xml | 177 ++++++++++++++++++
 8 files changed, 651 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/87f0669f/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/BinarySecurityTokenInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/BinarySecurityTokenInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/BinarySecurityTokenInterceptor.java
new file mode 100644
index 0000000..052fc16
--- /dev/null
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/BinarySecurityTokenInterceptor.java
@@ -0,0 +1,179 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.ws.security.wss4j;
+
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.security.auth.callback.CallbackHandler;
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+
+import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.headers.Header;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.security.DefaultSecurityContext;
+import org.apache.cxf.security.SecurityContext;
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.apache.cxf.ws.security.tokenstore.SecurityToken;
+import org.apache.cxf.ws.security.tokenstore.TokenStore;
+import org.apache.wss4j.common.ext.WSSecurityException;
+import org.apache.wss4j.dom.WSConstants;
+import org.apache.wss4j.dom.WSDocInfo;
+import org.apache.wss4j.dom.WSSConfig;
+import org.apache.wss4j.dom.WSSecurityEngineResult;
+import org.apache.wss4j.dom.handler.RequestData;
+import org.apache.wss4j.dom.handler.WSHandlerConstants;
+import org.apache.wss4j.dom.handler.WSHandlerResult;
+import org.apache.wss4j.dom.processor.BinarySecurityTokenProcessor;
+import org.apache.wss4j.dom.validate.Validator;
+import org.apache.wss4j.policy.model.AbstractToken;
+
+/**
+ * An interceptor to add a BinarySecurityToken token to the security header of an outbound request, and to
+ * process a BinarySecurityToken on an inbound request. It takes the BinarySecurityToken from the message 
+ * context on the outbound side.
+ */
+public class BinarySecurityTokenInterceptor extends AbstractTokenInterceptor {
+
+    public BinarySecurityTokenInterceptor() {
+        super();
+    }
+    
+    protected void processToken(SoapMessage message) {
+        Header h = findSecurityHeader(message, false);
+        if (h == null) {
+            return;
+        }
+        Element el = (Element)h.getObject();
+        Element child = DOMUtils.getFirstElement(el);
+        while (child != null) {
+            if (WSConstants.BINARY_TOKEN_LN.equals(child.getLocalName())
+                && WSConstants.WSSE_NS.equals(child.getNamespaceURI())) {
+                try {
+                    List<WSSecurityEngineResult> bstResults = processToken(child, message);
+                    if (bstResults != null) {
+                        List<WSHandlerResult> results = CastUtils.cast((List<?>)message
+                                .get(WSHandlerConstants.RECV_RESULTS));
+                        if (results == null) {
+                            results = new ArrayList<WSHandlerResult>();
+                            message.put(WSHandlerConstants.RECV_RESULTS, results);
+                        }
+                        WSHandlerResult rResult = new WSHandlerResult(null, bstResults);
+                        results.add(0, rResult);
+
+                        assertTokens(message);
+                        
+                        Principal principal = 
+                            (Principal)bstResults.get(0).get(WSSecurityEngineResult.TAG_PRINCIPAL);
+                        message.put(WSS4JInInterceptor.PRINCIPAL_RESULT, principal);                   
+                        
+                        SecurityContext sc = message.get(SecurityContext.class);
+                        if (sc == null || sc.getUserPrincipal() == null) {
+                            message.put(SecurityContext.class, new DefaultSecurityContext(principal, null));
+                        }
+
+                    }
+                } catch (WSSecurityException ex) {
+                    throw new Fault(ex);
+                }
+            }
+            child = DOMUtils.getNextElement(child);
+        }
+    }
+    
+    private List<WSSecurityEngineResult> processToken(Element tokenElement, final SoapMessage message)
+        throws WSSecurityException {
+        WSDocInfo wsDocInfo = new WSDocInfo(tokenElement.getOwnerDocument());
+        RequestData data = new RequestData() {
+            public CallbackHandler getCallbackHandler() {
+                return getCallback(message);
+            }
+            public Validator getValidator(QName qName) throws WSSecurityException {
+                String key = SecurityConstants.BST_TOKEN_VALIDATOR;
+                Object o = message.getContextualProperty(key);
+                try {
+                    if (o instanceof Validator) {
+                        return (Validator)o;
+                    } else if (o instanceof Class) {
+                        return (Validator)((Class<?>)o).newInstance();
+                    } else if (o instanceof String) {
+                        return (Validator)ClassLoaderUtils.loadClass(o.toString(),
+                                                                     BinarySecurityTokenInterceptor.class)
+                                                                     .newInstance();
+                    }
+                } catch (RuntimeException t) {
+                    throw t;
+                } catch (Exception ex) {
+                    throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex);
+                }
+                return super.getValidator(qName);
+            }
+        };
+        data.setWssConfig(WSSConfig.getNewInstance());
+        
+        BinarySecurityTokenProcessor p = new BinarySecurityTokenProcessor();
+        List<WSSecurityEngineResult> results = 
+            p.handleToken(tokenElement, data, wsDocInfo);
+        return results;
+    }
+    
+    protected AbstractToken assertTokens(SoapMessage message) {
+        // Assert tokens here if required
+        return null;
+    }
+
+    protected void addToken(SoapMessage message) {
+        SecurityToken securityToken = getSecurityToken(message);
+        if (securityToken == null || securityToken.getToken() == null) {
+            // No SecurityToken so just return
+            return;
+        }
+        
+        assertTokens(message);
+        Header h = findSecurityHeader(message, true);
+        Element el = (Element)h.getObject();
+        el.appendChild(el.getOwnerDocument().importNode(securityToken.getToken(), true));
+    }
+
+    private SecurityToken getSecurityToken(SoapMessage message) {
+        if (message.getContextualProperty(SecurityConstants.TOKEN) instanceof SecurityToken) {
+            return (SecurityToken)message.getContextualProperty(SecurityConstants.TOKEN);
+        }
+        
+        // Get the TokenStore
+        TokenStore tokenStore = getTokenStore(message);
+        if (tokenStore == null) {
+            return null;
+        }
+        
+        String id = (String)message.getContextualProperty(SecurityConstants.TOKEN_ID);
+        if (id != null) {
+            return tokenStore.getToken(id);
+        }
+        return null;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/87f0669f/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/KerberosTokenInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/KerberosTokenInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/KerberosTokenInterceptor.java
index c3e42d9..19efb19 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/KerberosTokenInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/KerberosTokenInterceptor.java
@@ -19,16 +19,8 @@
 
 package org.apache.cxf.ws.security.wss4j;
 
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.security.auth.callback.CallbackHandler;
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Element;
-
 import org.apache.cxf.binding.soap.SoapMessage;
+<<<<<<< HEAD
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.headers.Header;
 import org.apache.cxf.helpers.CastUtils;
@@ -51,6 +43,11 @@ import org.apache.ws.security.handler.WSHandlerConstants;
 import org.apache.ws.security.handler.WSHandlerResult;
 import org.apache.ws.security.processor.BinarySecurityTokenProcessor;
 import org.apache.ws.security.validate.Validator;
+=======
+import org.apache.cxf.ws.policy.AssertionInfoMap;
+import org.apache.wss4j.policy.SPConstants;
+import org.apache.wss4j.policy.model.AbstractToken;
+>>>>>>> 2120019... Adding a test-case for adding + parsing a BinarySecurityToken
 
 /**
  * An interceptor to add a Kerberos token to the security header of an outbound request, and to
@@ -58,12 +55,13 @@ import org.apache.ws.security.validate.Validator;
  * context on the outbound side, where it was previously placed by the 
  * KerberosTokenInterceptorProvider.
  */
-public class KerberosTokenInterceptor extends AbstractTokenInterceptor {
+public class KerberosTokenInterceptor extends BinarySecurityTokenInterceptor {
 
     public KerberosTokenInterceptor() {
         super();
     }
     
+<<<<<<< HEAD
     protected void processToken(SoapMessage message) {
         Header h = findSecurityHeader(message, false);
         if (h == null) {
@@ -157,20 +155,13 @@ public class KerberosTokenInterceptor extends AbstractTokenInterceptor {
         Header h = findSecurityHeader(message, true);
         Element el = (Element)h.getObject();
         el.appendChild(el.getOwnerDocument().importNode(securityToken.getToken(), true));
+=======
+    protected AbstractToken assertTokens(SoapMessage message) {
+        AssertionInfoMap aim = message.get(AssertionInfoMap.class);
+        assertPolicy(aim, "WssKerberosV5ApReqToken11");
+        assertPolicy(aim, "WssGssKerberosV5ApReqToken11");
+        return assertTokens(message, SPConstants.KERBEROS_TOKEN, false);
+>>>>>>> 2120019... Adding a test-case for adding + parsing a BinarySecurityToken
     }
 
-    private SecurityToken getSecurityToken(SoapMessage message) {
-        // Get the TokenStore
-        TokenStore tokenStore = getTokenStore(message);
-        if (tokenStore == null) {
-            return null;
-        }
-        
-        String id = (String)message.getContextualProperty(SecurityConstants.TOKEN_ID);
-        if (id != null) {
-            return tokenStore.getToken(id);
-        }
-        return null;
-    }
-    
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/87f0669f/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BSTServer.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BSTServer.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BSTServer.java
new file mode 100644
index 0000000..166e59b
--- /dev/null
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BSTServer.java
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.tokens;
+
+import java.net.URL;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class BSTServer extends AbstractBusTestServerBase {
+
+    public BSTServer() {
+
+    }
+
+    protected void run()  {
+        URL busFile = BSTServer.class.getResource("bst-server.xml");
+        Bus busLocal = new SpringBusFactory().createBus(busFile);
+        BusFactory.setDefaultBus(busLocal);
+        setBus(busLocal);
+
+        try {
+            new BSTServer();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/87f0669f/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BinarySecurityTokenTest.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BinarySecurityTokenTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BinarySecurityTokenTest.java
new file mode 100644
index 0000000..640b317
--- /dev/null
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BinarySecurityTokenTest.java
@@ -0,0 +1,104 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.tokens;
+
+import java.net.URL;
+import java.util.UUID;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import org.w3c.dom.Document;
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.systest.ws.common.SecurityTestUtil;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.apache.cxf.ws.security.tokenstore.SecurityToken;
+import org.apache.wss4j.dom.message.token.BinarySecurity;
+import org.example.contract.doubleit.DoubleItPortType;
+import org.junit.BeforeClass;
+
+/**
+ * This is a test to add a custom BinarySecurityToken to the security header of a service request,
+ * and to process it accordingly.
+ */
+public class BinarySecurityTokenTest extends AbstractBusClientServerTestBase {
+    static final String PORT = allocatePort(BSTServer.class);
+    
+    private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
+    private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
+
+    @BeforeClass
+    public static void startServers() throws Exception {
+        assertTrue(
+            "Server failed to launch",
+            // run the server in the same process
+            // set this to false to fork
+            launchServer(BSTServer.class, true)
+        );
+    }
+    
+    @org.junit.AfterClass
+    public static void cleanup() throws Exception {
+        SecurityTestUtil.cleanup();
+        stopAllServers();
+    }
+    
+    @org.junit.Test
+    public void testBinarySecurityToken() throws Exception {
+
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = BinarySecurityTokenTest.class.getResource("client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+
+        URL wsdl = BinarySecurityTokenTest.class.getResource("DoubleItTokens.wsdl");
+        Service service = Service.create(wsdl, SERVICE_QNAME);
+       
+        // Successful invocation
+        QName portQName = new QName(NAMESPACE, "DoubleItBinarySecurityTokenPort");
+        DoubleItPortType port = service.getPort(portQName, DoubleItPortType.class);
+        updateAddressPort(port, PORT);
+        
+        // Mock up a BinarySecurityToken to add
+        SecurityToken securityToken = new SecurityToken();
+        securityToken.setId("_" + UUID.randomUUID().toString());
+        
+        Document doc = DOMUtils.newDocument();
+        BinarySecurity binarySecurity = new BinarySecurity(doc);
+        binarySecurity.setValueType("http://custom-value-type");
+        binarySecurity.setToken("This is a token".getBytes());
+        
+        securityToken.setToken(binarySecurity.getElement());
+        
+        ((BindingProvider)port).getRequestContext().put(SecurityConstants.TOKEN, securityToken);
+        
+        port.doubleIt(25);
+        
+        ((java.io.Closeable)port).close();
+        bus.shutdown(true);
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/87f0669f/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/DoubleItBSTImpl.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/DoubleItBSTImpl.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/DoubleItBSTImpl.java
new file mode 100644
index 0000000..09fd847
--- /dev/null
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/DoubleItBSTImpl.java
@@ -0,0 +1,72 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.ws.tokens;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.annotation.Resource;
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceContext;
+
+import org.apache.cxf.feature.Features;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.wss4j.dom.WSSecurityEngineResult;
+import org.apache.wss4j.dom.handler.WSHandlerConstants;
+import org.apache.wss4j.dom.handler.WSHandlerResult;
+import org.apache.wss4j.dom.message.token.BinarySecurity;
+import org.example.contract.doubleit.DoubleItFault;
+import org.example.contract.doubleit.DoubleItPortType;
+import org.junit.Assert;
+
+@WebService(targetNamespace = "http://www.example.org/contract/DoubleIt", 
+            serviceName = "DoubleItService", 
+            endpointInterface = "org.example.contract.doubleit.DoubleItPortType")
+@Features(features = "org.apache.cxf.feature.LoggingFeature")              
+public class DoubleItBSTImpl implements DoubleItPortType {
+    
+    @Resource
+    WebServiceContext wsContext;
+    
+    public int doubleIt(int numberToDouble) throws DoubleItFault {
+        if (numberToDouble == 0) {
+            throw new DoubleItFault("0 can't be doubled!");
+        }
+        
+        List<WSHandlerResult> results = 
+            CastUtils.cast((List<?>)wsContext.getMessageContext().get(WSHandlerConstants.RECV_RESULTS));
+        Assert.assertNotNull("Security Results cannot be null", results);
+        Assert.assertTrue(results.size() > 0);
+        
+        WSHandlerResult result = results.get(0);
+        List<WSSecurityEngineResult> securityResults = result.getResults();
+        Assert.assertNotNull("Security Results cannot be null", securityResults);
+        Assert.assertTrue(securityResults.size() > 0);
+        
+        WSSecurityEngineResult securityResult = securityResults.get(0);
+        BinarySecurity binarySecurityToken = 
+            (BinarySecurity)securityResult.get(WSSecurityEngineResult.TAG_BINARY_SECURITY_TOKEN);
+        Assert.assertNotNull(binarySecurityToken);
+        
+        Assert.assertTrue(Arrays.equals(binarySecurityToken.getToken(), "This is a token".getBytes()));
+        
+        return numberToDouble * 2;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/87f0669f/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/DoubleItTokens.wsdl
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/DoubleItTokens.wsdl b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/DoubleItTokens.wsdl
index 2eb4218..e32a23b 100644
--- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/DoubleItTokens.wsdl
+++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/DoubleItTokens.wsdl
@@ -49,7 +49,25 @@
             </wsdl:fault>
         </wsdl:operation>
     </wsdl:binding>
+<<<<<<< HEAD
     
+=======
+    <wsdl:binding name="DoubleItNoSecurityBinding" type="tns:DoubleItPortType">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="DoubleIt">
+            <soap:operation soapAction=""/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="DoubleItFault">
+                <soap:body use="literal" name="DoubleItFault"/>
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+>>>>>>> 2120019... Adding a test-case for adding + parsing a BinarySecurityToken
     <wsdl:service name="DoubleItService">
         <wsdl:port name="DoubleItSignedSupportingPort" binding="tns:DoubleItStandardBinding">
             <soap:address location="http://localhost:9010/DoubleItSignedSupporting" />
@@ -96,6 +114,9 @@
         <wsdl:port name="DoubleItSignedEndorsingSupportingPort3" binding="tns:DoubleItStandardBinding">
             <soap:address location="http://localhost:9010/DoubleItSignedEndorsingSupporting3" />
         </wsdl:port>
+        <wsdl:port name="DoubleItBinarySecurityTokenPort" binding="tns:DoubleItNoSecurityBinding">
+            <soap:address location="http://localhost:9010/DoubleItBinarySecurityToken"/>
+        </wsdl:port>
     </wsdl:service>
     
    <wsp:Policy wsu:Id="SignEncryptBodyPolicy">

http://git-wip-us.apache.org/repos/asf/cxf/blob/87f0669f/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/bst-server.xml
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/bst-server.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/bst-server.xml
new file mode 100644
index 0000000..b0782e5
--- /dev/null
+++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/bst-server.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration" xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:cxf="http://cxf.apache.org/core" xmlns:p="http://cxf.apache.org/policy" xsi:schemaLocation="         http://www.springframework.org/schema/beans                     http://www.springframework.org/schema/beans/spring-beans.xsd         http://cxf.apache.org/jaxws                                     http://cxf.apache.org/schemas/jaxws.xsd         http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd         http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd         http://cxf.apache.org/transports/http/configuration             http://cxf.apache.org/schemas/configuration/http-conf.xsd         http://cxf.apa
 che.org/transports/http-jetty/configuration       http://cxf.apache.org/schemas/configuration/http-jetty.xsd         http://cxf.apache.org/configuration/security                    http://cxf.apache.org/schemas/configuration/security.xsd         http://www.w3.org/ns/ws-policy                                  http://www.w3.org/2007/02/ws-policy.xsd     ">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+    
+    <cxf:bus>
+        <cxf:features>
+            <p:policies/>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+    
+    <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt" id="BinarySecurityToken" address="http://localhost:${testutil.ports.BSTServer}/DoubleItBinarySecurityToken" serviceName="s:DoubleItService" endpointName="s:DoubleItBinarySecurityTokenPort" implementor="org.apache.cxf.systest.ws.tokens.DoubleItBSTImpl" wsdlLocation="org/apache/cxf/systest/ws/tokens/DoubleItTokens.wsdl">
+        <jaxws:inInterceptors>
+            <bean class="org.apache.cxf.ws.security.wss4j.BinarySecurityTokenInterceptor" />
+        </jaxws:inInterceptors>
+    </jaxws:endpoint>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/87f0669f/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/client.xml
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/client.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/client.xml
new file mode 100644
index 0000000..5048afb
--- /dev/null
+++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/client.xml
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:cxf="http://cxf.apache.org/core" xmlns:p="http://cxf.apache.org/policy" xmlns:sec="http://cxf.apache.org/configuration/security" xsi:schemaLocation="           http://www.springframework.org/schema/beans           http://www.springframework.org/schema/beans/spring-beans.xsd           http://cxf.apache.org/jaxws                           http://cxf.apache.org/schemas/jaxws.xsd           http://cxf.apache.org/transports/http/configuration   http://cxf.apache.org/schemas/configuration/http-conf.xsd           http://cxf.apache.org/configuration/security          http://cxf.apache.org/schemas/configuration/security.xsd           http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd           http://cxf.apache.org/policy http://cxf.apache.org/schemas/poli
 cy.xsd           http://www.w3.org/ns/ws-policy  http://www.w3.org/2007/02/ws-policy.xsd">
+    <cxf:bus>
+        <cxf:features>
+            <p:policies/>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSignedSupportingPort" createdFromAPI="true">
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+            <entry key="ws-security.encryption.properties" value="bob.properties"/>
+            <entry key="ws-security.encryption.username" value="bob"/>
+            <entry key="ws-security.signature.properties" value="alice.properties"/>
+            <entry key="ws-security.signature.username" value="alice"/>
+            <entry key="ws-security.username-token.always.encrypted" value="false"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/signed-supp-token-policy.xml"/>
+            </p:policies>
+        </jaxws:features>
+    </jaxws:client>
+    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSignedSupportingPort2" createdFromAPI="true">
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+            <entry key="ws-security.encryption.properties" value="bob.properties"/>
+            <entry key="ws-security.encryption.username" value="bob"/>
+            <entry key="ws-security.signature.properties" value="alice.properties"/>
+            <entry key="ws-security.signature.username" value="alice"/>
+            <entry key="ws-security.username-token.always.encrypted" value="false"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/supp-token-policy.xml"/>
+            </p:policies>
+        </jaxws:features>
+    </jaxws:client>
+    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSignedSupportingPort3" createdFromAPI="true">
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+            <entry key="ws-security.encryption.properties" value="bob.properties"/>
+            <entry key="ws-security.encryption.username" value="bob"/>
+            <entry key="ws-security.signature.properties" value="alice.properties"/>
+            <entry key="ws-security.signature.username" value="alice"/>
+            <entry key="ws-security.username-token.always.encrypted" value="false"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/encrypted-supp-token-policy.xml"/>
+            </p:policies>
+        </jaxws:features>
+    </jaxws:client>
+    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItEncryptedSupportingPort" createdFromAPI="true">
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+            <entry key="ws-security.encryption.properties" value="bob.properties"/>
+            <entry key="ws-security.encryption.username" value="bob"/>
+            <entry key="ws-security.signature.properties" value="alice.properties"/>
+            <entry key="ws-security.signature.username" value="alice"/>
+            <entry key="ws-security.username-token.always.encrypted" value="false"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/encrypted-supp-token-policy.xml"/>
+            </p:policies>
+        </jaxws:features>
+    </jaxws:client>
+    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItEncryptedSupportingPort2" createdFromAPI="true">
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+            <entry key="ws-security.encryption.properties" value="bob.properties"/>
+            <entry key="ws-security.encryption.username" value="bob"/>
+            <entry key="ws-security.signature.properties" value="alice.properties"/>
+            <entry key="ws-security.signature.username" value="alice"/>
+            <entry key="ws-security.username-token.always.encrypted" value="false"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/supp-token-policy.xml"/>
+            </p:policies>
+        </jaxws:features>
+    </jaxws:client>
+    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItEncryptedSupportingPort3" createdFromAPI="true">
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+            <entry key="ws-security.encryption.properties" value="bob.properties"/>
+            <entry key="ws-security.encryption.username" value="bob"/>
+            <entry key="ws-security.signature.properties" value="alice.properties"/>
+            <entry key="ws-security.signature.username" value="alice"/>
+            <entry key="ws-security.username-token.always.encrypted" value="false"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/signed-supp-token-policy.xml"/>
+            </p:policies>
+        </jaxws:features>
+    </jaxws:client>
+    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSignedEncryptedSupportingPort" createdFromAPI="true">
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+            <entry key="ws-security.encryption.properties" value="bob.properties"/>
+            <entry key="ws-security.encryption.username" value="bob"/>
+            <entry key="ws-security.signature.properties" value="alice.properties"/>
+            <entry key="ws-security.signature.username" value="alice"/>
+            <entry key="ws-security.username-token.always.encrypted" value="false"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/signed-encrypted-supp-token-policy.xml"/>
+            </p:policies>
+        </jaxws:features>
+    </jaxws:client>
+    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSignedEncryptedSupportingPort2" createdFromAPI="true">
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+            <entry key="ws-security.encryption.properties" value="bob.properties"/>
+            <entry key="ws-security.encryption.username" value="bob"/>
+            <entry key="ws-security.signature.properties" value="alice.properties"/>
+            <entry key="ws-security.signature.username" value="alice"/>
+            <entry key="ws-security.username-token.always.encrypted" value="false"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/signed-supp-token-policy.xml"/>
+            </p:policies>
+        </jaxws:features>
+    </jaxws:client>
+    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSignedEncryptedSupportingPort3" createdFromAPI="true">
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+            <entry key="ws-security.encryption.properties" value="bob.properties"/>
+            <entry key="ws-security.encryption.username" value="bob"/>
+            <entry key="ws-security.signature.properties" value="alice.properties"/>
+            <entry key="ws-security.signature.username" value="alice"/>
+            <entry key="ws-security.username-token.always.encrypted" value="false"/>
+        </jaxws:properties>
+        <jaxws:features>
+            <p:policies>
+                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/encrypted-supp-token-policy.xml"/>
+            </p:policies>
+        </jaxws:features>
+    </jaxws:client>
+    
+    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItBinarySecurityTokenPort" createdFromAPI="true">
+        <jaxws:outInterceptors>
+            <bean class="org.apache.cxf.ws.security.wss4j.BinarySecurityTokenInterceptor" />
+        </jaxws:outInterceptors>
+    </jaxws:client>
+</beans>


[3/3] git commit: Fixing build from last commit

Posted by co...@apache.org.
Fixing build from last commit


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/ad1c0971
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ad1c0971
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ad1c0971

Branch: refs/heads/2.7.x-fixes
Commit: ad1c0971c7752a51b38d3e190c0508c4ee89e60a
Parents: 8c87c55
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Mon May 12 13:04:02 2014 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Mon May 12 13:04:02 2014 +0100

----------------------------------------------------------------------
 .../wss4j/BinarySecurityTokenInterceptor.java   |  29 +--
 .../wss4j/KerberosTokenInterceptor.java         | 127 +------------
 .../apache/cxf/systest/ws/tokens/BSTServer.java |  47 -----
 .../ws/tokens/BinarySecurityTokenTest.java      |   6 +-
 .../cxf/systest/ws/tokens/DoubleItBSTImpl.java  |   8 +-
 .../cxf/systest/ws/tokens/server/BSTServer.java |  47 +++++
 .../cxf/systest/ws/tokens/DoubleItTokens.wsdl   |   6 +-
 .../apache/cxf/systest/ws/tokens/bst-server.xml |  36 ----
 .../org/apache/cxf/systest/ws/tokens/client.xml | 177 -------------------
 .../cxf/systest/ws/tokens/client/client.xml     |   6 +
 .../cxf/systest/ws/tokens/server/bst-server.xml |  36 ++++
 11 files changed, 115 insertions(+), 410 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/ad1c0971/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/BinarySecurityTokenInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/BinarySecurityTokenInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/BinarySecurityTokenInterceptor.java
index 052fc16..c10c252 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/BinarySecurityTokenInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/BinarySecurityTokenInterceptor.java
@@ -37,19 +37,19 @@ import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.security.DefaultSecurityContext;
 import org.apache.cxf.security.SecurityContext;
 import org.apache.cxf.ws.security.SecurityConstants;
+import org.apache.cxf.ws.security.policy.model.Token;
 import org.apache.cxf.ws.security.tokenstore.SecurityToken;
 import org.apache.cxf.ws.security.tokenstore.TokenStore;
-import org.apache.wss4j.common.ext.WSSecurityException;
-import org.apache.wss4j.dom.WSConstants;
-import org.apache.wss4j.dom.WSDocInfo;
-import org.apache.wss4j.dom.WSSConfig;
-import org.apache.wss4j.dom.WSSecurityEngineResult;
-import org.apache.wss4j.dom.handler.RequestData;
-import org.apache.wss4j.dom.handler.WSHandlerConstants;
-import org.apache.wss4j.dom.handler.WSHandlerResult;
-import org.apache.wss4j.dom.processor.BinarySecurityTokenProcessor;
-import org.apache.wss4j.dom.validate.Validator;
-import org.apache.wss4j.policy.model.AbstractToken;
+import org.apache.ws.security.WSConstants;
+import org.apache.ws.security.WSDocInfo;
+import org.apache.ws.security.WSSConfig;
+import org.apache.ws.security.WSSecurityEngineResult;
+import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.handler.RequestData;
+import org.apache.ws.security.handler.WSHandlerConstants;
+import org.apache.ws.security.handler.WSHandlerResult;
+import org.apache.ws.security.processor.BinarySecurityTokenProcessor;
+import org.apache.ws.security.validate.Validator;
 
 /**
  * An interceptor to add a BinarySecurityToken token to the security header of an outbound request, and to
@@ -126,9 +126,10 @@ public class BinarySecurityTokenInterceptor extends AbstractTokenInterceptor {
                     }
                 } catch (RuntimeException t) {
                     throw t;
-                } catch (Exception ex) {
-                    throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex);
+                }  catch (Throwable t) {
+                    throw new WSSecurityException(t.getMessage(), t);
                 }
+
                 return super.getValidator(qName);
             }
         };
@@ -140,7 +141,7 @@ public class BinarySecurityTokenInterceptor extends AbstractTokenInterceptor {
         return results;
     }
     
-    protected AbstractToken assertTokens(SoapMessage message) {
+    protected Token assertTokens(SoapMessage message) {
         // Assert tokens here if required
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/ad1c0971/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/KerberosTokenInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/KerberosTokenInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/KerberosTokenInterceptor.java
index 19efb19..aa735f7 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/KerberosTokenInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/KerberosTokenInterceptor.java
@@ -20,34 +20,8 @@
 package org.apache.cxf.ws.security.wss4j;
 
 import org.apache.cxf.binding.soap.SoapMessage;
-<<<<<<< HEAD
-import org.apache.cxf.common.classloader.ClassLoaderUtils;
-import org.apache.cxf.headers.Header;
-import org.apache.cxf.helpers.CastUtils;
-import org.apache.cxf.helpers.DOMUtils;
-import org.apache.cxf.interceptor.Fault;
-import org.apache.cxf.interceptor.security.DefaultSecurityContext;
-import org.apache.cxf.security.SecurityContext;
-import org.apache.cxf.ws.security.SecurityConstants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
 import org.apache.cxf.ws.security.policy.model.Token;
-import org.apache.cxf.ws.security.tokenstore.SecurityToken;
-import org.apache.cxf.ws.security.tokenstore.TokenStore;
-import org.apache.ws.security.WSConstants;
-import org.apache.ws.security.WSDocInfo;
-import org.apache.ws.security.WSSConfig;
-import org.apache.ws.security.WSSecurityEngineResult;
-import org.apache.ws.security.WSSecurityException;
-import org.apache.ws.security.handler.RequestData;
-import org.apache.ws.security.handler.WSHandlerConstants;
-import org.apache.ws.security.handler.WSHandlerResult;
-import org.apache.ws.security.processor.BinarySecurityTokenProcessor;
-import org.apache.ws.security.validate.Validator;
-=======
-import org.apache.cxf.ws.policy.AssertionInfoMap;
-import org.apache.wss4j.policy.SPConstants;
-import org.apache.wss4j.policy.model.AbstractToken;
->>>>>>> 2120019... Adding a test-case for adding + parsing a BinarySecurityToken
 
 /**
  * An interceptor to add a Kerberos token to the security header of an outbound request, and to
@@ -61,107 +35,8 @@ public class KerberosTokenInterceptor extends BinarySecurityTokenInterceptor {
         super();
     }
     
-<<<<<<< HEAD
-    protected void processToken(SoapMessage message) {
-        Header h = findSecurityHeader(message, false);
-        if (h == null) {
-            return;
-        }
-        Element el = (Element)h.getObject();
-        Element child = DOMUtils.getFirstElement(el);
-        while (child != null) {
-            if (WSConstants.BINARY_TOKEN_LN.equals(child.getLocalName())
-                && WSConstants.WSSE_NS.equals(child.getNamespaceURI())) {
-                try {
-                    List<WSSecurityEngineResult> bstResults = processToken(child, message);
-                    if (bstResults != null) {
-                        List<WSHandlerResult> results = CastUtils.cast((List<?>)message
-                                .get(WSHandlerConstants.RECV_RESULTS));
-                        if (results == null) {
-                            results = new ArrayList<WSHandlerResult>();
-                            message.put(WSHandlerConstants.RECV_RESULTS, results);
-                        }
-                        WSHandlerResult rResult = new WSHandlerResult(null, bstResults);
-                        results.add(0, rResult);
-
-                        assertTokens(message, SP12Constants.KERBEROS_TOKEN, false);
-                        
-                        Principal principal = 
-                            (Principal)bstResults.get(0).get(WSSecurityEngineResult.TAG_PRINCIPAL);
-                        message.put(WSS4JInInterceptor.PRINCIPAL_RESULT, principal);                   
-                        
-                        SecurityContext sc = message.get(SecurityContext.class);
-                        if (sc == null || sc.getUserPrincipal() == null) {
-                            message.put(SecurityContext.class, new DefaultSecurityContext(principal, null));
-                        }
-
-                    }
-                } catch (WSSecurityException ex) {
-                    throw new Fault(ex);
-                }
-            }
-            child = DOMUtils.getNextElement(child);
-        }
-    }
-    
-    private List<WSSecurityEngineResult> processToken(Element tokenElement, final SoapMessage message)
-        throws WSSecurityException {
-        WSDocInfo wsDocInfo = new WSDocInfo(tokenElement.getOwnerDocument());
-        RequestData data = new RequestData() {
-            public CallbackHandler getCallbackHandler() {
-                return getCallback(message);
-            }
-            public Validator getValidator(QName qName) throws WSSecurityException {
-                String key = SecurityConstants.BST_TOKEN_VALIDATOR;
-                Object o = message.getContextualProperty(key);
-                try {
-                    if (o instanceof Validator) {
-                        return (Validator)o;
-                    } else if (o instanceof Class) {
-                        return (Validator)((Class<?>)o).newInstance();
-                    } else if (o instanceof String) {
-                        return (Validator)ClassLoaderUtils.loadClass(o.toString(),
-                                                                     KerberosTokenInterceptor.class)
-                                                                     .newInstance();
-                    }
-                } catch (RuntimeException t) {
-                    throw t;
-                } catch (Throwable t) {
-                    throw new WSSecurityException(t.getMessage(), t);
-                }
-                return super.getValidator(qName);
-            }
-        };
-        data.setWssConfig(WSSConfig.getNewInstance());
-        
-        BinarySecurityTokenProcessor p = new BinarySecurityTokenProcessor();
-        List<WSSecurityEngineResult> results = 
-            p.handleToken(tokenElement, data, wsDocInfo);
-        return results;
-    }
-    
     protected Token assertTokens(SoapMessage message) {
-        return assertTokens(message, SP12Constants.KERBEROS_TOKEN, true);
-    }
-
-    protected void addToken(SoapMessage message) {
-        SecurityToken securityToken = getSecurityToken(message);
-        if (securityToken == null || securityToken.getToken() == null) {
-            // No SecurityToken so just return
-            return;
-        }
-        
-        assertTokens(message);
-        Header h = findSecurityHeader(message, true);
-        Element el = (Element)h.getObject();
-        el.appendChild(el.getOwnerDocument().importNode(securityToken.getToken(), true));
-=======
-    protected AbstractToken assertTokens(SoapMessage message) {
-        AssertionInfoMap aim = message.get(AssertionInfoMap.class);
-        assertPolicy(aim, "WssKerberosV5ApReqToken11");
-        assertPolicy(aim, "WssGssKerberosV5ApReqToken11");
-        return assertTokens(message, SPConstants.KERBEROS_TOKEN, false);
->>>>>>> 2120019... Adding a test-case for adding + parsing a BinarySecurityToken
+        return assertTokens(message, SP12Constants.KERBEROS_TOKEN, false);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/ad1c0971/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BSTServer.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BSTServer.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BSTServer.java
deleted file mode 100644
index 166e59b..0000000
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BSTServer.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.systest.ws.tokens;
-
-import java.net.URL;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.bus.spring.SpringBusFactory;
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-
-public class BSTServer extends AbstractBusTestServerBase {
-
-    public BSTServer() {
-
-    }
-
-    protected void run()  {
-        URL busFile = BSTServer.class.getResource("bst-server.xml");
-        Bus busLocal = new SpringBusFactory().createBus(busFile);
-        BusFactory.setDefaultBus(busLocal);
-        setBus(busLocal);
-
-        try {
-            new BSTServer();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/cxf/blob/ad1c0971/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BinarySecurityTokenTest.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BinarySecurityTokenTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BinarySecurityTokenTest.java
index 640b317..1c894b9 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BinarySecurityTokenTest.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/BinarySecurityTokenTest.java
@@ -27,14 +27,16 @@ import javax.xml.ws.BindingProvider;
 import javax.xml.ws.Service;
 
 import org.w3c.dom.Document;
+
 import org.apache.cxf.Bus;
 import org.apache.cxf.bus.spring.SpringBusFactory;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.systest.ws.common.SecurityTestUtil;
+import org.apache.cxf.systest.ws.tokens.server.BSTServer;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.cxf.ws.security.SecurityConstants;
 import org.apache.cxf.ws.security.tokenstore.SecurityToken;
-import org.apache.wss4j.dom.message.token.BinarySecurity;
+import org.apache.ws.security.message.token.BinarySecurity;
 import org.example.contract.doubleit.DoubleItPortType;
 import org.junit.BeforeClass;
 
@@ -68,7 +70,7 @@ public class BinarySecurityTokenTest extends AbstractBusClientServerTestBase {
     public void testBinarySecurityToken() throws Exception {
 
         SpringBusFactory bf = new SpringBusFactory();
-        URL busFile = BinarySecurityTokenTest.class.getResource("client.xml");
+        URL busFile = BinarySecurityTokenTest.class.getResource("client/client.xml");
 
         Bus bus = bf.createBus(busFile.toString());
         SpringBusFactory.setDefaultBus(bus);

http://git-wip-us.apache.org/repos/asf/cxf/blob/ad1c0971/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/DoubleItBSTImpl.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/DoubleItBSTImpl.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/DoubleItBSTImpl.java
index 09fd847..01092a7 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/DoubleItBSTImpl.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/DoubleItBSTImpl.java
@@ -27,10 +27,10 @@ import javax.xml.ws.WebServiceContext;
 
 import org.apache.cxf.feature.Features;
 import org.apache.cxf.helpers.CastUtils;
-import org.apache.wss4j.dom.WSSecurityEngineResult;
-import org.apache.wss4j.dom.handler.WSHandlerConstants;
-import org.apache.wss4j.dom.handler.WSHandlerResult;
-import org.apache.wss4j.dom.message.token.BinarySecurity;
+import org.apache.ws.security.WSSecurityEngineResult;
+import org.apache.ws.security.handler.WSHandlerConstants;
+import org.apache.ws.security.handler.WSHandlerResult;
+import org.apache.ws.security.message.token.BinarySecurity;
 import org.example.contract.doubleit.DoubleItFault;
 import org.example.contract.doubleit.DoubleItPortType;
 import org.junit.Assert;

http://git-wip-us.apache.org/repos/asf/cxf/blob/ad1c0971/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/server/BSTServer.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/server/BSTServer.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/server/BSTServer.java
new file mode 100644
index 0000000..091489d
--- /dev/null
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/server/BSTServer.java
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.tokens.server;
+
+import java.net.URL;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class BSTServer extends AbstractBusTestServerBase {
+
+    public BSTServer() {
+
+    }
+
+    protected void run()  {
+        URL busFile = BSTServer.class.getResource("bst-server.xml");
+        Bus busLocal = new SpringBusFactory().createBus(busFile);
+        BusFactory.setDefaultBus(busLocal);
+        setBus(busLocal);
+
+        try {
+            new BSTServer();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/ad1c0971/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/DoubleItTokens.wsdl
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/DoubleItTokens.wsdl b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/DoubleItTokens.wsdl
index e32a23b..c60f926 100644
--- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/DoubleItTokens.wsdl
+++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/DoubleItTokens.wsdl
@@ -49,9 +49,7 @@
             </wsdl:fault>
         </wsdl:operation>
     </wsdl:binding>
-<<<<<<< HEAD
-    
-=======
+
     <wsdl:binding name="DoubleItNoSecurityBinding" type="tns:DoubleItPortType">
         <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
         <wsdl:operation name="DoubleIt">
@@ -67,7 +65,7 @@
             </wsdl:fault>
         </wsdl:operation>
     </wsdl:binding>
->>>>>>> 2120019... Adding a test-case for adding + parsing a BinarySecurityToken
+    
     <wsdl:service name="DoubleItService">
         <wsdl:port name="DoubleItSignedSupportingPort" binding="tns:DoubleItStandardBinding">
             <soap:address location="http://localhost:9010/DoubleItSignedSupporting" />

http://git-wip-us.apache.org/repos/asf/cxf/blob/ad1c0971/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/bst-server.xml
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/bst-server.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/bst-server.xml
deleted file mode 100644
index b0782e5..0000000
--- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/bst-server.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- 
- http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration" xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:cxf="http://cxf.apache.org/core" xmlns:p="http://cxf.apache.org/policy" xsi:schemaLocation="         http://www.springframework.org/schema/beans                     http://www.springframework.org/schema/beans/spring-beans.xsd         http://cxf.apache.org/jaxws                                     http://cxf.apache.org/schemas/jaxws.xsd         http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd         http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd         http://cxf.apache.org/transports/http/configuration             http://cxf.apache.org/schemas/configuration/http-conf.xsd         http://cxf.apa
 che.org/transports/http-jetty/configuration       http://cxf.apache.org/schemas/configuration/http-jetty.xsd         http://cxf.apache.org/configuration/security                    http://cxf.apache.org/schemas/configuration/security.xsd         http://www.w3.org/ns/ws-policy                                  http://www.w3.org/2007/02/ws-policy.xsd     ">
-    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
-    
-    <cxf:bus>
-        <cxf:features>
-            <p:policies/>
-            <cxf:logging/>
-        </cxf:features>
-    </cxf:bus>
-    
-    <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt" id="BinarySecurityToken" address="http://localhost:${testutil.ports.BSTServer}/DoubleItBinarySecurityToken" serviceName="s:DoubleItService" endpointName="s:DoubleItBinarySecurityTokenPort" implementor="org.apache.cxf.systest.ws.tokens.DoubleItBSTImpl" wsdlLocation="org/apache/cxf/systest/ws/tokens/DoubleItTokens.wsdl">
-        <jaxws:inInterceptors>
-            <bean class="org.apache.cxf.ws.security.wss4j.BinarySecurityTokenInterceptor" />
-        </jaxws:inInterceptors>
-    </jaxws:endpoint>
-    
-</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/ad1c0971/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/client.xml
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/client.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/client.xml
deleted file mode 100644
index 5048afb..0000000
--- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/client.xml
+++ /dev/null
@@ -1,177 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- 
- http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:cxf="http://cxf.apache.org/core" xmlns:p="http://cxf.apache.org/policy" xmlns:sec="http://cxf.apache.org/configuration/security" xsi:schemaLocation="           http://www.springframework.org/schema/beans           http://www.springframework.org/schema/beans/spring-beans.xsd           http://cxf.apache.org/jaxws                           http://cxf.apache.org/schemas/jaxws.xsd           http://cxf.apache.org/transports/http/configuration   http://cxf.apache.org/schemas/configuration/http-conf.xsd           http://cxf.apache.org/configuration/security          http://cxf.apache.org/schemas/configuration/security.xsd           http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd           http://cxf.apache.org/policy http://cxf.apache.org/schemas/poli
 cy.xsd           http://www.w3.org/ns/ws-policy  http://www.w3.org/2007/02/ws-policy.xsd">
-    <cxf:bus>
-        <cxf:features>
-            <p:policies/>
-            <cxf:logging/>
-        </cxf:features>
-    </cxf:bus>
-    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSignedSupportingPort" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
-            <entry key="ws-security.encryption.properties" value="bob.properties"/>
-            <entry key="ws-security.encryption.username" value="bob"/>
-            <entry key="ws-security.signature.properties" value="alice.properties"/>
-            <entry key="ws-security.signature.username" value="alice"/>
-            <entry key="ws-security.username-token.always.encrypted" value="false"/>
-        </jaxws:properties>
-        <jaxws:features>
-            <p:policies>
-                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/signed-supp-token-policy.xml"/>
-            </p:policies>
-        </jaxws:features>
-    </jaxws:client>
-    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSignedSupportingPort2" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
-            <entry key="ws-security.encryption.properties" value="bob.properties"/>
-            <entry key="ws-security.encryption.username" value="bob"/>
-            <entry key="ws-security.signature.properties" value="alice.properties"/>
-            <entry key="ws-security.signature.username" value="alice"/>
-            <entry key="ws-security.username-token.always.encrypted" value="false"/>
-        </jaxws:properties>
-        <jaxws:features>
-            <p:policies>
-                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/supp-token-policy.xml"/>
-            </p:policies>
-        </jaxws:features>
-    </jaxws:client>
-    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSignedSupportingPort3" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
-            <entry key="ws-security.encryption.properties" value="bob.properties"/>
-            <entry key="ws-security.encryption.username" value="bob"/>
-            <entry key="ws-security.signature.properties" value="alice.properties"/>
-            <entry key="ws-security.signature.username" value="alice"/>
-            <entry key="ws-security.username-token.always.encrypted" value="false"/>
-        </jaxws:properties>
-        <jaxws:features>
-            <p:policies>
-                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/encrypted-supp-token-policy.xml"/>
-            </p:policies>
-        </jaxws:features>
-    </jaxws:client>
-    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItEncryptedSupportingPort" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
-            <entry key="ws-security.encryption.properties" value="bob.properties"/>
-            <entry key="ws-security.encryption.username" value="bob"/>
-            <entry key="ws-security.signature.properties" value="alice.properties"/>
-            <entry key="ws-security.signature.username" value="alice"/>
-            <entry key="ws-security.username-token.always.encrypted" value="false"/>
-        </jaxws:properties>
-        <jaxws:features>
-            <p:policies>
-                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/encrypted-supp-token-policy.xml"/>
-            </p:policies>
-        </jaxws:features>
-    </jaxws:client>
-    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItEncryptedSupportingPort2" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
-            <entry key="ws-security.encryption.properties" value="bob.properties"/>
-            <entry key="ws-security.encryption.username" value="bob"/>
-            <entry key="ws-security.signature.properties" value="alice.properties"/>
-            <entry key="ws-security.signature.username" value="alice"/>
-            <entry key="ws-security.username-token.always.encrypted" value="false"/>
-        </jaxws:properties>
-        <jaxws:features>
-            <p:policies>
-                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/supp-token-policy.xml"/>
-            </p:policies>
-        </jaxws:features>
-    </jaxws:client>
-    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItEncryptedSupportingPort3" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
-            <entry key="ws-security.encryption.properties" value="bob.properties"/>
-            <entry key="ws-security.encryption.username" value="bob"/>
-            <entry key="ws-security.signature.properties" value="alice.properties"/>
-            <entry key="ws-security.signature.username" value="alice"/>
-            <entry key="ws-security.username-token.always.encrypted" value="false"/>
-        </jaxws:properties>
-        <jaxws:features>
-            <p:policies>
-                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/signed-supp-token-policy.xml"/>
-            </p:policies>
-        </jaxws:features>
-    </jaxws:client>
-    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSignedEncryptedSupportingPort" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
-            <entry key="ws-security.encryption.properties" value="bob.properties"/>
-            <entry key="ws-security.encryption.username" value="bob"/>
-            <entry key="ws-security.signature.properties" value="alice.properties"/>
-            <entry key="ws-security.signature.username" value="alice"/>
-            <entry key="ws-security.username-token.always.encrypted" value="false"/>
-        </jaxws:properties>
-        <jaxws:features>
-            <p:policies>
-                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/signed-encrypted-supp-token-policy.xml"/>
-            </p:policies>
-        </jaxws:features>
-    </jaxws:client>
-    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSignedEncryptedSupportingPort2" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
-            <entry key="ws-security.encryption.properties" value="bob.properties"/>
-            <entry key="ws-security.encryption.username" value="bob"/>
-            <entry key="ws-security.signature.properties" value="alice.properties"/>
-            <entry key="ws-security.signature.username" value="alice"/>
-            <entry key="ws-security.username-token.always.encrypted" value="false"/>
-        </jaxws:properties>
-        <jaxws:features>
-            <p:policies>
-                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/signed-supp-token-policy.xml"/>
-            </p:policies>
-        </jaxws:features>
-    </jaxws:client>
-    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItSignedEncryptedSupportingPort3" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
-            <entry key="ws-security.encryption.properties" value="bob.properties"/>
-            <entry key="ws-security.encryption.username" value="bob"/>
-            <entry key="ws-security.signature.properties" value="alice.properties"/>
-            <entry key="ws-security.signature.username" value="alice"/>
-            <entry key="ws-security.username-token.always.encrypted" value="false"/>
-        </jaxws:properties>
-        <jaxws:features>
-            <p:policies>
-                <wsp:PolicyReference xmlns:wsp="http://www.w3.org/ns/ws-policy" URI="classpath:/org/apache/cxf/systest/ws/tokens/encrypted-supp-token-policy.xml"/>
-            </p:policies>
-        </jaxws:features>
-    </jaxws:client>
-    
-    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItBinarySecurityTokenPort" createdFromAPI="true">
-        <jaxws:outInterceptors>
-            <bean class="org.apache.cxf.ws.security.wss4j.BinarySecurityTokenInterceptor" />
-        </jaxws:outInterceptors>
-    </jaxws:client>
-</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/ad1c0971/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/client/client.xml
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/client/client.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/client/client.xml
index 807e8ef..d1f4d8d 100644
--- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/client/client.xml
+++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/client/client.xml
@@ -246,5 +246,11 @@
             </p:policies>
         </jaxws:features>
     </jaxws:client>
+    
+    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItBinarySecurityTokenPort" createdFromAPI="true">
+        <jaxws:outInterceptors>
+            <bean class="org.apache.cxf.ws.security.wss4j.BinarySecurityTokenInterceptor" />
+        </jaxws:outInterceptors>
+    </jaxws:client>
 	
 </beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/ad1c0971/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/server/bst-server.xml
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/server/bst-server.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/server/bst-server.xml
new file mode 100644
index 0000000..b0782e5
--- /dev/null
+++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/tokens/server/bst-server.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration" xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:cxf="http://cxf.apache.org/core" xmlns:p="http://cxf.apache.org/policy" xsi:schemaLocation="         http://www.springframework.org/schema/beans                     http://www.springframework.org/schema/beans/spring-beans.xsd         http://cxf.apache.org/jaxws                                     http://cxf.apache.org/schemas/jaxws.xsd         http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd         http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd         http://cxf.apache.org/transports/http/configuration             http://cxf.apache.org/schemas/configuration/http-conf.xsd         http://cxf.apa
 che.org/transports/http-jetty/configuration       http://cxf.apache.org/schemas/configuration/http-jetty.xsd         http://cxf.apache.org/configuration/security                    http://cxf.apache.org/schemas/configuration/security.xsd         http://www.w3.org/ns/ws-policy                                  http://www.w3.org/2007/02/ws-policy.xsd     ">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+    
+    <cxf:bus>
+        <cxf:features>
+            <p:policies/>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+    
+    <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt" id="BinarySecurityToken" address="http://localhost:${testutil.ports.BSTServer}/DoubleItBinarySecurityToken" serviceName="s:DoubleItService" endpointName="s:DoubleItBinarySecurityTokenPort" implementor="org.apache.cxf.systest.ws.tokens.DoubleItBSTImpl" wsdlLocation="org/apache/cxf/systest/ws/tokens/DoubleItTokens.wsdl">
+        <jaxws:inInterceptors>
+            <bean class="org.apache.cxf.ws.security.wss4j.BinarySecurityTokenInterceptor" />
+        </jaxws:inInterceptors>
+    </jaxws:endpoint>
+    
+</beans>


[2/3] git commit: Recording .gitmergeinfo Changes

Posted by co...@apache.org.
Recording .gitmergeinfo Changes


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8c87c55c
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8c87c55c
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8c87c55c

Branch: refs/heads/2.7.x-fixes
Commit: 8c87c55c813ca5c32f1a213b90483208b6689d68
Parents: 87f0669
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Mon May 12 12:50:54 2014 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Mon May 12 12:50:54 2014 +0100

----------------------------------------------------------------------
 .gitmergeinfo | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/8c87c55c/.gitmergeinfo
----------------------------------------------------------------------
diff --git a/.gitmergeinfo b/.gitmergeinfo
index 543031a..7aa58a1 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -1168,6 +1168,7 @@ M 1ed0dd8ba34164e462f160fa3c7864ac12aeb9f0
 M 1fa9f532b64187ac7e7f1094b659369fc4adacf6
 M 20767c663fc54d3f6d0219a5c347dbaa49939b67
 M 20b023d463d322b30067306acdd7b4e46292ba68
+M 2120019be400eddd8f90c3a90ec01baa9c1439f1
 M 212052017423ccf95a0f0780b9059653ef232698
 M 217cf5565cad6dd7621cf0a7f94836874fd3b37a
 M 21d0fce1db3019fc6feb34468636298e36905798