cxf git commit: [CXF-7442] Throwing InternalServerErrorException
Repository: cxf Updated Branches: refs/heads/master 4be704469 -> 1387abab6 [CXF-7442] Throwing InternalServerErrorException Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1387abab Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1387abab Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1387abab Branch: refs/heads/master Commit: 1387abab66da34304d3773d5b85e5a81303b Parents: 4be7044 Author: Sergey BeryozkinAuthored: Tue Jul 11 18:03:57 2017 +0100 Committer: Sergey Beryozkin Committed: Tue Jul 11 18:03:57 2017 +0100 -- .../main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java | 7 ++- .../java/org/apache/cxf/jaxrs/utils/InjectionUtilsTest.java | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/1387abab/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java -- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java index ff82da4..550bed5 100644 --- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java @@ -497,7 +497,12 @@ public final class InjectionUtils { reportServerError("WRONG_PARAMETER_TYPE", pClass.getName()); } -return pClass.cast(result); +try { +return pClass.cast(result); +} catch (ClassCastException ex) { +reportServerError("WRONG_PARAMETER_TYPE", pClass.getName()); +return null; +} } private static RuntimeException createParamConversionException(ParameterType pType, Exception ex) { http://git-wip-us.apache.org/repos/asf/cxf/blob/1387abab/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/InjectionUtilsTest.java -- diff --git a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/InjectionUtilsTest.java b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/InjectionUtilsTest.java index 198f4fb..cc9ea7c 100644 --- a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/InjectionUtilsTest.java +++ b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/InjectionUtilsTest.java @@ -35,6 +35,7 @@ import java.util.SortedSet; import java.util.TreeSet; import javax.validation.constraints.NotNull; +import javax.ws.rs.InternalServerErrorException; import javax.ws.rs.QueryParam; import javax.ws.rs.core.Application; import javax.ws.rs.core.MultivaluedMap; @@ -42,6 +43,7 @@ import javax.xml.bind.annotation.adapters.XmlAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import com.migesok.jaxb.adapter.javatime.LocalDateXmlAdapter; + import org.apache.cxf.endpoint.Endpoint; import org.apache.cxf.jaxrs.model.ParameterType; import org.apache.cxf.jaxrs.provider.ProviderFactory; @@ -53,7 +55,6 @@ import org.apache.cxf.message.MessageImpl; import org.easymock.EasyMock; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; public class InjectionUtilsTest extends Assert { @@ -183,8 +184,7 @@ public class InjectionUtilsTest extends Assert { assertEquals(String.class, list.getActualTypeArguments()[0]); } -@Ignore("CXF-7442") -@Test +@Test(expected = InternalServerErrorException.class) public void testJsr310DateExceptionHandling() { Field field = CustomerDetailsWithAdapter.class.getDeclaredFields()[0]; Annotation[] paramAnns = field.getDeclaredAnnotations();
cxf git commit: [CXF-7440] Adding the variants as part of build() too
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 528cce137 -> 41433c71d [CXF-7440] Adding the variants as part of build() too Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/41433c71 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/41433c71 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/41433c71 Branch: refs/heads/3.0.x-fixes Commit: 41433c71dcb95dcb402edbbe7b271ebcbb668724 Parents: 528cce1 Author: Sergey BeryozkinAuthored: Tue Jul 11 17:37:55 2017 +0100 Committer: Sergey Beryozkin Committed: Tue Jul 11 17:49:30 2017 +0100 -- .../cxf/jaxrs/impl/VariantListBuilderImpl.java| 1 + .../jaxrs/impl/VariantListBuilderImplTest.java| 18 ++ 2 files changed, 19 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/41433c71/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImpl.java -- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImpl.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImpl.java index 2e07d60..17db0aa 100644 --- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImpl.java +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImpl.java @@ -49,6 +49,7 @@ public class VariantListBuilderImpl extends VariantListBuilder { @Override public List build() { +addVariants(); List vs = new ArrayList(variants); reset(); return vs; http://git-wip-us.apache.org/repos/asf/cxf/blob/41433c71/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImplTest.java -- diff --git a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImplTest.java b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImplTest.java index 8a31dd5..2acdfbb 100644 --- a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImplTest.java +++ b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImplTest.java @@ -49,6 +49,24 @@ public class VariantListBuilderImplTest extends Assert { } @Test +public void testBuildAllWithoutAdd() { +VariantListBuilderImpl vb = new VariantListBuilderImpl(); +MediaType mt1 = new MediaType("*", "*"); +MediaType mt2 = new MediaType("text", "xml"); +List variants = vb.mediaTypes(mt1, mt2) +.languages(new Locale("en"), new Locale("fr")).encodings("zip", "identity").build(); +assertEquals("8 variants need to be created", 8, variants.size()); +assertTrue(verifyVariant(variants, new Variant(mt1, new Locale("en"), "zip"))); +assertTrue(verifyVariant(variants, new Variant(mt1, new Locale("en"), "identity"))); +assertTrue(verifyVariant(variants, new Variant(mt1, new Locale("fr"), "zip"))); +assertTrue(verifyVariant(variants, new Variant(mt1, new Locale("fr"), "identity"))); +assertTrue(verifyVariant(variants, new Variant(mt2, new Locale("en"), "zip"))); +assertTrue(verifyVariant(variants, new Variant(mt2, new Locale("en"), "identity"))); +assertTrue(verifyVariant(variants, new Variant(mt2, new Locale("fr"), "zip"))); +assertTrue(verifyVariant(variants, new Variant(mt2, new Locale("fr"), "identity"))); +} + +@Test public void testBuildTypeAndEnc() { VariantListBuilderImpl vb = new VariantListBuilderImpl(); MediaType mt1 = new MediaType("*", "*");
cxf git commit: [CXF-7440] Adding the variants as part of build() too
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes f1562f199 -> 11308 [CXF-7440] Adding the variants as part of build() too Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1130 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1130 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1130 Branch: refs/heads/3.1.x-fixes Commit: 11308a3b84f1b4a7ffda9f8e859ba82508d1 Parents: f1562f1 Author: Sergey BeryozkinAuthored: Tue Jul 11 17:37:55 2017 +0100 Committer: Sergey Beryozkin Committed: Tue Jul 11 17:48:08 2017 +0100 -- .../cxf/jaxrs/impl/VariantListBuilderImpl.java| 1 + .../jaxrs/impl/VariantListBuilderImplTest.java| 18 ++ 2 files changed, 19 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/1130/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImpl.java -- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImpl.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImpl.java index 2e07d60..17db0aa 100644 --- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImpl.java +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImpl.java @@ -49,6 +49,7 @@ public class VariantListBuilderImpl extends VariantListBuilder { @Override public List build() { +addVariants(); List vs = new ArrayList(variants); reset(); return vs; http://git-wip-us.apache.org/repos/asf/cxf/blob/1130/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImplTest.java -- diff --git a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImplTest.java b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImplTest.java index 8a31dd5..2acdfbb 100644 --- a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImplTest.java +++ b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImplTest.java @@ -49,6 +49,24 @@ public class VariantListBuilderImplTest extends Assert { } @Test +public void testBuildAllWithoutAdd() { +VariantListBuilderImpl vb = new VariantListBuilderImpl(); +MediaType mt1 = new MediaType("*", "*"); +MediaType mt2 = new MediaType("text", "xml"); +List variants = vb.mediaTypes(mt1, mt2) +.languages(new Locale("en"), new Locale("fr")).encodings("zip", "identity").build(); +assertEquals("8 variants need to be created", 8, variants.size()); +assertTrue(verifyVariant(variants, new Variant(mt1, new Locale("en"), "zip"))); +assertTrue(verifyVariant(variants, new Variant(mt1, new Locale("en"), "identity"))); +assertTrue(verifyVariant(variants, new Variant(mt1, new Locale("fr"), "zip"))); +assertTrue(verifyVariant(variants, new Variant(mt1, new Locale("fr"), "identity"))); +assertTrue(verifyVariant(variants, new Variant(mt2, new Locale("en"), "zip"))); +assertTrue(verifyVariant(variants, new Variant(mt2, new Locale("en"), "identity"))); +assertTrue(verifyVariant(variants, new Variant(mt2, new Locale("fr"), "zip"))); +assertTrue(verifyVariant(variants, new Variant(mt2, new Locale("fr"), "identity"))); +} + +@Test public void testBuildTypeAndEnc() { VariantListBuilderImpl vb = new VariantListBuilderImpl(); MediaType mt1 = new MediaType("*", "*");
[2/2] cxf git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cxf
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cxf Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4be70446 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4be70446 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4be70446 Branch: refs/heads/master Commit: 4be7044693681d6263658821ff620ba1cd8ec62b Parents: 85e7521 e0bbfe4 Author: Sergey BeryozkinAuthored: Tue Jul 11 17:38:20 2017 +0100 Committer: Sergey Beryozkin Committed: Tue Jul 11 17:38:20 2017 +0100 -- .../sts/rest/RESTSecurityTokenServiceImpl.java | 1 + .../provider/jwt/DefaultJWTClaimsProvider.java | 23 +- .../cxf/sts/token/provider/JWTClaimsTest.java | 75 .../cxf/systest/sts/rest/STSRESTTest.java | 7 +- .../cxf/systest/sts/rest/cxf-rest-sts.xml | 7 ++ 5 files changed, 108 insertions(+), 5 deletions(-) --
[1/2] cxf git commit: [CXF-7440] Adding the variants as part of build() too
Repository: cxf Updated Branches: refs/heads/master e0bbfe4a0 -> 4be704469 [CXF-7440] Adding the variants as part of build() too Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/85e75210 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/85e75210 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/85e75210 Branch: refs/heads/master Commit: 85e75210eda97bc9e31b6c2ace07865e4df0ef86 Parents: 30ac794 Author: Sergey BeryozkinAuthored: Tue Jul 11 17:37:55 2017 +0100 Committer: Sergey Beryozkin Committed: Tue Jul 11 17:37:55 2017 +0100 -- .../cxf/jaxrs/impl/VariantListBuilderImpl.java| 1 + .../jaxrs/impl/VariantListBuilderImplTest.java| 18 ++ 2 files changed, 19 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/85e75210/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImpl.java -- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImpl.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImpl.java index ce1cc2d..a2cce93 100644 --- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImpl.java +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImpl.java @@ -49,6 +49,7 @@ public class VariantListBuilderImpl extends VariantListBuilder { @Override public List build() { +addVariants(); List vs = new ArrayList<>(variants); reset(); return vs; http://git-wip-us.apache.org/repos/asf/cxf/blob/85e75210/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImplTest.java -- diff --git a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImplTest.java b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImplTest.java index 1a7d8a9..572d39e 100644 --- a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImplTest.java +++ b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/VariantListBuilderImplTest.java @@ -47,6 +47,24 @@ public class VariantListBuilderImplTest extends Assert { assertTrue(verifyVariant(variants, new Variant(mt2, new Locale("fr"), "zip"))); assertTrue(verifyVariant(variants, new Variant(mt2, new Locale("fr"), "identity"))); } + +@Test +public void testBuildAllWithoutAdd() { +VariantListBuilderImpl vb = new VariantListBuilderImpl(); +MediaType mt1 = new MediaType("*", "*"); +MediaType mt2 = new MediaType("text", "xml"); +List variants = vb.mediaTypes(mt1, mt2) +.languages(new Locale("en"), new Locale("fr")).encodings("zip", "identity").build(); +assertEquals("8 variants need to be created", 8, variants.size()); +assertTrue(verifyVariant(variants, new Variant(mt1, new Locale("en"), "zip"))); +assertTrue(verifyVariant(variants, new Variant(mt1, new Locale("en"), "identity"))); +assertTrue(verifyVariant(variants, new Variant(mt1, new Locale("fr"), "zip"))); +assertTrue(verifyVariant(variants, new Variant(mt1, new Locale("fr"), "identity"))); +assertTrue(verifyVariant(variants, new Variant(mt2, new Locale("en"), "zip"))); +assertTrue(verifyVariant(variants, new Variant(mt2, new Locale("en"), "identity"))); +assertTrue(verifyVariant(variants, new Variant(mt2, new Locale("fr"), "zip"))); +assertTrue(verifyVariant(variants, new Variant(mt2, new Locale("fr"), "identity"))); +} @Test public void testBuildTypeAndEnc() {
[3/7] cxf-fediz git commit: FEDIZ-204 - Drop Tomcat7, Jetty8, Spring Sec 2 containers
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e392e637/systests/tomcat7/src/test/java/org/apache/cxf/fediz/integrationtests/TestCallbackHandler.java -- diff --git a/systests/tomcat7/src/test/java/org/apache/cxf/fediz/integrationtests/TestCallbackHandler.java b/systests/tomcat7/src/test/java/org/apache/cxf/fediz/integrationtests/TestCallbackHandler.java deleted file mode 100644 index 776b458..000 --- a/systests/tomcat7/src/test/java/org/apache/cxf/fediz/integrationtests/TestCallbackHandler.java +++ /dev/null @@ -1,48 +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.fediz.integrationtests; - -import java.io.IOException; - -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.UnsupportedCallbackException; - -import org.apache.cxf.fediz.core.spi.WReqCallback; - -public class TestCallbackHandler implements CallbackHandler { - -static final String TEST_WREQ = -"http://docs.oasis-open.org/ws-sx/ws-trust/200512\;>" -+ "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1" -+ ""; - -public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { -for (int i = 0; i < callbacks.length; i++) { -if (callbacks[i] instanceof WReqCallback) { -WReqCallback callback = (WReqCallback) callbacks[i]; -callback.setWreq(TEST_WREQ); -} else { -throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback"); -} -} -} - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e392e637/systests/tomcat7/src/test/java/org/apache/cxf/fediz/integrationtests/TomcatTest.java -- diff --git a/systests/tomcat7/src/test/java/org/apache/cxf/fediz/integrationtests/TomcatTest.java b/systests/tomcat7/src/test/java/org/apache/cxf/fediz/integrationtests/TomcatTest.java deleted file mode 100644 index b5e10c9..000 --- a/systests/tomcat7/src/test/java/org/apache/cxf/fediz/integrationtests/TomcatTest.java +++ /dev/null @@ -1,172 +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.fediz.integrationtests; - - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; - -import javax.servlet.ServletException; - -import org.apache.catalina.Context; -import org.apache.catalina.LifecycleException; -import org.apache.catalina.LifecycleState; -import org.apache.catalina.connector.Connector; -import org.apache.catalina.startup.Tomcat; -import org.apache.commons.io.IOUtils; -import org.apache.cxf.fediz.tomcat7.FederationAuthenticator; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; - -public class TomcatTest extends AbstractTests { - -static String idpHttpsPort; -static String rpHttpsPort; - -private static Tomcat idpServer; -private static Tomcat rpServer; - -@BeforeClass -public static void init() throws Exception { -System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog"); -
[5/7] cxf-fediz git commit: FEDIZ-204 - Drop Tomcat7, Jetty8, Spring Sec 2 containers
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e392e637/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/FederationAuthenticator.java -- diff --git a/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/FederationAuthenticator.java b/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/FederationAuthenticator.java deleted file mode 100644 index 6b39c13..000 --- a/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/FederationAuthenticator.java +++ /dev/null @@ -1,435 +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.fediz.tomcat7; - -import java.io.File; -import java.io.IOException; -import java.security.Principal; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.bind.JAXBException; - -import org.w3c.dom.Element; - -import org.apache.catalina.LifecycleException; -import org.apache.catalina.Session; -import org.apache.catalina.authenticator.Constants; -import org.apache.catalina.authenticator.FormAuthenticator; -import org.apache.catalina.authenticator.SavedRequest; -import org.apache.catalina.connector.Request; -import org.apache.catalina.connector.Response; -import org.apache.catalina.deploy.LoginConfig; -import org.apache.cxf.fediz.core.FederationConstants; -import org.apache.cxf.fediz.core.FedizPrincipal; -import org.apache.cxf.fediz.core.config.FedizConfigurator; -import org.apache.cxf.fediz.core.config.FedizContext; -import org.apache.cxf.fediz.core.exception.ProcessingException; -import org.apache.cxf.fediz.core.handler.LogoutHandler; -import org.apache.cxf.fediz.core.metadata.MetadataDocumentHandler; -import org.apache.cxf.fediz.core.processor.FedizProcessor; -import org.apache.cxf.fediz.core.processor.FedizProcessorFactory; -import org.apache.cxf.fediz.core.processor.FedizResponse; -import org.apache.cxf.fediz.core.processor.RedirectionResponse; -import org.apache.cxf.fediz.tomcat7.handler.TomcatLogoutHandler; -import org.apache.cxf.fediz.tomcat7.handler.TomcatSigninHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class FederationAuthenticator extends FormAuthenticator { - -public static final String SESSION_SAVED_REQUEST_PREFIX = "SAVED_REQUEST_"; -public static final String SESSION_SAVED_URI_PREFIX = "SAVED_URI_"; -public static final String FEDERATION_NOTE = "org.apache.cxf.fediz.tomcat.FEDERATION"; -public static final String REQUEST_STATE = "org.apache.cxf.fediz.REQUEST_STATE"; -public static final String SECURITY_TOKEN = "org.apache.fediz.SECURITY_TOKEN"; - -/** - * Descriptive information about this implementation. - */ -protected static final String INFO = "org.apache.cxf.fediz.tomcat.WsFedAuthenticator/1.0"; -protected static final String TRUSTED_ISSUER = "org.apache.cxf.fediz.tomcat.TRUSTED_ISSUER"; - -private static final Logger LOG = LoggerFactory.getLogger(FormAuthenticator.class); - -/** - * Fediz Configuration file - */ -protected String configFile; -protected String encoding = "UTF-8"; - -private FedizConfigurator configurator; - -public FederationAuthenticator() { -LOG.debug("WsFedAuthenticator()"); -} - -/** - * Return descriptive information about this Valve implementation. - */ -@Override -public String getInfo() { -return INFO; -} - -public String getConfigFile() { -return configFile; -} - -public void setConfigFile(String configFile) { -this.configFile = configFile; -} - -public String getEncoding() { -return encoding; -} - -public void setEncoding(String encoding) { -this.encoding = encoding; -} - -@Override -protected synchronized void startInternal() throws LifecycleException { - -try { -File f = new File(getConfigFile()); -if (!f.exists()) { -String catalinaBase = System.getProperty("catalina.base"); -
[4/7] cxf-fediz git commit: FEDIZ-204 - Drop Tomcat7, Jetty8, Spring Sec 2 containers
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e392e637/systests/jetty8/src/test/resources/fediz_config_client_cert.xml -- diff --git a/systests/jetty8/src/test/resources/fediz_config_client_cert.xml b/systests/jetty8/src/test/resources/fediz_config_client_cert.xml deleted file mode 100644 index e8bd2d1..000 --- a/systests/jetty8/src/test/resources/fediz_config_client_cert.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - urn:org:apache:cxf:fediz:fedizhelloworld - - - - - - - - - -1000 - - - -http://www.w3.org/2001/XMLSchema-instance; -xsi:type="federationProtocolType" version="1.0.0"> -urn:org:apache:cxf:fediz:fedizhelloworld - https://localhost:${idp.https.port}/fediz-idp/federation -, - http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role -10 -urn:org:apache:cxf:fediz:idp:realm-A - -http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role; optional="false" /> - http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname; optional="true" /> - http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname; optional="true" /> - http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress; optional="true" /> - - http://docs.oasis-open.org/wsfed/authorization/200706/authntypes/Ssl -org.apache.cxf.fediz.integrationtests.HOKCallbackHandler - -/secure/logout -/index.html - - - - urn:org:apache:cxf:fediz:fedizhelloworld - - - - - - - - - -1000 - - - -http://www.w3.org/2001/XMLSchema-instance; -xsi:type="federationProtocolType" version="1.0.0"> -urn:org:apache:cxf:fediz:fedizhelloworld - https://localhost:${idp.https.port}/fediz-idp/federation -, - http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role -10 -urn:org:apache:cxf:fediz:idp:realm-A - -http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role; optional="false" /> - http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname; optional="true" /> - http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname; optional="true" /> - http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress; optional="true" /> - - http://docs.oasis-open.org/wsfed/authorization/200706/authntypes/Ssl -org.apache.cxf.fediz.integrationtests.HOKCallbackHandler - -/secure/logout -/index.html - - - - http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e392e637/systests/jetty8/src/test/resources/idp-server.xml -- diff --git a/systests/jetty8/src/test/resources/idp-server.xml b/systests/jetty8/src/test/resources/idp-server.xml deleted file mode 100644 index 1a246e2..000 --- a/systests/jetty8/src/test/resources/idp-server.xml +++ /dev/null @@ -1,79 +0,0 @@ - - -http://www.eclipse.org/jetty/configure.dtd;> - - - - - -org.apache.jasper.compiler.disablejsr199 -true - - - - - - true - - - - - - - - - ./target/test-classes/server.jks - tompass - tompass - ./target/test-classes/server.jks - tompass - true - - - ${idp.https.port} - 3 - - - - - - - - - - - /fediz-idp - ./target/idp/fediz-idp.war - true - - - - - /fediz-idp-sts - ./target/idp/fediz-idp-sts.war - true - - - - - - - - http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e392e637/systests/jetty8/src/test/resources/logging.properties -- diff --git a/systests/jetty8/src/test/resources/logging.properties b/systests/jetty8/src/test/resources/logging.properties deleted file mode 100644 index 0d8d902..000 ---
[6/7] cxf-fediz git commit: FEDIZ-204 - Drop Tomcat7, Jetty8, Spring Sec 2 containers
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e392e637/plugins/jetty8/src/main/java/org/apache/cxf/fediz/jetty8/FederationLoginService.java -- diff --git a/plugins/jetty8/src/main/java/org/apache/cxf/fediz/jetty8/FederationLoginService.java b/plugins/jetty8/src/main/java/org/apache/cxf/fediz/jetty8/FederationLoginService.java deleted file mode 100644 index 353d946..000 --- a/plugins/jetty8/src/main/java/org/apache/cxf/fediz/jetty8/FederationLoginService.java +++ /dev/null @@ -1,174 +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.fediz.jetty8; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.List; - -import javax.security.auth.Subject; - -import org.apache.cxf.fediz.core.config.FedizContext; -import org.apache.cxf.fediz.core.exception.ProcessingException; -import org.apache.cxf.fediz.core.processor.FedizProcessor; -import org.apache.cxf.fediz.core.processor.FedizProcessorFactory; -import org.apache.cxf.fediz.core.processor.FedizRequest; -import org.apache.cxf.fediz.core.processor.FedizResponse; -import org.eclipse.jetty.security.IdentityService; -import org.eclipse.jetty.security.LoginService; -import org.eclipse.jetty.server.UserIdentity; -import org.eclipse.jetty.util.component.AbstractLifeCycle; -import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.log.Logger; - -public class FederationLoginService extends AbstractLifeCycle implements LoginService { -private static final Logger LOG = Log.getLogger(FederationLoginService.class); - -protected IdentityService identityService = new FederationIdentityService(); -protected String name; - - -public FederationLoginService() { -} - -public FederationLoginService(String name) { -this.name = name; -} - -@Override -public String getName() { -return name; -} - -public void setName(String name) { -if (isRunning()) { -throw new IllegalStateException("Running"); -} - -this.name = name; -} - -@Override -protected void doStart() throws Exception { -LOG.debug("doStart"); -super.doStart(); -} - -/** - * username will be null since the credentials will contain all the relevant info - */ -public UserIdentity login(String username, Object credentials, FedizContext config) { - -try { -FedizResponse wfRes = null; -FedizRequest wfReq = (FedizRequest)credentials; - -if (LOG.isDebugEnabled()) { -LOG.debug("Process SignIn request"); -LOG.debug("token=\n" + wfReq.getResponseToken()); -} - -FedizProcessor wfProc = -FedizProcessorFactory.newFedizProcessor(config.getProtocol()); -try { -wfRes = wfProc.processRequest(wfReq, config); -} catch (ProcessingException ex) { -LOG.warn("Federation processing failed: " + ex.getMessage()); -return null; -} - - -// Validate the AudienceRestriction in Security Token (e.g. SAML) -// against the configured list of audienceURIs -if (wfRes.getAudience() != null) { -List audienceURIs = config.getAudienceUris(); -boolean validAudience = false; -for (String a : audienceURIs) { -if (wfRes.getAudience().startsWith(a)) { -validAudience = true; -break; -} -} - -if (!validAudience) { -LOG.warn("Token AudienceRestriction [" + wfRes.getAudience() - + "] doesn't match with specified list of URIs."); -return null; -} -} - -// Add "Authenticated" role -List roles = wfRes.getRoles(); -if (roles == null || roles.isEmpty()) { -roles = Collections.singletonList("Authenticated"); -} else if (config.isAddAuthenticatedRole()) {
[7/7] cxf-fediz git commit: FEDIZ-204 - Drop Tomcat7, Jetty8, Spring Sec 2 containers
FEDIZ-204 - Drop Tomcat7, Jetty8, Spring Sec 2 containers Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/e392e637 Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/e392e637 Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/e392e637 Branch: refs/heads/master Commit: e392e637f2528cb363b882a55d1ac8b7e8f8b293 Parents: 41bed79 Author: Colm O hEigeartaighAuthored: Tue Jul 11 17:19:29 2017 +0100 Committer: Colm O hEigeartaigh Committed: Tue Jul 11 17:19:29 2017 +0100 -- apache-fediz/pom.xml| 15 - apache-fediz/src/assembly/bin.xml | 69 --- examples/pom.xml| 1 - examples/spring2Webapp/README.txt | 81 --- examples/spring2Webapp/pom.xml | 134 - .../cxf/fediz/example/FederationServlet.java| 125 .../src/main/resources/log4j.properties | 22 - .../src/main/resources/ststrust.jks | Bin 4052 -> 0 bytes .../WEB-INF/applicationContext-security.xml | 67 --- .../src/main/webapp/WEB-INF/fediz_config.xml| 55 -- .../src/main/webapp/WEB-INF/web.xml | 77 --- .../spring2Webapp/src/main/webapp/index.html| 25 - .../src/main/webapp/secure/test.html| 25 - examples/wsclientWebapp/webapp/pom.xml | 2 +- plugins/jetty8/README.txt | 10 - plugins/jetty8/pom.xml | 147 - plugins/jetty8/src/main/assembly/assembly.xml | 37 -- .../fediz/jetty8/FederationAuthenticator.java | 594 --- .../fediz/jetty8/FederationIdentityService.java | 92 --- .../fediz/jetty8/FederationLoginService.java| 174 -- .../fediz/jetty8/FederationUserIdentity.java| 94 --- .../fediz/jetty8/FederationUserPrincipal.java | 71 --- plugins/pom.xml | 3 - plugins/spring2/README.txt | 20 - plugins/spring2/pom.xml | 119 plugins/spring2/src/main/assembly/assembly.xml | 37 -- .../cxf/fediz/spring/FederationConfig.java | 33 -- .../cxf/fediz/spring/FederationConfigImpl.java | 106 .../apache/cxf/fediz/spring/FederationUser.java | 53 -- .../fediz/spring/SpringFedizMessageSource.java | 45 -- .../AbstractFederationUserDetailsService.java | 55 -- .../authentication/ExpiredTokenException.java | 35 -- .../FederationAuthenticationProvider.java | 169 -- .../FederationAuthenticationToken.java | 107 .../FederationResponseAuthenticationToken.java | 50 -- ...AuthoritiesUserDetailsFederationService.java | 67 --- ...erationPreAuthenticatedProcessingFilter.java | 80 --- ...AuthoritiesUserDetailsFederationService.java | 91 --- .../web/FederationAuthenticationEntryPoint.java | 155 - .../web/FederationAuthenticationFilter.java | 227 --- .../apache/cxf/fediz/spring/messages.properties | 2 - plugins/tomcat7/README.txt | 10 - plugins/tomcat7/pom.xml | 77 --- plugins/tomcat7/src/main/assembly/assembly.xml | 37 -- .../fediz/tomcat7/FederationAuthenticator.java | 435 -- .../fediz/tomcat7/FederationPrincipalImpl.java | 60 -- .../tomcat7/handler/TomcatLogoutHandler.java| 58 -- .../tomcat7/handler/TomcatSigninHandler.java| 89 --- .../src/test/resources/logging.properties | 52 -- pom.xml | 3 - systests/custom/pom.xml | 18 +- .../systests/custom/CustomParametersTest.java | 2 +- systests/cxf/pom.xml| 16 +- systests/federation/samlsso/pom.xml | 18 +- systests/federation/wsfed/pom.xml | 18 +- .../cxf/fediz/integrationtests/WSFedTest.java | 2 +- systests/idp/pom.xml| 18 +- systests/jetty8/pom.xml | 300 -- .../ClientCertificatePreAuthSpringTest.java | 98 --- .../integrationtests/ClientCertificateTest.java | 98 --- .../integrationtests/HOKCallbackHandler.java| 48 -- .../JettyPreAuthSpringTest.java | 83 --- .../cxf/fediz/integrationtests/JettyTest.java | 82 --- .../cxf/fediz/integrationtests/JettyUtils.java | 105 .../jetty8/src/test/resources/fediz_config.xml | 95 --- .../test/resources/fediz_config_client_cert.xml | 99 .../jetty8/src/test/resources/idp-server.xml| 79 --- .../src/test/resources/logging.properties | 54 -- .../test/resources/rp-client-cert-server.xml| 99 .../jetty8/src/test/resources/rp-server.xml | 96 --- systests/jetty9/pom.xml | 17 - systests/kerberos/pom.xml | 18 +-
[1/7] cxf-fediz git commit: Updating jdk version
Repository: cxf-fediz Updated Branches: refs/heads/master 7263bb9ea -> e392e637f Updating jdk version Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/41bed79e Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/41bed79e Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/41bed79e Branch: refs/heads/master Commit: 41bed79e17b69590109b32c52172c79fa2ab221b Parents: 7263bb9 Author: Colm O hEigeartaighAuthored: Tue Jul 11 15:30:14 2017 +0100 Committer: Colm O hEigeartaigh Committed: Tue Jul 11 15:30:14 2017 +0100 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/41bed79e/pom.xml -- diff --git a/pom.xml b/pom.xml index 8d09215..861c947 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ http://localhost:8080/manager/text UTF-8 UTF-8 -1.7 +1.8 false false
[2/7] cxf-fediz git commit: FEDIZ-204 - Drop Tomcat7, Jetty8, Spring Sec 2 containers
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e392e637/systests/webapps/spring2Webapp/src/main/webapp/WEB-INF/web.xml -- diff --git a/systests/webapps/spring2Webapp/src/main/webapp/WEB-INF/web.xml b/systests/webapps/spring2Webapp/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 4d3bbc4..000 --- a/systests/webapps/spring2Webapp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,95 +0,0 @@ - - -http://java.sun.com/xml/ns/javaee; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee - http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd; - version="3.0" metadata-complete="true"> - -WS Federation Spring Example -WS Federation Spring Example - - -springSecurityFilterChain - org.springframework.web.filter.DelegatingFilterProxy - - - - -FederationFilter - org.apache.cxf.fediz.core.servlet.FederationFilter - - - -springSecurityFilterChain -/* - - - -FederationFilter -/secure/* - - - - - -contextConfigLocation - -/WEB-INF/applicationContext-security.xml - - - - - - org.springframework.web.context.ContextLoaderListener - - - -FederationServlet - org.apache.cxf.fediz.example.FederationServlet - - - -FederationServlet -/secure/fedservlet - - - -FederationServlet -/secure/admin/fedservlet - - - -FederationServlet -/secure/user/fedservlet - - - -FederationServlet -/secure/manager/fedservlet - - - http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e392e637/systests/webapps/spring2Webapp/src/main/webapp/index.html -- diff --git a/systests/webapps/spring2Webapp/src/main/webapp/index.html b/systests/webapps/spring2Webapp/src/main/webapp/index.html deleted file mode 100644 index a9dbdaa..000 --- a/systests/webapps/spring2Webapp/src/main/webapp/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - -WS Federation Tomcat Examples - - - - -Hello World - - http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e392e637/systests/webapps/spring2Webapp/src/main/webapp/secure/test.html -- diff --git a/systests/webapps/spring2Webapp/src/main/webapp/secure/test.html b/systests/webapps/spring2Webapp/src/main/webapp/secure/test.html deleted file mode 100644 index 9cf7366..000 --- a/systests/webapps/spring2Webapp/src/main/webapp/secure/test.html +++ /dev/null @@ -1,25 +0,0 @@ - - -WS Federation Tomcat Examples - - - - -Secure Test - - http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e392e637/systests/websphere/pom.xml -- diff --git a/systests/websphere/pom.xml b/systests/websphere/pom.xml index d579975..c3e31c2 100644 --- a/systests/websphere/pom.xml +++ b/systests/websphere/pom.xml @@ -40,25 +40,13 @@ org.apache.tomcat.embed tomcat-embed-core -${tomcat7.version} -test - - -org.apache.tomcat.embed -tomcat-embed-logging-juli -${tomcat7.version} -test - - -org.eclipse.jdt.core.compiler -ecj -${ecj.version} +${tomcat8.version} test org.apache.tomcat.embed tomcat-embed-jasper -${tomcat7.version} +${tomcat8.version} test @@ -69,7 +57,7 @@ org.apache.cxf.fediz -fediz-tomcat7 +fediz-tomcat8 ${project.version} test
cxf-fediz git commit: Updating master to 2.0.0-SNAPSHOT
Repository: cxf-fediz Updated Branches: refs/heads/master 6392d4f75 -> 7263bb9ea Updating master to 2.0.0-SNAPSHOT Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/7263bb9e Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/7263bb9e Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/7263bb9e Branch: refs/heads/master Commit: 7263bb9eab6f49eff8d0e4ca942be43a725bd73e Parents: 6392d4f Author: Colm O hEigeartaighAuthored: Tue Jul 11 14:44:09 2017 +0100 Committer: Colm O hEigeartaigh Committed: Tue Jul 11 14:44:09 2017 +0100 -- apache-fediz/pom.xml | 4 ++-- examples/jaxrsCxfPluginWebapp/pom.xml | 2 +- examples/jaxrsSimpleWebapp/pom.xml | 2 +- examples/jaxrsSpringSecurityWebapp/pom.xml | 2 +- examples/pom.xml | 2 +- examples/simpleWebapp/pom.xml | 2 +- examples/spring2Webapp/pom.xml | 2 +- examples/springPreauthWebapp/pom.xml | 2 +- examples/springWebapp/pom.xml | 2 +- examples/wsclientWebapp/pom.xml| 2 +- examples/wsclientWebapp/webapp/pom.xml | 2 +- examples/wsclientWebapp/webservice/common/pom.xml | 2 +- examples/wsclientWebapp/webservice/pom.xml | 2 +- examples/wsclientWebapp/webservice/service/pom.xml | 2 +- plugins/core/pom.xml | 2 +- plugins/cxf/pom.xml| 2 +- plugins/jetty8/pom.xml | 2 +- plugins/jetty9/pom.xml | 2 +- plugins/pom.xml| 2 +- plugins/spring/pom.xml | 2 +- plugins/spring2/pom.xml| 2 +- plugins/spring3/pom.xml| 2 +- plugins/tomcat7/pom.xml| 2 +- plugins/tomcat8/pom.xml| 2 +- pom.xml| 2 +- services/idp-core/pom.xml | 2 +- services/idp/pom.xml | 2 +- services/oidc/pom.xml | 2 +- services/pom.xml | 2 +- services/sts/pom.xml | 2 +- systests/custom/pom.xml| 2 +- systests/cxf/pom.xml | 2 +- systests/federation/oidcIdpWebapp/pom.xml | 2 +- systests/federation/pom.xml| 2 +- systests/federation/samlIdpWebapp/pom.xml | 2 +- systests/federation/samlWebapp/pom.xml | 2 +- systests/federation/samlsso/pom.xml| 2 +- systests/federation/wsfed/pom.xml | 2 +- systests/idp/pom.xml | 2 +- systests/jetty8/pom.xml| 2 +- systests/jetty9/pom.xml| 2 +- systests/kerberos/pom.xml | 2 +- systests/ldap/pom.xml | 2 +- systests/oidc/pom.xml | 2 +- systests/pom.xml | 2 +- systests/samlsso/pom.xml | 2 +- systests/spring/pom.xml| 2 +- systests/tests/pom.xml | 2 +- systests/tomcat7/pom.xml | 2 +- systests/tomcat8/pom.xml | 2 +- systests/webapps/cxfWebapp/pom.xml | 2 +- systests/webapps/pom.xml | 2 +- systests/webapps/simpleWebapp/pom.xml | 2 +- systests/webapps/spring2Webapp/pom.xml | 2 +- systests/webapps/spring3Webapp/pom.xml | 2 +- systests/webapps/springPreauthWebapp/pom.xml | 2 +- systests/webapps/springWebapp/pom.xml | 2 +- 57 files changed, 58 insertions(+), 58 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/7263bb9e/apache-fediz/pom.xml -- diff --git a/apache-fediz/pom.xml b/apache-fediz/pom.xml index 327c4ce..45283d2 100644 --- a/apache-fediz/pom.xml +++ b/apache-fediz/pom.xml @@ -22,14 +22,14 @@ 4.0.0 org.apache.cxf.fediz apache-fediz -1.4.1-SNAPSHOT +2.0.0-SNAPSHOT Apache Fediz Assembly pom org.apache.cxf.fediz fediz -1.4.1-SNAPSHOT +2.0.0-SNAPSHOT http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/7263bb9e/examples/jaxrsCxfPluginWebapp/pom.xml -- diff --git
[cxf-fediz] Git Push Summary
Repository: cxf-fediz Updated Branches: refs/heads/1.4.x-fixes [created] 6392d4f75
cxf git commit: Recording .gitmergeinfo Changes
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 9a0a6de87 -> 528cce137 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/528cce13 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/528cce13 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/528cce13 Branch: refs/heads/3.0.x-fixes Commit: 528cce137e0ae0cf6a5414d64571db2c492eaa87 Parents: 9a0a6de Author: Colm O hEigeartaighAuthored: Tue Jul 11 13:21:34 2017 +0100 Committer: Colm O hEigeartaigh Committed: Tue Jul 11 13:21:34 2017 +0100 -- .gitmergeinfo | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/528cce13/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index a36ea92..f2cf828 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -1743,6 +1743,7 @@ B f0d50d5ec96a2237dbae7c36cc9039226a1ea84e B f10bfbdb56a0d24ea4f712a48eec24812c71c718 B f116182ef7a5a4bcc38086f62d654b8355279f5b B f12eb1a2a2eb2220550cb25dcc54d62127d55244 +B f1562f199a8956c30a5f44602b595580a7d0756c B f183b9f00a596ff645b30fdc0e4954f0bf26c80f B f18acbcdfc48aca354610614c0ba3a46dcb8332a B f26c82ef6ef82f3971e3019f9f43ec9e9685427a @@ -1811,6 +1812,7 @@ B fa96525a1a4e4131ae1ecc1900e948c93db7b696 B fada1bbc76067b5a1781bbd10773c2ff32571315 B fb069dc54d47d9f4358b1d450356a1cbe189 B fb1c2d90a1ef553760674433234f1f2976b15246 +B fb414c7abfb5de8bf95462a9de23335d4320af4e B fb669aaa365102309a9c975084f775953753fa49 B fb94440f6f1d5c7c572b6c0163f275c95073b8ee B fb9d26581c364c62c7343847ebe4136b8c97700f
[1/2] cxf git commit: Recording .gitmergeinfo Changes
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes af13152a7 -> f1562f199 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/f1562f19 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f1562f19 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f1562f19 Branch: refs/heads/3.1.x-fixes Commit: f1562f199a8956c30a5f44602b595580a7d0756c Parents: fb414c7 Author: Colm O hEigeartaighAuthored: Tue Jul 11 13:14:05 2017 +0100 Committer: Colm O hEigeartaigh Committed: Tue Jul 11 13:14:05 2017 +0100 -- .gitmergeinfo | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/f1562f19/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index 4a0c27f..4de5a48 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -681,6 +681,7 @@ M df3854cefae5d2da71f8d222a86218e81df7bd05 M df47c2d60100ac528b12f862166e3ac59d72f751 M e00b84269aa8112bf4073b69b58f933fda3ab497 M e0ace3dc71a45a9bee6223e550f2ad869581c12d +M e0bbfe4a0c8a17c2335d08aec558c98fdebbf07d M e0ed46f9f99ac1ec3e0925b3e5666e0b7a69af53 M e4cb2ea437185caa28b95a2344ffa8aa0ba516b7 M e578ea946aa13177adef98727e3e4606652ffc76
[2/2] cxf git commit: Add the ability to set a custom claim type in the generated token
Add the ability to set a custom claim type in the generated token # Conflicts: # services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/DefaultJWTClaimsProvider.java # services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/JWTClaimsTest.java # services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/rest/STSRESTTest.java Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/fb414c7a Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/fb414c7a Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/fb414c7a Branch: refs/heads/3.1.x-fixes Commit: fb414c7abfb5de8bf95462a9de23335d4320af4e Parents: af13152 Author: Colm O hEigeartaighAuthored: Tue Jul 11 13:11:49 2017 +0100 Committer: Colm O hEigeartaigh Committed: Tue Jul 11 13:14:05 2017 +0100 -- .../sts/rest/RESTSecurityTokenServiceImpl.java | 1 + .../provider/jwt/DefaultJWTClaimsProvider.java | 29 +++- .../cxf/sts/token/provider/JWTClaimsTest.java | 77 +++- .../cxf/systest/sts/rest/STSRESTTest.java | 14 ++-- .../cxf/systest/sts/rest/cxf-rest-sts.xml | 7 ++ 5 files changed, 115 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/fb414c7a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java -- diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java index bcc31a4..f3d0719 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java @@ -77,6 +77,7 @@ public class RESTSecurityTokenServiceImpl extends SecurityTokenServiceImpl imple DEFAULT_CLAIM_TYPE_MAP = new HashMap (); DEFAULT_CLAIM_TYPE_MAP.put("emailaddress", CLAIM_TYPE_NS + "/claims/emailaddress"); DEFAULT_CLAIM_TYPE_MAP.put("role", CLAIM_TYPE_NS + "/claims/role"); +DEFAULT_CLAIM_TYPE_MAP.put("roles", CLAIM_TYPE_NS + "/claims/role"); DEFAULT_CLAIM_TYPE_MAP.put("surname", CLAIM_TYPE_NS + "/claims/surname"); DEFAULT_CLAIM_TYPE_MAP.put("givenname", CLAIM_TYPE_NS + "/claims/givenname"); DEFAULT_CLAIM_TYPE_MAP.put("name", CLAIM_TYPE_NS + "/claims/name"); http://git-wip-us.apache.org/repos/asf/cxf/blob/fb414c7a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/DefaultJWTClaimsProvider.java -- diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/DefaultJWTClaimsProvider.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/DefaultJWTClaimsProvider.java index fee93df..6b4ffe0 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/DefaultJWTClaimsProvider.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/DefaultJWTClaimsProvider.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.UUID; import java.util.logging.Logger; @@ -60,7 +61,8 @@ public class DefaultJWTClaimsProvider implements JWTClaimsProvider { private boolean failLifetimeExceedance = true; private boolean acceptClientLifetime; private long futureTimeToLive = 60L; - +private Map claimTypeMap; + /** * Get a JwtClaims object. */ @@ -158,7 +160,7 @@ public class DefaultJWTClaimsProvider implements JWTClaimsProvider { if (claim.getValues().size() == 1) { claimValues = claim.getValues().get(0); } -claims.setProperty(claim.getClaimType().toString(), claimValues); + claims.setProperty(translateClaim(claim.getClaimType().toString()), claimValues); } } } @@ -277,7 +279,14 @@ public class DefaultJWTClaimsProvider implements JWTClaimsProvider { } } } - + +private String translateClaim(String claimType) { +if (claimTypeMap == null || !claimTypeMap.containsKey(claimType)) { +return claimType; +} +return claimTypeMap.get(claimType); +} + public boolean isUseX500CN() { return useX500CN; } @@ -366,5 +375,17 @@ public class
cxf git commit: Add the ability to set a custom claim type in the generated token
Repository: cxf Updated Branches: refs/heads/master 30ac7940b -> e0bbfe4a0 Add the ability to set a custom claim type in the generated token Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e0bbfe4a Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e0bbfe4a Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e0bbfe4a Branch: refs/heads/master Commit: e0bbfe4a0c8a17c2335d08aec558c98fdebbf07d Parents: 30ac794 Author: Colm O hEigeartaighAuthored: Tue Jul 11 13:11:49 2017 +0100 Committer: Colm O hEigeartaigh Committed: Tue Jul 11 13:12:44 2017 +0100 -- .../sts/rest/RESTSecurityTokenServiceImpl.java | 1 + .../provider/jwt/DefaultJWTClaimsProvider.java | 23 +- .../cxf/sts/token/provider/JWTClaimsTest.java | 75 .../cxf/systest/sts/rest/STSRESTTest.java | 7 +- .../cxf/systest/sts/rest/cxf-rest-sts.xml | 7 ++ 5 files changed, 108 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/e0bbfe4a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java -- diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java index 16b715c..b9c0030 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java @@ -77,6 +77,7 @@ public class RESTSecurityTokenServiceImpl extends SecurityTokenServiceImpl imple DEFAULT_CLAIM_TYPE_MAP = new HashMap<>(); DEFAULT_CLAIM_TYPE_MAP.put("emailaddress", CLAIM_TYPE_NS + "/claims/emailaddress"); DEFAULT_CLAIM_TYPE_MAP.put("role", CLAIM_TYPE_NS + "/claims/role"); +DEFAULT_CLAIM_TYPE_MAP.put("roles", CLAIM_TYPE_NS + "/claims/role"); DEFAULT_CLAIM_TYPE_MAP.put("surname", CLAIM_TYPE_NS + "/claims/surname"); DEFAULT_CLAIM_TYPE_MAP.put("givenname", CLAIM_TYPE_NS + "/claims/givenname"); DEFAULT_CLAIM_TYPE_MAP.put("name", CLAIM_TYPE_NS + "/claims/name"); http://git-wip-us.apache.org/repos/asf/cxf/blob/e0bbfe4a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/DefaultJWTClaimsProvider.java -- diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/DefaultJWTClaimsProvider.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/DefaultJWTClaimsProvider.java index 92c7b32b..09fa265 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/DefaultJWTClaimsProvider.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/DefaultJWTClaimsProvider.java @@ -26,6 +26,7 @@ import java.time.format.DateTimeParseException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.UUID; import java.util.logging.Logger; @@ -61,6 +62,7 @@ public class DefaultJWTClaimsProvider implements JWTClaimsProvider { private boolean failLifetimeExceedance = true; private boolean acceptClientLifetime; private long futureTimeToLive = 60L; +private Map claimTypeMap; /** * Get a JwtClaims object. @@ -159,7 +161,7 @@ public class DefaultJWTClaimsProvider implements JWTClaimsProvider { if (claim.getValues().size() == 1) { claimValues = claim.getValues().get(0); } -claims.setProperty(claim.getClaimType().toString(), claimValues); + claims.setProperty(translateClaim(claim.getClaimType().toString()), claimValues); } } } @@ -276,6 +278,13 @@ public class DefaultJWTClaimsProvider implements JWTClaimsProvider { } } +private String translateClaim(String claimType) { +if (claimTypeMap == null || !claimTypeMap.containsKey(claimType)) { +return claimType; +} +return claimTypeMap.get(claimType); +} + public boolean isUseX500CN() { return useX500CN; } @@ -365,4 +374,16 @@ public class DefaultJWTClaimsProvider implements JWTClaimsProvider { this.failLifetimeExceedance = failLifetimeExceedance; } +public Map getClaimTypeMap() { +return claimTypeMap; +} + +/** + * Specify a way to map ClaimType URIs to custom ClaimTypes + * @param claimTypeMap + */ +
cxf git commit: [CXF-7442] added testcase for ClassCastException
Repository: cxf Updated Branches: refs/heads/master af8a95bf9 -> 30ac7940b [CXF-7442] added testcase for ClassCastException Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/30ac7940 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/30ac7940 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/30ac7940 Branch: refs/heads/master Commit: 30ac7940b4ae32c5da30ac9a40e16556b0c0be0e Parents: af8a95b Author: Dennis KieselhorstAuthored: Tue Jul 11 13:16:51 2017 +0200 Committer: Dennis Kieselhorst Committed: Tue Jul 11 13:16:51 2017 +0200 -- .../cxf/jaxrs/utils/InjectionUtilsTest.java | 31 1 file changed, 31 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/30ac7940/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/InjectionUtilsTest.java -- diff --git a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/InjectionUtilsTest.java b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/InjectionUtilsTest.java index d600825..198f4fb 100644 --- a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/InjectionUtilsTest.java +++ b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/InjectionUtilsTest.java @@ -20,10 +20,13 @@ package org.apache.cxf.jaxrs.utils; import java.io.Serializable; import java.lang.annotation.Annotation; +import java.lang.reflect.Field; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; +import java.time.LocalDate; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -31,11 +34,14 @@ import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; +import javax.validation.constraints.NotNull; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.Application; import javax.ws.rs.core.MultivaluedMap; import javax.xml.bind.annotation.adapters.XmlAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.migesok.jaxb.adapter.javatime.LocalDateXmlAdapter; import org.apache.cxf.endpoint.Endpoint; import org.apache.cxf.jaxrs.model.ParameterType; import org.apache.cxf.jaxrs.provider.ProviderFactory; @@ -47,6 +53,7 @@ import org.apache.cxf.message.MessageImpl; import org.easymock.EasyMock; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; public class InjectionUtilsTest extends Assert { @@ -176,6 +183,15 @@ public class InjectionUtilsTest extends Assert { assertEquals(String.class, list.getActualTypeArguments()[0]); } +@Ignore("CXF-7442") +@Test +public void testJsr310DateExceptionHandling() { +Field field = CustomerDetailsWithAdapter.class.getDeclaredFields()[0]; +Annotation[] paramAnns = field.getDeclaredAnnotations(); + InjectionUtils.createParameterObject(Collections.singletonList("wrongDate"), LocalDate.class, +LocalDate.class, paramAnns, null, false, ParameterType.QUERY, createMessage()); +} + static class CustomerBean1 { private String a; private Long b; @@ -352,4 +368,19 @@ public class InjectionUtilsTest extends Assert { return new ArrayList<>(); } } + +public class CustomerDetailsWithAdapter { +@NotNull +@QueryParam("birthDate") +@XmlJavaTypeAdapter(LocalDateXmlAdapter.class) +private LocalDate birthDate; + +public LocalDate getBirthDate() { +return birthDate; +} + +public void setBirthDate(LocalDate birthDate) { +this.birthDate = birthDate; +} +} }
cxf git commit: [CXF-7085] Checking the preconfigured ScheduledExecutorService
Repository: cxf Updated Branches: refs/heads/master 706eacc5a -> cfdd0d36c [CXF-7085] Checking the preconfigured ScheduledExecutorService Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/cfdd0d36 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/cfdd0d36 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/cfdd0d36 Branch: refs/heads/master Commit: cfdd0d36c31d119d5846ccfdd623ab072c8a7682 Parents: 706eacc Author: Sergey BeryozkinAuthored: Tue Jul 11 12:08:07 2017 +0100 Committer: Sergey Beryozkin Committed: Tue Jul 11 12:08:07 2017 +0100 -- .../org/apache/cxf/jaxrs/sse/client/SseEventSourceImpl.java | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/cfdd0d36/rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/client/SseEventSourceImpl.java -- diff --git a/rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/client/SseEventSourceImpl.java b/rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/client/SseEventSourceImpl.java index fe5eae7..c932a60 100644 --- a/rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/client/SseEventSourceImpl.java +++ b/rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/client/SseEventSourceImpl.java @@ -160,7 +160,12 @@ public class SseEventSourceImpl implements SseEventSource { } // Create the executor for scheduling the reconnect tasks -executor = Executors.newSingleThreadScheduledExecutor(); +executor = + (ScheduledExecutorService)target.getConfiguration().getProperty("scheduledExecutorService"); +if (executor == null) { +executor = Executors.newSingleThreadScheduledExecutor(); +} + final Object lastEventId = target.getConfiguration().getProperty(HttpHeaders.LAST_EVENT_ID_HEADER); connect(lastEventId != null ? lastEventId.toString() : null);
cxf git commit: [CXF-6889] Checking the preconfigured ExecutorService
Repository: cxf Updated Branches: refs/heads/master 14e35b914 -> 706eacc5a [CXF-6889] Checking the preconfigured ExecutorService Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/706eacc5 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/706eacc5 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/706eacc5 Branch: refs/heads/master Commit: 706eacc5ae12e1c95085d2f8602c632c921e849e Parents: 14e35b9 Author: Sergey BeryozkinAuthored: Tue Jul 11 11:36:08 2017 +0100 Committer: Sergey Beryozkin Committed: Tue Jul 11 11:36:08 2017 +0100 -- .../org/apache/cxf/jaxrs/client/spec/ClientImpl.java | 3 ++- .../cxf/jaxrs/client/spec/InvocationBuilderImpl.java | 15 --- 2 files changed, 14 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/706eacc5/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java -- diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java index 12649d8..b23d85e 100644 --- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java +++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java @@ -306,7 +306,8 @@ public class ClientImpl implements Client { cxfFeature.initialize(clientCfg, clientCfg.getBus()); } // Start building the invocation -return new InvocationBuilderImpl(WebClient.fromClient(targetClient)); +return new InvocationBuilderImpl(WebClient.fromClient(targetClient), + configImpl); } private void setConnectionProperties(Map configProps, ClientConfiguration clientCfg) { Long connTimeOutValue = getLongValue(configProps.get(HTTP_CONNECTION_TIMEOUT_PROP)); http://git-wip-us.apache.org/repos/asf/cxf/blob/706eacc5/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/InvocationBuilderImpl.java -- diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/InvocationBuilderImpl.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/InvocationBuilderImpl.java index a053f7f..ab5fa96 100644 --- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/InvocationBuilderImpl.java +++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/InvocationBuilderImpl.java @@ -34,7 +34,9 @@ import javax.ws.rs.client.Invocation.Builder; import javax.ws.rs.client.InvocationCallback; import javax.ws.rs.client.RxInvoker; import javax.ws.rs.client.SyncInvoker; +import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.CacheControl; +import javax.ws.rs.core.Configurable; import javax.ws.rs.core.Cookie; import javax.ws.rs.core.GenericType; import javax.ws.rs.core.HttpHeaders; @@ -53,10 +55,13 @@ public class InvocationBuilderImpl implements Invocation.Builder { private WebClient webClient; private SyncInvoker sync; +private Configurable config; -public InvocationBuilderImpl(WebClient webClient) { +public InvocationBuilderImpl(WebClient webClient, + Configurable config) { this.webClient = webClient; this.sync = webClient.sync(); +this.config = config; } public WebClient getWebClient() { @@ -376,13 +381,17 @@ public class InvocationBuilderImpl implements Invocation.Builder { @Override public CompletionStageRxInvoker rx() { -return webClient.rx((ExecutorService)null); +return webClient.rx(getConfiguredExecutorService()); } @SuppressWarnings("rawtypes") @Override public T rx(Class rxCls) { -return webClient.rx(rxCls, (ExecutorService)null); +return webClient.rx(rxCls, getConfiguredExecutorService()); +} + +private ExecutorService getConfiguredExecutorService() { +return (ExecutorService)config.getConfiguration().getProperty("executorService"); } }
[1/2] cxf-dosgi git commit: [DOSGI-254] Refactor to extract exception mapping
Repository: cxf-dosgi Updated Branches: refs/heads/master 5b953b2dd -> 88b51ef4c [DOSGI-254] Refactor to extract exception mapping Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/97873bb0 Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/97873bb0 Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/97873bb0 Branch: refs/heads/master Commit: 97873bb00d3fd3343351368d4a95f23992b2cee4 Parents: 5b953b2 Author: Christian SchneiderAuthored: Tue Jul 11 11:27:18 2017 +0200 Committer: Christian Schneider Committed: Tue Jul 11 11:27:18 2017 +0200 -- .../cxf/dosgi/common/proxy/ExceptionMapper.java | 75 .../common/proxy/ServiceInvocationHandler.java | 44 ++-- 2 files changed, 80 insertions(+), 39 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/97873bb0/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java -- diff --git a/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java b/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java new file mode 100644 index 000..77c72b2 --- /dev/null +++ b/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java @@ -0,0 +1,75 @@ +/** + * 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.dosgi.common.proxy; + +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.osgi.framework.ServiceException; + +public class ExceptionMapper { +private static final String REMOTE_EXCEPTION_TYPE = "REMOTE"; +private Map > exceptionsMap = new HashMap >(); + +public ExceptionMapper(Class iType) { +introspectTypeForExceptions(iType); +} + +public Throwable mapException(Method m, Throwable ex) throws Throwable { +Throwable cause = ex.getCause() == null ? ex : ex.getCause(); +Set excTypes = exceptionsMap.get(m); +if (excTypes != null) { +for (Class type : excTypes) { +if (type.isAssignableFrom(ex.getClass())) { +return ex; +} +if (type.isAssignableFrom(cause.getClass())) { +return cause; +} +} +} +return new ServiceException(REMOTE_EXCEPTION_TYPE, ex); +} + +private void introspectTypeForExceptions(Class iType) { +for (Method m : iType.getDeclaredMethods()) { +addExceptions(m); +} +} + +private void addExceptions(Method m) { +for (Class excType : m.getExceptionTypes()) { +if (Exception.class.isAssignableFrom(excType)) { +getCurrentExTypes(m).add(excType); +} +} +} + +private Set getCurrentExTypes(Method m) { +Set types = exceptionsMap.get(m); +if (types == null) { +types = new HashSet (); +exceptionsMap.put(m, types); +} +return types; +} +} http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/97873bb0/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandler.java -- diff --git a/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandler.java b/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandler.java index 51a1e24..6f9e7e9 100644 --- a/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandler.java +++ b/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandler.java @@ -23,26 +23,18 @@ import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.security.AccessController; import
[2/2] cxf-dosgi git commit: [DOSGI-254] Fix handling of inherited exceptions
[DOSGI-254] Fix handling of inherited exceptions Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/88b51ef4 Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/88b51ef4 Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/88b51ef4 Branch: refs/heads/master Commit: 88b51ef4cbd45eabbf47b6e62a3b2eabd5080bc4 Parents: 97873bb Author: Christian SchneiderAuthored: Tue Jul 11 11:32:15 2017 +0200 Committer: Christian Schneider Committed: Tue Jul 11 11:32:15 2017 +0200 -- .../org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java| 3 +++ .../cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java | 7 +-- 2 files changed, 4 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/88b51ef4/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java -- diff --git a/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java b/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java index 77c72b2..2e3044b 100644 --- a/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java +++ b/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java @@ -54,6 +54,9 @@ public class ExceptionMapper { for (Method m : iType.getDeclaredMethods()) { addExceptions(m); } +for (Method m : iType.getMethods()) { +addExceptions(m); +} } private void addExceptions(Method m) { http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/88b51ef4/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java -- diff --git a/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java b/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java index 43a90a7..af31b4d 100644 --- a/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java +++ b/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java @@ -30,7 +30,6 @@ import java.util.List; import java.util.Map; import org.junit.Test; -import org.osgi.framework.ServiceException; public class ServiceInvocationHandlerTest { @@ -84,11 +83,7 @@ public class ServiceInvocationHandlerTest { proxy.throwException2(); } -/** - * Shows issue https://issues.apache.org/jira/projects/DOSGI/issues/DOSGI-254 - * We would expect an IOexcpetion here - */ -@Test(expected = ServiceException.class) +@Test(expected = IOException.class) public void testInheritedException() throws IOException { MySubService proxy = ProxyFactory.create(new MyServiceImpl(), MySubService.class); proxy.throwException1();
cxf-dosgi git commit: [DOSGI-254] Make proxyfactory generic. Small fix in test
Repository: cxf-dosgi Updated Branches: refs/heads/master 7a5315cbd -> 5b953b2dd [DOSGI-254] Make proxyfactory generic. Small fix in test Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/5b953b2d Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/5b953b2d Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/5b953b2d Branch: refs/heads/master Commit: 5b953b2dd983788e61e42673139e3d5d5822671e Parents: 7a5315c Author: Christian SchneiderAuthored: Tue Jul 11 11:04:37 2017 +0200 Committer: Christian Schneider Committed: Tue Jul 11 11:04:37 2017 +0200 -- .../org/apache/cxf/dosgi/common/proxy/ProxyFactory.java | 11 ++- .../dosgi/common/proxy/ServiceInvocationHandlerTest.java | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/5b953b2d/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ProxyFactory.java -- diff --git a/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ProxyFactory.java b/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ProxyFactory.java index ec10f6e..03c2a14 100644 --- a/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ProxyFactory.java +++ b/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ProxyFactory.java @@ -23,10 +23,11 @@ import java.lang.reflect.Proxy; public final class ProxyFactory { private ProxyFactory() { } - -public static Object create(Object serviceProxy, Class iType) { -return Proxy.newProxyInstance(iType.getClassLoader(), new Class[] { -iType -}, new ServiceInvocationHandler(serviceProxy, iType)); + +@SuppressWarnings("unchecked") +public static T create(Object serviceProxy, Class iType) { +Class[] ifaces = new Class[] {iType}; +return (T)Proxy.newProxyInstance(iType.getClassLoader(), ifaces, + new ServiceInvocationHandler(serviceProxy, iType)); } } http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/5b953b2d/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java -- diff --git a/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java b/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java index 30cf5a8..43a90a7 100644 --- a/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java +++ b/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java @@ -80,7 +80,7 @@ public class ServiceInvocationHandlerTest { @Test(expected = IOException.class) public void testException() throws IOException { -MySubService proxy = (MySubService)ProxyFactory.create(new MyServiceImpl(), MySubService.class); +MySubService proxy = ProxyFactory.create(new MyServiceImpl(), MySubService.class); proxy.throwException2(); } @@ -90,7 +90,7 @@ public class ServiceInvocationHandlerTest { */ @Test(expected = ServiceException.class) public void testInheritedException() throws IOException { -MyBaseService proxy = (MyBaseService)ProxyFactory.create(new MyServiceImpl(), MySubService.class); +MySubService proxy = ProxyFactory.create(new MyServiceImpl(), MySubService.class); proxy.throwException1(); }
cxf-dosgi git commit: [DOSGI-254] Unit test to show the issue
Repository: cxf-dosgi Updated Branches: refs/heads/master 2ce3ed1de -> 7a5315cbd [DOSGI-254] Unit test to show the issue Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/7a5315cb Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/7a5315cb Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/7a5315cb Branch: refs/heads/master Commit: 7a5315cbdc8ac751b43e6d5d1f94db24f6fdb2b0 Parents: 2ce3ed1 Author: Christian SchneiderAuthored: Tue Jul 11 10:59:47 2017 +0200 Committer: Christian Schneider Committed: Tue Jul 11 10:59:47 2017 +0200 -- .../cxf/dosgi/common/proxy/MyBaseService.java | 25 ++ .../cxf/dosgi/common/proxy/MyServiceImpl.java | 35 .../cxf/dosgi/common/proxy/MySubService.java| 25 ++ .../proxy/ServiceInvocationHandlerTest.java | 26 +-- 4 files changed, 109 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/7a5315cb/common/src/test/java/org/apache/cxf/dosgi/common/proxy/MyBaseService.java -- diff --git a/common/src/test/java/org/apache/cxf/dosgi/common/proxy/MyBaseService.java b/common/src/test/java/org/apache/cxf/dosgi/common/proxy/MyBaseService.java new file mode 100644 index 000..b6f9495 --- /dev/null +++ b/common/src/test/java/org/apache/cxf/dosgi/common/proxy/MyBaseService.java @@ -0,0 +1,25 @@ +/** + * 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.dosgi.common.proxy; + +import java.io.IOException; + +public interface MyBaseService { +void throwException1() throws IOException; +} http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/7a5315cb/common/src/test/java/org/apache/cxf/dosgi/common/proxy/MyServiceImpl.java -- diff --git a/common/src/test/java/org/apache/cxf/dosgi/common/proxy/MyServiceImpl.java b/common/src/test/java/org/apache/cxf/dosgi/common/proxy/MyServiceImpl.java new file mode 100644 index 000..60007a9 --- /dev/null +++ b/common/src/test/java/org/apache/cxf/dosgi/common/proxy/MyServiceImpl.java @@ -0,0 +1,35 @@ +/** + * 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.dosgi.common.proxy; + +import java.io.IOException; + +public class MyServiceImpl implements MySubService { + +@Override +public void throwException1() throws IOException { +throw new IOException(); +} + +@Override +public void throwException2() throws IOException { +throw new IOException(); +} + +} http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/7a5315cb/common/src/test/java/org/apache/cxf/dosgi/common/proxy/MySubService.java -- diff --git a/common/src/test/java/org/apache/cxf/dosgi/common/proxy/MySubService.java b/common/src/test/java/org/apache/cxf/dosgi/common/proxy/MySubService.java new file mode 100644 index 000..5bc74cd --- /dev/null +++ b/common/src/test/java/org/apache/cxf/dosgi/common/proxy/MySubService.java @@ -0,0 +1,25 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more