[1/3] cxf git commit: Fixing merge
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes ac05513f0 -> 283406f23 Fixing merge Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/283406f2 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/283406f2 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/283406f2 Branch: refs/heads/3.1.x-fixes Commit: 283406f2376e152e5c663b43c5337de550dd3921 Parents: fbd6027 Author: Colm O hEigeartaigh Authored: Tue Mar 8 15:37:54 2016 + Committer: Colm O hEigeartaigh Committed: Tue Mar 8 15:38:10 2016 + -- .../http_undertow/MapIdentityManager.java | 126 --- 1 file changed, 126 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/283406f2/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/MapIdentityManager.java -- diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/MapIdentityManager.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/MapIdentityManager.java deleted file mode 100644 index fb29c98..000 --- a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/MapIdentityManager.java +++ /dev/null @@ -1,126 +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.http_undertow; - -import java.nio.charset.Charset; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.Principal; -import java.util.Arrays; -import java.util.Collections; -import java.util.Map; -import java.util.Set; - -import io.undertow.security.idm.Account; -import io.undertow.security.idm.Credential; -import io.undertow.security.idm.DigestCredential; -import io.undertow.security.idm.IdentityManager; -import io.undertow.security.idm.PasswordCredential; -import io.undertow.util.HexConverter; - -class MapIdentityManager implements IdentityManager { - -private static final Charset UTF_8 = Charset.forName("UTF-8"); - -private final Map users; - -MapIdentityManager(final Map users) { -this.users = users; -} - -@Override -public Account verify(Account account) { -// An existing account so for testing assume still valid. -return account; -} - -@Override -public Account verify(String id, Credential credential) { -Account account = getAccount(id); -if (account != null && verifyCredential(account, credential)) { -return account; -} - -return null; -} - -@Override -public Account verify(Credential credential) { -// TODO Auto-generated method stub -return null; -} - -private boolean verifyCredential(Account account, Credential credential) { -if (credential instanceof PasswordCredential) { -char[] password = ((PasswordCredential) credential).getPassword(); -char[] expectedPassword = users.get(account.getPrincipal().getName()); - -return Arrays.equals(password, expectedPassword); -} else if (credential instanceof DigestCredential) { -DigestCredential digCred = (DigestCredential) credential; -MessageDigest digest = null; -try { -digest = digCred.getAlgorithm().getMessageDigest(); - - digest.update(account.getPrincipal().getName().getBytes(UTF_8)); -digest.update((byte) ':'); -digest.update(digCred.getRealm().getBytes(UTF_8)); -digest.update((byte) ':'); -char[] expectedPassword = users.get(account.getPrincipal().getName()); -digest.update(new String(expectedPassword).getBytes(UTF_8)); - -return digCred.verifyHA1(HexConverter.convertToHexBytes(digest.digest())); -} catch (NoSuchAlgorithmException e) { -throw new IllegalStateException("Unsupported Algorithm", e); -} finally
[1/3] cxf git commit: Fixing merge
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes c806cc348 -> 0cab8b7fe Fixing merge Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0cab8b7f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0cab8b7f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0cab8b7f Branch: refs/heads/3.0.x-fixes Commit: 0cab8b7fe8d13f4c57fe4f062465811ea2b12ea7 Parents: 8623596 Author: Colm O hEigeartaigh Authored: Wed Mar 29 12:09:47 2017 +0100 Committer: Colm O hEigeartaigh Committed: Wed Mar 29 12:09:53 2017 +0100 -- .../jaxrs/security/xml/JAXRSXmlSecTest.java | 55 ++-- .../cxf/systest/jaxrs/security/xml/server.xml | 4 +- 2 files changed, 6 insertions(+), 53 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/0cab8b7f/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java -- diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java index 11ce888..684f1b6 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java @@ -360,8 +360,6 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase { } @Test -<<< HEAD -=== public void testUnsignedServerResponse() throws Exception { if (STAX_PORT.equals(test.port)) { // We are only testing the client here @@ -377,11 +375,11 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase { Bus springBus = bf.createBus(busFile.toString()); bean.setBus(springBus); -Map properties = new HashMap<>(); -properties.put(SecurityConstants.CALLBACK_HANDLER, +Map properties = new HashMap(); +properties.put("ws-security.callback-handler", "org.apache.cxf.systest.jaxrs.security.saml.KeystorePasswordCallback"); -properties.put(SecurityConstants.SIGNATURE_USERNAME, "alice"); -properties.put(SecurityConstants.SIGNATURE_PROPERTIES, +properties.put("ws-security.signature.username", "alice"); +properties.put("ws-security.signature.properties", "org/apache/cxf/systest/jaxrs/security/alice.properties"); bean.setProperties(properties); if (test.streaming) { @@ -411,51 +409,6 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase { } @Test -public void testPostBookWithEnvelopedSigKeyName() throws Exception { -// This test only applies to StAX - see CXF-7084 -if (!test.streaming || !STAX_PORT.equals(test.port)) { -return; -} -String address = "https://localhost:"; + test.port + "/xmlsigkeyname/bookstore/books"; - -JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean(); -bean.setAddress(address); - -SpringBusFactory bf = new SpringBusFactory(); -URL busFile = JAXRSXmlSecTest.class.getResource("client.xml"); -Bus springBus = bf.createBus(busFile.toString()); -bean.setBus(springBus); - -Map properties = new HashMap<>(); -properties.put(SecurityConstants.CALLBACK_HANDLER, - "org.apache.cxf.systest.jaxrs.security.saml.KeystorePasswordCallback"); -properties.put(SecurityConstants.SIGNATURE_USERNAME, "alice"); -properties.put(SecurityConstants.SIGNATURE_PROPERTIES, - "org/apache/cxf/systest/jaxrs/security/alice.properties"); -bean.setProperties(properties); -XmlSecOutInterceptor sigOutInterceptor = new XmlSecOutInterceptor(); -sigOutInterceptor.setSignRequest(true); -sigOutInterceptor.setKeyInfoMustBeAvailable(true); - -SignatureProperties sigProps = new SignatureProperties(); -sigProps.setSignatureKeyName("alice-kn"); -sigProps.setSignatureKeyIdType("KeyName"); -sigOutInterceptor.setSignatureProperties(sigProps); - -bean.getOutInterceptors().add(sigOutInterceptor); - -XmlSecInInterceptor sigInInterceptor = new XmlSecInInterceptor(); -sigInInterceptor.setRequireSignature(true); -bean.setProvider(sigInInterceptor); - -WebClient wc = bean.createWebClient(); - WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(1000L); -Book book = wc.post(new Book("CXF", 126L), Book.class); -assertEquals(126L, book.getId()); -} - -@Test ->>> 533daf2... Add another test to chec
[1/3] cxf git commit: Fixing merge
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes d69a34be8 -> fd28dc95e Fixing merge Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/fd28dc95 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/fd28dc95 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/fd28dc95 Branch: refs/heads/3.1.x-fixes Commit: fd28dc95e719fdd29a05eee48ad99ae505cfbc9e Parents: 6a23ff6 Author: Colm O hEigeartaigh Authored: Fri Mar 24 18:44:52 2017 + Committer: Colm O hEigeartaigh Committed: Fri Mar 24 18:45:05 2017 + -- .../http_jetty/JettyHTTPServerEngineFactory.java| 12 1 file changed, 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/fd28dc95/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java -- diff --git a/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java b/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java index f9d0765..e5e85a8 100644 --- a/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java +++ b/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java @@ -268,13 +268,6 @@ public class JettyHTTPServerEngineFactory { * @throws GeneralSecurityException * @throws IOException */ -<<< HEAD -public synchronized JettyHTTPServerEngine createJettyHTTPServerEngine(String host, int port, -String protocol) throws GeneralSecurityException, IOException { -LOG.fine("Creating Jetty HTTP Server Engine for port " + port + "."); -JettyHTTPServerEngine ref = getOrCreate(this, host, port, null); -// checking the protocol -=== public synchronized JettyHTTPServerEngine createJettyHTTPServerEngine(String host, int port, String protocol, String id) throws GeneralSecurityException, IOException { LOG.fine("Creating Jetty HTTP Server Engine for port " + port + "."); @@ -284,7 +277,6 @@ public class JettyHTTPServerEngineFactory { } JettyHTTPServerEngine ref = getOrCreate(this, host, port, tlsParameters); // checking the protocol ->>> e70c78e... CXF-7299 - No way to configure TLS for the JettyHTTPServerEngineFactory in code if (!protocol.equals(ref.getProtocol())) { throw new IOException("Protocol mismatch for port " + port + ": " + "engine's protocol is " + ref.getProtocol() @@ -314,16 +306,12 @@ public class JettyHTTPServerEngineFactory { String protocol) throws GeneralSecurityException, IOException { return createJettyHTTPServerEngine(null, port, protocol); } -<<< HEAD - -=== public synchronized JettyHTTPServerEngine createJettyHTTPServerEngine(String host, int port, String protocol) throws GeneralSecurityException, IOException { return createJettyHTTPServerEngine(host, port, protocol, null); } ->>> e70c78e... CXF-7299 - No way to configure TLS for the JettyHTTPServerEngineFactory in code /** * This method removes the Server Engine from the port map and stops it. */