[1/2] cxf-dosgi git commit: [DOSGI-249] Redesign examples
Repository: cxf-dosgi Updated Branches: refs/heads/master abdd7419f -> 37cf7d355 http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/rest/README.md -- diff --git a/samples/rest/README.md b/samples/rest/README.md new file mode 100644 index 000..0c74070 --- /dev/null +++ b/samples/rest/README.md @@ -0,0 +1,42 @@ +# CXF DOSGi example REST + +This example shows how to expose and use a REST service using declarative services. + +The API module defines the TaskResource interface which is annotated using JAXRS annotations. + +The impl module implements the TaskService using a simple HashMap internally. It allows to manage Task objects which represent items of a to do list. + + +## Installation + +Unpack karaf 4 into a server and client directory. + +### Install server + +Start the server karaf + +``` +feature:repo-add cxf-dosgi-samples 2.0-SNAPSHOT +feature:install cxf-dosgi-sample-rest-impl +rsa:endpoints +``` + +The last command should show one endpoint with a URI as id. You should be able to open the url in the browser. The browser should show the predefined tasks as xml. + +### Install client + +Start the client karaf + +``` +feature:repo-add cxf-dosgi-samples 2.0-SNAPSHOT +feature:install cxf-dosgi-sample-rest-client +``` +Use commands to test + +``` +rsa:endpoints +task:list +task:add 4 Mytask +task:list +``` + http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/rest/api/bnd.bnd -- diff --git a/samples/rest/api/bnd.bnd b/samples/rest/api/bnd.bnd new file mode 100644 index 000..d81f90b --- /dev/null +++ b/samples/rest/api/bnd.bnd @@ -0,0 +1 @@ +Export-Package: org.apache.cxf.dosgi.samples.rest \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/rest/api/pom.xml -- diff --git a/samples/rest/api/pom.xml b/samples/rest/api/pom.xml new file mode 100644 index 000..3c91d30 --- /dev/null +++ b/samples/rest/api/pom.xml @@ -0,0 +1,51 @@ + + +http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd;> +4.0.0 +org.apache.cxf.dosgi.samples +cxf-dosgi-samples-rest-api +bundle +CXF DOSGi samples REST API + + + org.apache.cxf.dosgi + cxf-dosgi-ri-parent + 2.0-SNAPSHOT + ../../../parent/pom.xml + + + +../../.. + + + + + org.apache.servicemix.specs + org.apache.servicemix.specs.jsr339-api-m10 + ${servicemix.specs.version} + + + org.apache.servicemix.specs + org.apache.servicemix.specs.jaxb-api-2.1 + ${servicemix.specs.version} + + + + http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/37cf7d35/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/Task.java -- diff --git a/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/Task.java b/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/Task.java new file mode 100644 index 000..6ae15a1 --- /dev/null +++ b/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/Task.java @@ -0,0 +1,83 @@ +/** + * 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.samples.rest; + +import java.util.Date; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement +public class Task { +Integer id; +String title; +String description; +Date dueDate; +boolean finished; + +public Task() { +} + +public Task(Integer id, String title, String description) { +super(); +this.id = id; +this.title = title; +this.description = description; +} + +public Integer getId() { +return id; +} + +public void setId(Integer id) { +this.id = new Integer(id); +} + +public String getTitle() { +return title; +
[2/2] cxf-dosgi git commit: [DOSGI-249] Redesign examples
[DOSGI-249] Redesign examples Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/37cf7d35 Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/37cf7d35 Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/37cf7d35 Branch: refs/heads/master Commit: 37cf7d355972229658033d48543002775114a021 Parents: abdd741 Author: Christian SchneiderAuthored: Fri Aug 12 18:06:51 2016 +0200 Committer: Christian Schneider Committed: Fri Aug 12 18:06:51 2016 +0200 -- common/pom.xml | 2 +- decorator/pom.xml | 2 +- provider-rs/pom.xml | 2 +- provider-ws/pom.xml | 2 +- samples/ds/client/pom.xml | 36 --- .../samples/ds/consumer/AdderConsumer.java | 39 .../OSGI-INF/remote-service/remote-services.xml | 26 -- samples/ds/impl/pom.xml | 44 - .../dosgi/samples/ds/impl/AdderServiceImpl.java | 39 samples/ds/interface/bnd.bnd| 1 - samples/ds/interface/pom.xml| 37 .../cxf/dosgi/samples/ds/AdderService.java | 23 - samples/ds/pom.xml | 47 -- samples/features/pom.xml| 83 + .../features/src/main/resources/features.xml| 33 +++ samples/greeter/client/pom.xml | 48 -- .../samples/greeter/client/GreeterClient.java | 48 -- .../samples/greeter/client/GreeterDataImpl.java | 46 - .../OSGI-INF/cxf/intents/intent-map.xml | 75 --- .../OSGI-INF/remote-service/remote-services.xml | 27 -- samples/greeter/impl/pom.xml| 45 - .../greeter/impl/GreeterServiceImpl.java| 69 -- samples/greeter/interface/bnd.bnd | 1 - samples/greeter/interface/pom.xml | 38 .../cxf/dosgi/samples/greeter/GreeterData.java | 25 - .../dosgi/samples/greeter/GreeterException.java | 45 - .../dosgi/samples/greeter/GreeterService.java | 26 -- .../dosgi/samples/greeter/GreetingPhrase.java | 50 -- samples/greeter/pom.xml | 54 --- samples/greeter_rest/client/pom.xml | 38 .../greeter/client/rest/GreeterClient.java | 46 - .../OSGI-INF/remote-service/remote-services.xml | 24 - samples/greeter_rest/impl/pom.xml | 46 - .../greeter/impl/rest/GreeterServiceImpl.java | 57 samples/greeter_rest/interface/bnd.bnd | 1 - samples/greeter_rest/interface/pom.xml | 51 -- .../samples/greeter/rest/GreeterException.java | 45 - .../dosgi/samples/greeter/rest/GreeterInfo.java | 37 .../samples/greeter/rest/GreeterService.java| 31 --- .../samples/greeter/rest/GreetingPhrase.java| 64 - .../cxf/jaxrs/GreeterService2-model.xml | 7 -- samples/greeter_rest/pom.xml| 47 -- samples/pom.xml | 10 +- samples/rest/README.md | 42 + samples/rest/api/bnd.bnd| 1 + samples/rest/api/pom.xml| 51 ++ .../org/apache/cxf/dosgi/samples/rest/Task.java | 83 + .../cxf/dosgi/samples/rest/TaskResource.java| 44 + .../cxf/jaxrs/GreeterService2-model.xml | 7 ++ samples/rest/client/pom.xml | 38 .../rest/client/TaskResourceCommand.java| 63 + .../OSGI-INF/remote-service/remote-services.xml | 24 + samples/rest/impl/pom.xml | 44 + .../samples/rest/impl/TaskServiceImpl.java | 74 +++ samples/rest/pom.xml| 47 ++ samples/security_filter/bnd.bnd | 1 - samples/security_filter/pom.xml | 4 +- .../cxf/dosgi/samples/security/Activator.java | 65 - .../samples/security/SampleSecurityFilter.java | 14 ++- .../samples/security/SecureRestEndpoint.java| 12 +++ samples/soap/README.md | 42 + samples/soap/api/bnd.bnd| 1 + samples/soap/api/pom.xml| 38 .../org/apache/cxf/dosgi/samples/soap/Task.java | 83 + .../cxf/dosgi/samples/soap/TaskService.java | 34 +++ samples/soap/client/bnd.bnd | 1 + samples/soap/client/pom.xml | 37 .../samples/soap/client/TaskServiceCommand.java | 65 + samples/soap/impl/pom.xml | 45 +
cxf git commit: [CXF-6989] Avoding a reg-ex split when processing Content-Disposition properties
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 4bb0d4ea2 -> 877b5a7a4 [CXF-6989] Avoding a reg-ex split when processing Content-Disposition properties Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/877b5a7a Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/877b5a7a Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/877b5a7a Branch: refs/heads/3.0.x-fixes Commit: 877b5a7a460aef1beb2b46240fe8b636c0d846e2 Parents: 4bb0d4e Author: Sergey BeryozkinAuthored: Fri Aug 12 16:34:45 2016 +0100 Committer: Sergey Beryozkin Committed: Fri Aug 12 16:37:11 2016 +0100 -- .../apache/cxf/attachment/ContentDisposition.java | 16 +--- .../apache/cxf/attachment/AttachmentUtilTest.java | 5 + 2 files changed, 18 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/877b5a7a/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java b/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java index 22b5daa..9ce30e9 100644 --- a/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java +++ b/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java @@ -56,9 +56,19 @@ public class ContentDisposition { String extendedFilename = null; Matcher m = CD_HEADER_PARAMS_PATTERN.matcher(tempValue); while (m.find()) { -String[] pair = m.group().trim().split("="); -String paramName = pair[0].trim(); -String paramValue = pair.length == 2 ? pair[1].trim().replace("\"", "") : ""; +String paramName = null; +String paramValue = ""; + +String groupValue = m.group().trim(); +int eqIndex = groupValue.indexOf('='); +if (eqIndex > 0) { +paramName = groupValue.substring(0, eqIndex).trim(); +if (eqIndex + 1 != groupValue.length()) { +paramValue = groupValue.substring(eqIndex + 1).trim().replace("\"", ""); +} +} else { +paramName = groupValue; +} // filename* looks like the only CD param that is human readable // and worthy of the extended encoding support. Other parameters // can be supported if needed, see the complete list below http://git-wip-us.apache.org/repos/asf/cxf/blob/877b5a7a/core/src/test/java/org/apache/cxf/attachment/AttachmentUtilTest.java -- diff --git a/core/src/test/java/org/apache/cxf/attachment/AttachmentUtilTest.java b/core/src/test/java/org/apache/cxf/attachment/AttachmentUtilTest.java index a9d3c90..d0601ff 100644 --- a/core/src/test/java/org/apache/cxf/attachment/AttachmentUtilTest.java +++ b/core/src/test/java/org/apache/cxf/attachment/AttachmentUtilTest.java @@ -109,4 +109,9 @@ public class AttachmentUtilTest extends Assert { "filename=\"-.zip\"")); } +@Test +public void testContentDispositionFnEquals() { +assertEquals("a=b.txt", + AttachmentUtil.getContentDispositionFileName("filename=\"a=b.txt\"")); +} }
cxf git commit: [CXF-6989] Avoding a reg-ex split when processing Content-Disposition properties
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes f63e8ad71 -> f454461fc [CXF-6989] Avoding a reg-ex split when processing Content-Disposition properties Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/f454461f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f454461f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f454461f Branch: refs/heads/3.1.x-fixes Commit: f454461fc3e449d93f296e391a8b4360f82b4321 Parents: f63e8ad Author: Sergey BeryozkinAuthored: Fri Aug 12 16:34:45 2016 +0100 Committer: Sergey Beryozkin Committed: Fri Aug 12 16:36:28 2016 +0100 -- .../apache/cxf/attachment/ContentDisposition.java | 16 +--- .../apache/cxf/attachment/AttachmentUtilTest.java | 5 + 2 files changed, 18 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/f454461f/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java b/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java index 22b5daa..9ce30e9 100644 --- a/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java +++ b/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java @@ -56,9 +56,19 @@ public class ContentDisposition { String extendedFilename = null; Matcher m = CD_HEADER_PARAMS_PATTERN.matcher(tempValue); while (m.find()) { -String[] pair = m.group().trim().split("="); -String paramName = pair[0].trim(); -String paramValue = pair.length == 2 ? pair[1].trim().replace("\"", "") : ""; +String paramName = null; +String paramValue = ""; + +String groupValue = m.group().trim(); +int eqIndex = groupValue.indexOf('='); +if (eqIndex > 0) { +paramName = groupValue.substring(0, eqIndex).trim(); +if (eqIndex + 1 != groupValue.length()) { +paramValue = groupValue.substring(eqIndex + 1).trim().replace("\"", ""); +} +} else { +paramName = groupValue; +} // filename* looks like the only CD param that is human readable // and worthy of the extended encoding support. Other parameters // can be supported if needed, see the complete list below http://git-wip-us.apache.org/repos/asf/cxf/blob/f454461f/core/src/test/java/org/apache/cxf/attachment/AttachmentUtilTest.java -- diff --git a/core/src/test/java/org/apache/cxf/attachment/AttachmentUtilTest.java b/core/src/test/java/org/apache/cxf/attachment/AttachmentUtilTest.java index a9d3c90..d0601ff 100644 --- a/core/src/test/java/org/apache/cxf/attachment/AttachmentUtilTest.java +++ b/core/src/test/java/org/apache/cxf/attachment/AttachmentUtilTest.java @@ -109,4 +109,9 @@ public class AttachmentUtilTest extends Assert { "filename=\"-.zip\"")); } +@Test +public void testContentDispositionFnEquals() { +assertEquals("a=b.txt", + AttachmentUtil.getContentDispositionFileName("filename=\"a=b.txt\"")); +} }
cxf git commit: [CXF-6989] Avoding a reg-ex split when processing Content-Disposition properties
Repository: cxf Updated Branches: refs/heads/master 0eeeccd94 -> 348095868 [CXF-6989] Avoding a reg-ex split when processing Content-Disposition properties Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/34809586 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/34809586 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/34809586 Branch: refs/heads/master Commit: 348095868d8d0e7ed363c65bfd2c05c1f691b479 Parents: 0eeeccd Author: Sergey BeryozkinAuthored: Fri Aug 12 16:34:45 2016 +0100 Committer: Sergey Beryozkin Committed: Fri Aug 12 16:34:45 2016 +0100 -- .../apache/cxf/attachment/ContentDisposition.java | 16 +--- .../apache/cxf/attachment/AttachmentUtilTest.java | 5 + 2 files changed, 18 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/34809586/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java b/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java index 22b5daa..9ce30e9 100644 --- a/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java +++ b/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java @@ -56,9 +56,19 @@ public class ContentDisposition { String extendedFilename = null; Matcher m = CD_HEADER_PARAMS_PATTERN.matcher(tempValue); while (m.find()) { -String[] pair = m.group().trim().split("="); -String paramName = pair[0].trim(); -String paramValue = pair.length == 2 ? pair[1].trim().replace("\"", "") : ""; +String paramName = null; +String paramValue = ""; + +String groupValue = m.group().trim(); +int eqIndex = groupValue.indexOf('='); +if (eqIndex > 0) { +paramName = groupValue.substring(0, eqIndex).trim(); +if (eqIndex + 1 != groupValue.length()) { +paramValue = groupValue.substring(eqIndex + 1).trim().replace("\"", ""); +} +} else { +paramName = groupValue; +} // filename* looks like the only CD param that is human readable // and worthy of the extended encoding support. Other parameters // can be supported if needed, see the complete list below http://git-wip-us.apache.org/repos/asf/cxf/blob/34809586/core/src/test/java/org/apache/cxf/attachment/AttachmentUtilTest.java -- diff --git a/core/src/test/java/org/apache/cxf/attachment/AttachmentUtilTest.java b/core/src/test/java/org/apache/cxf/attachment/AttachmentUtilTest.java index a9d3c90..d0601ff 100644 --- a/core/src/test/java/org/apache/cxf/attachment/AttachmentUtilTest.java +++ b/core/src/test/java/org/apache/cxf/attachment/AttachmentUtilTest.java @@ -109,4 +109,9 @@ public class AttachmentUtilTest extends Assert { "filename=\"-.zip\"")); } +@Test +public void testContentDispositionFnEquals() { +assertEquals("a=b.txt", + AttachmentUtil.getContentDispositionFileName("filename=\"a=b.txt\"")); +} }
cxf git commit: [CXF-6692] Updating JCache provider to support storing jose token representations only
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 55431b527 -> f63e8ad71 [CXF-6692] Updating JCache provider to support storing jose token representations only Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/f63e8ad7 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f63e8ad7 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f63e8ad7 Branch: refs/heads/3.1.x-fixes Commit: f63e8ad713e6f140420e9de6a4fc2a7686fb1b8e Parents: 55431b5 Author: Sergey BeryozkinAuthored: Fri Aug 12 15:50:59 2016 +0100 Committer: Sergey Beryozkin Committed: Fri Aug 12 15:56:11 2016 +0100 -- .../DefaultEHCacheOAuthDataProvider.java| 6 +- .../provider/JCacheOAuthDataProvider.java | 113 --- .../src/test/resources/cxf-oauth2-ehcache3.xml | 27 - .../src/test/resources/cxf-oauth2-jcache.xml| 27 + 4 files changed, 130 insertions(+), 43 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/f63e8ad7/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java index c49e2ef..bb055a1 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java @@ -68,9 +68,9 @@ public class DefaultEHCacheOAuthDataProvider extends AbstractOAuthDataProvider { public DefaultEHCacheOAuthDataProvider(String configFileURL, Bus bus, String clientCacheKey, - String accessTokenKey, - String refreshTokenKey) { -createCaches(configFileURL, bus, clientCacheKey, accessTokenKey, refreshTokenKey); + String accessTokenCacheKey, + String refreshTokenCacheKey) { +createCaches(configFileURL, bus, clientCacheKey, accessTokenCacheKey, refreshTokenCacheKey); } @Override http://git-wip-us.apache.org/repos/asf/cxf/blob/f63e8ad7/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java index 3a2bbb8..fa16612 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java @@ -24,6 +24,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; + import javax.cache.Cache; import javax.cache.CacheManager; import javax.cache.Caching; @@ -32,10 +33,12 @@ import javax.cache.spi.CachingProvider; import org.apache.cxf.Bus; import org.apache.cxf.BusFactory; +import org.apache.cxf.rs.security.jose.jwt.JoseJwtConsumer; import org.apache.cxf.rs.security.oauth2.common.Client; import org.apache.cxf.rs.security.oauth2.common.ServerAccessToken; import org.apache.cxf.rs.security.oauth2.common.UserSubject; import org.apache.cxf.rs.security.oauth2.tokens.refresh.RefreshToken; +import org.apache.cxf.rs.security.oauth2.utils.JwtAccessTokenUtils; import static org.apache.cxf.jaxrs.utils.ResourceUtils.getClasspathResourceURL; @@ -47,27 +50,53 @@ public class JCacheOAuthDataProvider extends AbstractOAuthDataProvider { protected final CacheManager cacheManager; private final Cache clientCache; -private final Cache accessTokenCache; +private Cache accessTokenCache; +private Cache jwtAccessTokenCache; private final Cache refreshTokenCache; +private boolean storeJwtTokenKeyOnly; +private JoseJwtConsumer jwtTokenConsumer; public
cxf git commit: [CXF-6692] Updating JCache provider to support storing jose token representations only
Repository: cxf Updated Branches: refs/heads/master b69f76c6a -> 0eeeccd94 [CXF-6692] Updating JCache provider to support storing jose token representations only Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0eeeccd9 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0eeeccd9 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0eeeccd9 Branch: refs/heads/master Commit: 0eeeccd94afc7c7a0ace1872584ebc23b43235d7 Parents: b69f76c Author: Sergey BeryozkinAuthored: Fri Aug 12 15:50:59 2016 +0100 Committer: Sergey Beryozkin Committed: Fri Aug 12 15:50:59 2016 +0100 -- .../DefaultEHCacheOAuthDataProvider.java| 6 +- .../provider/JCacheOAuthDataProvider.java | 113 --- .../src/test/resources/cxf-oauth2-ehcache3.xml | 27 - .../src/test/resources/cxf-oauth2-jcache.xml| 27 + 4 files changed, 130 insertions(+), 43 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/0eeeccd9/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java index c49e2ef..bb055a1 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java @@ -68,9 +68,9 @@ public class DefaultEHCacheOAuthDataProvider extends AbstractOAuthDataProvider { public DefaultEHCacheOAuthDataProvider(String configFileURL, Bus bus, String clientCacheKey, - String accessTokenKey, - String refreshTokenKey) { -createCaches(configFileURL, bus, clientCacheKey, accessTokenKey, refreshTokenKey); + String accessTokenCacheKey, + String refreshTokenCacheKey) { +createCaches(configFileURL, bus, clientCacheKey, accessTokenCacheKey, refreshTokenCacheKey); } @Override http://git-wip-us.apache.org/repos/asf/cxf/blob/0eeeccd9/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java index 3a2bbb8..fa16612 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/JCacheOAuthDataProvider.java @@ -24,6 +24,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; + import javax.cache.Cache; import javax.cache.CacheManager; import javax.cache.Caching; @@ -32,10 +33,12 @@ import javax.cache.spi.CachingProvider; import org.apache.cxf.Bus; import org.apache.cxf.BusFactory; +import org.apache.cxf.rs.security.jose.jwt.JoseJwtConsumer; import org.apache.cxf.rs.security.oauth2.common.Client; import org.apache.cxf.rs.security.oauth2.common.ServerAccessToken; import org.apache.cxf.rs.security.oauth2.common.UserSubject; import org.apache.cxf.rs.security.oauth2.tokens.refresh.RefreshToken; +import org.apache.cxf.rs.security.oauth2.utils.JwtAccessTokenUtils; import static org.apache.cxf.jaxrs.utils.ResourceUtils.getClasspathResourceURL; @@ -47,27 +50,53 @@ public class JCacheOAuthDataProvider extends AbstractOAuthDataProvider { protected final CacheManager cacheManager; private final Cache clientCache; -private final Cache accessTokenCache; +private Cache accessTokenCache; +private Cache jwtAccessTokenCache; private final Cache refreshTokenCache; +private boolean storeJwtTokenKeyOnly; +private JoseJwtConsumer jwtTokenConsumer; public JCacheOAuthDataProvider() throws
cxf git commit: [CXF-6692] Updates to the way some claims are set
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 7d19676c1 -> 55431b527 [CXF-6692] Updates to the way some claims are set Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/55431b52 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/55431b52 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/55431b52 Branch: refs/heads/3.1.x-fixes Commit: 55431b527baa162793a9dd5bc16e4328802fa7b8 Parents: 7d19676 Author: Sergey BeryozkinAuthored: Fri Aug 12 13:18:42 2016 +0100 Committer: Sergey Beryozkin Committed: Fri Aug 12 13:19:40 2016 +0100 -- .../oauth2/filters/JwtAccessTokenValidator.java | 27 +++- .../provider/AbstractOAuthDataProvider.java | 15 ++- .../oauth2/utils/JwtAccessTokenUtils.java | 20 +-- .../oauth2/filters/OAuth2JwtFiltersTest.java| 5 ++-- 4 files changed, 33 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/55431b52/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/JwtAccessTokenValidator.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/JwtAccessTokenValidator.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/JwtAccessTokenValidator.java index 252bed7..769f7bb 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/JwtAccessTokenValidator.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/JwtAccessTokenValidator.java @@ -40,6 +40,10 @@ import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants; public class JwtAccessTokenValidator extends JoseJwtConsumer implements AccessTokenValidator { +private static final String USERNAME_CLAIM = "username"; + +private String usernameClaim = USERNAME_CLAIM; + public List getSupportedAuthorizationSchemes() { return Collections.singletonList(OAuthConstants.BEARER_AUTHORIZATION_SCHEME); } @@ -61,8 +65,9 @@ public class JwtAccessTokenValidator extends JoseJwtConsumer implements AccessTo private AccessTokenValidation convertClaimsToValidation(JwtClaims claims) { AccessTokenValidation atv = new AccessTokenValidation(); atv.setInitialValidationSuccessful(true); -if (claims.getAudience() != null) { -atv.setClientId(claims.getAudience()); +String clientId = claims.getStringProperty(OAuthConstants.CLIENT_ID); +if (clientId != null) { +atv.setClientId(clientId); } if (claims.getIssuedAt() != null) { atv.setTokenIssuedAt(claims.getIssuedAt()); @@ -72,15 +77,9 @@ public class JwtAccessTokenValidator extends JoseJwtConsumer implements AccessTo if (claims.getExpiryTime() != null) { atv.setTokenLifetime(claims.getExpiryTime() - atv.getTokenIssuedAt()); } -Object resourceAud = claims.getClaim(OAuthConstants.RESOURCE_INDICATOR); -if (resourceAud != null) { -List auds = null; -if (resourceAud instanceof List) { -auds = CastUtils.cast((List)resourceAud); -} else { -auds = Collections.singletonList((String)resourceAud); -} -atv.setAudiences(auds); +List audiences = claims.getAudiences(); +if (audiences != null && !audiences.isEmpty()) { +atv.setAudiences(claims.getAudiences()); } if (claims.getIssuer() != null) { atv.setTokenIssuer(claims.getIssuer()); @@ -97,7 +96,7 @@ public class JwtAccessTokenValidator extends JoseJwtConsumer implements AccessTo } atv.setTokenScopes(perms); } -String username = (String)claims.getClaim("preferred_username"); +String username = (String)claims.getClaim(usernameClaim); if (username != null) { UserSubject userSubject = new UserSubject(username); if (claims.getSubject() != null) { @@ -110,4 +109,8 @@ public class JwtAccessTokenValidator extends JoseJwtConsumer implements AccessTo return atv; } +public void setUsernameClaim(String usernameClaim) { +this.usernameClaim = usernameClaim; +} + } http://git-wip-us.apache.org/repos/asf/cxf/blob/55431b52/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java -- diff --git
cxf git commit: [CXF-6692] Updates to the way some claims are set
Repository: cxf Updated Branches: refs/heads/master 0f51e22bc -> b69f76c6a [CXF-6692] Updates to the way some claims are set Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b69f76c6 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b69f76c6 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b69f76c6 Branch: refs/heads/master Commit: b69f76c6a43376f85c4b3bc5135b58f717463e8f Parents: 0f51e22 Author: Sergey BeryozkinAuthored: Fri Aug 12 13:18:42 2016 +0100 Committer: Sergey Beryozkin Committed: Fri Aug 12 13:18:42 2016 +0100 -- .../oauth2/filters/JwtAccessTokenValidator.java | 27 +++- .../provider/AbstractOAuthDataProvider.java | 15 ++- .../oauth2/utils/JwtAccessTokenUtils.java | 20 +-- .../oauth2/filters/OAuth2JwtFiltersTest.java| 5 ++-- 4 files changed, 33 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/b69f76c6/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/JwtAccessTokenValidator.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/JwtAccessTokenValidator.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/JwtAccessTokenValidator.java index 252bed7..769f7bb 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/JwtAccessTokenValidator.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/JwtAccessTokenValidator.java @@ -40,6 +40,10 @@ import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants; public class JwtAccessTokenValidator extends JoseJwtConsumer implements AccessTokenValidator { +private static final String USERNAME_CLAIM = "username"; + +private String usernameClaim = USERNAME_CLAIM; + public List getSupportedAuthorizationSchemes() { return Collections.singletonList(OAuthConstants.BEARER_AUTHORIZATION_SCHEME); } @@ -61,8 +65,9 @@ public class JwtAccessTokenValidator extends JoseJwtConsumer implements AccessTo private AccessTokenValidation convertClaimsToValidation(JwtClaims claims) { AccessTokenValidation atv = new AccessTokenValidation(); atv.setInitialValidationSuccessful(true); -if (claims.getAudience() != null) { -atv.setClientId(claims.getAudience()); +String clientId = claims.getStringProperty(OAuthConstants.CLIENT_ID); +if (clientId != null) { +atv.setClientId(clientId); } if (claims.getIssuedAt() != null) { atv.setTokenIssuedAt(claims.getIssuedAt()); @@ -72,15 +77,9 @@ public class JwtAccessTokenValidator extends JoseJwtConsumer implements AccessTo if (claims.getExpiryTime() != null) { atv.setTokenLifetime(claims.getExpiryTime() - atv.getTokenIssuedAt()); } -Object resourceAud = claims.getClaim(OAuthConstants.RESOURCE_INDICATOR); -if (resourceAud != null) { -List auds = null; -if (resourceAud instanceof List) { -auds = CastUtils.cast((List)resourceAud); -} else { -auds = Collections.singletonList((String)resourceAud); -} -atv.setAudiences(auds); +List audiences = claims.getAudiences(); +if (audiences != null && !audiences.isEmpty()) { +atv.setAudiences(claims.getAudiences()); } if (claims.getIssuer() != null) { atv.setTokenIssuer(claims.getIssuer()); @@ -97,7 +96,7 @@ public class JwtAccessTokenValidator extends JoseJwtConsumer implements AccessTo } atv.setTokenScopes(perms); } -String username = (String)claims.getClaim("preferred_username"); +String username = (String)claims.getClaim(usernameClaim); if (username != null) { UserSubject userSubject = new UserSubject(username); if (claims.getSubject() != null) { @@ -110,4 +109,8 @@ public class JwtAccessTokenValidator extends JoseJwtConsumer implements AccessTo return atv; } +public void setUsernameClaim(String usernameClaim) { +this.usernameClaim = usernameClaim; +} + } http://git-wip-us.apache.org/repos/asf/cxf/blob/b69f76c6/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java -- diff --git
svn commit: r994991 - in /websites/production/cxf/content: cache/main.pageCache fediz-downloads.html
Author: buildbot Date: Fri Aug 12 11:47:40 2016 New Revision: 994991 Log: Production update by buildbot for cxf Modified: websites/production/cxf/content/cache/main.pageCache websites/production/cxf/content/fediz-downloads.html Modified: websites/production/cxf/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/cxf/content/fediz-downloads.html == --- websites/production/cxf/content/fediz-downloads.html (original) +++ websites/production/cxf/content/fediz-downloads.html Fri Aug 12 11:47:40 2016 @@ -108,7 +108,7 @@ Apache CXF -- Fediz Downloads -Releases1.3.0The 1.3.0 release is our latest release.DescriptionFileMD5SHA1PGPSource distributionhttp://www.apache.org/dyn/closer.lua?path=/cxf/fediz/1.3.0/fediz-1.3.0-source-release.zip;>fediz-1.3.0-source-release.ziphttps://www.apache.org/di st/cxf/fediz/1.3.0/fediz-1.3.0-source-release.zip.md5">fediz-1.3.0-source-release.zip.md5https://www.apache.org/dist/cxf/fediz/1.3.0/fediz-1.3.0-source-release.zip.sha1;>fediz-1.3.0-source-release.zip.sha1https://www.apache.org/dist/cxf/fediz/1.3.0/fediz-1.3.0-source-release.zip.asc;>fediz-1.3.0-source-release.zip.asc1.2.2The 1.2.2 release is our latest release of the 1.2.x branch. For more information please see the https://git-wip-us.apache.org/repos/asf?p=cxf-fediz.git;a=blob;f=release_notes.txt;h=d3a07d0a59993dd88b18308486483c8580bcba6d;hb=a97e8cfd9ed0848916e2483f9514e28ac36629c5;>release notes.DescriptionFileMD5SHA1PGPBinary distributionhttp://www.apache.org/dyn/closer.lua?path=/cxf/fediz/1.2.2/apache-fediz-1.2.2.zip;>apache-fediz-1.2.2.ziphttps://www.apache.org/dist/cxf/fediz/1.2.2/apache-fediz-1.2.2.zip.md5;>apache-fediz-1.2.2.zip.md5https://www.apache.org/dist/cxf/fediz/ 1.2.2/apache-fediz-1.2.2.zip.sha1">apache-fediz-1.2.2.zip.sha1https://www.apache.org/dist/cxf/fediz/1.2.2/apache-fediz-1.2.2.zip.asc;>apache-fediz-1.2.2.zip.ascSource distributionhttp://www.apache.org/dyn/closer.lua?path=/cxf/fediz/1.2.2/fediz-1.2.2-source-release.zip;>fediz-1.2.2-source-release.ziphttps://www.apache.org/dist/cxf/fediz/1.2.2/fediz-1.2.2-source-release.zip.md5;>fediz-1.2.2-source-release.zip.md5https://www.apache.org/dist/cxf/fediz/1.2.2/fediz-1.2.2-source-release.zip.sh a1">fediz-1.2.2-source-release.zip.sha1https://www.apache.org/dist/cxf/fediz/1.2.2/fediz-1.2.2-source-release.zip.asc;>fediz-1.2.2-source-release.zip.ascVerifying ReleasesWhen downloading from a mirror please check the SHA1/MD5 checksums as well as verifying the OpenPGP compatible signature available from the main Apache site. The https://www.apache.org/dist/cxf/KEYS;>KEYS file contains the public keys used for signing the release. It is recommended that a web of trust is used to confirm the identity of these keys.You can check the OpenPGP signature with GnuPG via: +Releases1.3.1The 1.3.1 release is our latest release.DescriptionFileMD5SHA1PGPSource distributionhttp://www.apache.org/dyn/closer.lua?path=/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip;>fediz-1.3.1-source-release.ziphttps://www.apache.org/di st/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip.md5">fediz-1.3.1-source-release.zip.md5https://www.apache.org/dist/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip.sha1;>fediz-1.3.1-source-release.zip.sha1https://www.apache.org/dist/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip.asc;>fediz-1.3.1-source-release.zip.asc1.2.2The 1.2.2 release is our latest release of the 1.2.x branch. For more information please see the https://git-wip-us.apache.org/repos/asf?p=cxf-fediz.git;a=blob;f=release_notes.txt;h=d3a07d0a59993dd88b18308486483c8580bcba6d;hb=a97e8cfd9ed0848916e2483f9514e28ac36629c5;>release notes.DescriptionFileMD5SHA1PGPBinary distributionhttp://www.apache.org/dyn/closer.lua?path=/cxf/fediz/1.2.2/apache-fediz-1.2.2.zip;>apache-fediz-1.2.2.ziphttps://www.apache.org/dist/cxf/fediz/1.2.2/apache-fediz-1.2.2.zip.md5;>apache-fediz-1.2.2.zip.md5https://www.apache.org/dist/cxf/fediz/ 1.2.2/apache-fediz-1.2.2.zip.sha1">apache-fediz-1.2.2.zip.sha1https://www.apache.org/dist/cxf/fediz/1.2.2/apache-fediz-1.2.2.zip.asc;>apache-fediz-1.2.2.zip.ascSource distributionhttp://www.apache.org/dyn/closer.lua?path=/cxf/fediz/1.2.2/fediz-1.2.2-source-release.zip;>fediz-1.2.2-source-release.ziphttps://www.apache.org/dist/cxf/fediz/1.2.2/fediz-1.2.2-source-release.zip.md5;>fediz-1.2.2-source-release.zip.md5https://www.apache.org/dist/cxf/fediz/1.2.2/fediz-1.2.2-source-release.zip.sh a1">fediz-1.2.2-source-release.zip.sha1https://www.apache.org/dist/cxf/fediz/1.2.2/fediz-1.2.2-source-release.zip.asc;>fediz-1.2.2-source-release.zip.ascVerifying ReleasesWhen downloading from a mirror please check the SHA1/MD5 checksums as well as verifying the OpenPGP compatible signature available from the main Apache site. The
svn commit: r14786 - in /release/cxf/fediz: 1.3.0/ 1.3.1/ 1.3.1/fediz-1.3.1-source-release.zip 1.3.1/fediz-1.3.1-source-release.zip.asc 1.3.1/fediz-1.3.1-source-release.zip.md5 1.3.1/fediz-1.3.1-sourc
Author: coheigea Date: Fri Aug 12 11:08:32 2016 New Revision: 14786 Log: Adding 1.3.1 release Added: release/cxf/fediz/1.3.1/ release/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip (with props) release/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip.asc release/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip.md5 release/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip.sha1 Removed: release/cxf/fediz/1.3.0/ Added: release/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip == Binary file - no diff available. Propchange: release/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip -- svn:mime-type = application/octet-stream Added: release/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip.asc == --- release/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip.asc (added) +++ release/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip.asc Fri Aug 12 11:08:32 2016 @@ -0,0 +1,11 @@ +-BEGIN PGP SIGNATURE- +Version: GnuPG v1 + +iQEcBAABAgAGBQJXqNACAAoJEGe/gLEK1TmDS2sH/AiZYGjB5SlCIAZXw8WUXxVf +DsNBz5ymj6GnEJtSwI9uQHHS35rlL6CI1Qle1vG2Bv3Hn2E+OXKN+cj2v1AXaA0c +vJmgy5DvwL+k9/Csl2nv6l98SZ3eD1kfvVY437Sd9x6OkNuXmUOaXD/eR2cPae81 +fWIhSHptM1sHgaHBHFWcLFY/VAh9sULmu+sYz2yDTmiLdGIiVhY0gHUNB8JiCZ7h +5B8SjXERX2ZR5IFtaz6Kd7az69wqYXXcETvsQ/xpPfLcwt8Xg0MDlrC9u52gwV6V +WORNFnbOJ8ViARDKv1cJslnj5UEdO779vn5IeHdAmBlLlP/wYrCVoukV4ut5Yyg= +=mCfN +-END PGP SIGNATURE- Added: release/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip.md5 == --- release/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip.md5 (added) +++ release/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip.md5 Fri Aug 12 11:08:32 2016 @@ -0,0 +1 @@ +ca7ce51a246cb678a34b8b787688a399 \ No newline at end of file Added: release/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip.sha1 == --- release/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip.sha1 (added) +++ release/cxf/fediz/1.3.1/fediz-1.3.1-source-release.zip.sha1 Fri Aug 12 11:08:32 2016 @@ -0,0 +1 @@ +952d99473d07ac8cc30fec0ee7258aa6d6958366 \ No newline at end of file
cxf git commit: [CXF-7008] Regression: CXF-5788 - JMS replyToDestination doesn't work
Repository: cxf Updated Branches: refs/heads/master b39fad570 -> 0f51e22bc [CXF-7008] Regression: CXF-5788 - JMS replyToDestination doesn't work Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0f51e22b Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0f51e22b Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0f51e22b Branch: refs/heads/master Commit: 0f51e22bc7e13630aeac1996fba4d06e97dea37c Parents: b39fad5 Author: Tadayoshi SatoAuthored: Fri Aug 12 16:06:48 2016 +0900 Committer: Tadayoshi Sato Committed: Fri Aug 12 16:06:48 2016 +0900 -- .../apache/cxf/transport/jms/JMSConduit.java| 2 +- .../cxf/transport/jms/JMSConfiguration.java | 22 ++--- .../cxf/systest/jms/JMSClientServerTest.java| 34 3 files changed, 53 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/0f51e22b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java -- diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java index 677dcf6..f656af7 100644 --- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java +++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java @@ -211,7 +211,7 @@ public class JMSConduit extends AbstractConduit implements JMSExchangeSender, Me String jmsMessageID = sendMessage(request, outMessage, replyToDestination, correlationId, closer, session); boolean useSyncReceive = ((correlationId == null || userCID != null) && !jmsConfig.isPubSubDomain()) -|| !replyToDestination.equals(staticReplyDestination); +|| (!replyToDestination.equals(staticReplyDestination) && headers.getJMSReplyTo() != null); if (correlationId == null) { correlationId = jmsMessageID; correlationMap.put(correlationId, exchange); http://git-wip-us.apache.org/repos/asf/cxf/blob/0f51e22b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java -- diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java index 4ab0c89..607956d 100644 --- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java +++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java @@ -77,6 +77,7 @@ public class JMSConfiguration { * Destination name to send out as replyTo address in the message */ private String replyToDestination; +private volatile Destination replyToDestinationDest; private String messageType = JMSConstants.TEXT_MESSAGE_TYPE; private boolean pubSubDomain; private boolean replyPubSubDomain; @@ -441,14 +442,27 @@ public class JMSConfiguration { } return resolver.resolveDestinationName(session, replyToDestinationName, pubSubDomain); } - + public Destination getReplyToDestination(Session session, String userDestination) throws JMSException { -if (userDestination == null) { +if (userDestination != null) { +return destinationResolver.resolveDestinationName(session, userDestination, replyPubSubDomain); +} +if (replyToDestination == null) { return getReplyDestination(session); } -return destinationResolver.resolveDestinationName(session, userDestination, replyPubSubDomain); +Destination result = replyToDestinationDest; +if (result == null) { +synchronized (this) { +result = replyToDestinationDest; +if (result == null) { +result = destinationResolver.resolveDestinationName(session, replyToDestination, replyPubSubDomain); +replyToDestinationDest = result; +} +} +} +return result; } - + public Destination getReplyDestination(Session session) throws JMSException { Destination result = replyDestinationDest; if (result == null) { http://git-wip-us.apache.org/repos/asf/cxf/blob/0f51e22b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java -- diff --git
Nexus: Promotion Completed
Message from: https://repository.apache.orgDeployer properties:"userAgent" = "Apache-Maven/3.3.9 (Java 1.7.0_80; Linux 4.4.0-31-generic)""userId" = "coheigea""ip" = "80.169.137.53"Details:The following artifacts have been promoted to the "Releases" [id=releases] repository/org/apache/cxf/fediz/systests/fediz-systests-idp/1.3.1/fediz-systests-idp-1.3.1.pom(SHA1: 4fc82f24d0de80d2919789c5173bee3e67c2a3cc)/org/apache/cxf/fediz/systests/fediz-systests-idp/1.3.1/fediz-systests-idp-1.3.1-sources.jar(SHA1: b742cfc67de05b3645b97e4828de6b1cdac2bb61)/org/apache/cxf/fediz/systests/fediz-systests-idp/1.3.1/fediz-systests-idp-1.3.1-sources.jar.asc(SHA1: 5522fdca26b5c0c99aa9a5292adb147dc93f869d)/org/apache/cxf/fediz/systests/fediz-systests-idp/1.3.1/fediz-systests-idp-1.3.1.jar(SHA1: 63beac2629647cb7be4bf23b1683fe8f11caa61c)/org/apache/cxf/fediz/systests/fediz-systests-idp/1.3.1/fediz-systests-idp-1.3.1.pom.asc(SHA1: 555daceafc339040257772f09c3c5052dedc58da)/org/apache/cxf/fediz/systests/fediz-systests-idp/1.3.1/fediz-systests-idp-1.3.1.jar.asc(SHA1: b36b7bc4d4e5bf08384e8ae9d2d5e4ef20aab6e4)/org/apache/cxf/fediz/systests/fediz-systests-jetty9/1.3.1/fediz-systests-jetty9-1.3.1-sources.jar(SHA1: 1086cdecd29a3bbbd04128a7c8c9328e27435198)/org/apache/cxf/fediz/systests/fediz-systests-jetty9/1.3.1/fediz-systests-jetty9-1.3.1.pom.asc(SHA1: 8a65ee0fba0be136ca04b6e48419447cbb0b940c)/org/apache/cxf/fediz/systests/fediz-systests-jetty9/1.3.1/fediz-systests-jetty9-1.3.1-sources.jar.asc(SHA1: f0c484e71c64005aa532fae474876d7821ef3837)/org/apache/cxf/fediz/systests/fediz-systests-jetty9/1.3.1/fediz-systests-jetty9-1.3.1.jar(SHA1: 5a8a0c7539ac966ca26a9c435a174c813228f8e7)/org/apache/cxf/fediz/systests/fediz-systests-jetty9/1.3.1/fediz-systests-jetty9-1.3.1.pom(SHA1: 6430213d95a7cec28effe32a224305e89a194289)/org/apache/cxf/fediz/systests/fediz-systests-jetty9/1.3.1/fediz-systests-jetty9-1.3.1.jar.asc(SHA1: 8b0f55f7b05a578fa5300e269a993c7e9b96e992)/org/apache/cxf/fediz/systests/fediz-systests-oidc/1.3.1/fediz-systests-oidc-1.3.1.pom.asc(SHA1: b3bf8584b066a8960f5f99ef53fa1a0e1e04054f)/org/apache/cxf/fediz/systests/fediz-systests-oidc/1.3.1/fediz-systests-oidc-1.3.1-sources.jar.asc(SHA1: ad7ece7d29dfbb506de0535d6022bf752c31ede2)/org/apache/cxf/fediz/systests/fediz-systests-oidc/1.3.1/fediz-systests-oidc-1.3.1.jar.asc(SHA1: 8f1c2725a82bf2e117d4fa17adf6284ec8043102)/org/apache/cxf/fediz/systests/fediz-systests-oidc/1.3.1/fediz-systests-oidc-1.3.1-sources.jar(SHA1: 6a21ca0279643989fff14d5f464b71a9eed36b16)/org/apache/cxf/fediz/systests/fediz-systests-oidc/1.3.1/fediz-systests-oidc-1.3.1.pom(SHA1: 914205c8bb5c6c1dd55da27dfd08d7a3be0fd3c5)/org/apache/cxf/fediz/systests/fediz-systests-oidc/1.3.1/fediz-systests-oidc-1.3.1.jar(SHA1: 5971dac8f075d41f46a82f371cb864bf31c36c4e)/org/apache/cxf/fediz/systests/fediz-systests-tomcat7/1.3.1/fediz-systests-tomcat7-1.3.1.pom.asc(SHA1: 9b024686bb118b32b7f517206d2107c54267fc0b)/org/apache/cxf/fediz/systests/fediz-systests-tomcat7/1.3.1/fediz-systests-tomcat7-1.3.1.jar(SHA1: 4e584774920e6fc33c0da60d4b5457f597d10ddc)/org/apache/cxf/fediz/systests/fediz-systests-tomcat7/1.3.1/fediz-systests-tomcat7-1.3.1-sources.jar(SHA1: 293d63cf7e99627bb9c12fe575d63d32e13d5357)/org/apache/cxf/fediz/systests/fediz-systests-tomcat7/1.3.1/fediz-systests-tomcat7-1.3.1.pom(SHA1: 1814331229e5679967ed905527584d3e77bcb35a)/org/apache/cxf/fediz/systests/fediz-systests-tomcat7/1.3.1/fediz-systests-tomcat7-1.3.1-sources.jar.asc(SHA1: 1f11b237a562f0250431e8d7eea4a82645c617a2)/org/apache/cxf/fediz/systests/fediz-systests-tomcat7/1.3.1/fediz-systests-tomcat7-1.3.1.jar.asc(SHA1: 579a972df024a7ee1e9fcda2405de08cb63026de)/org/apache/cxf/fediz/systests/fediz-systests-tomcat8/1.3.1/fediz-systests-tomcat8-1.3.1.pom.asc(SHA1: 2206824a516506b58dbe12c76fb40f1311905f76)/org/apache/cxf/fediz/systests/fediz-systests-tomcat8/1.3.1/fediz-systests-tomcat8-1.3.1-sources.jar(SHA1: b1cbc20b68c435e142686d3e16e177f9b3b23fbe)/org/apache/cxf/fediz/systests/fediz-systests-tomcat8/1.3.1/fediz-systests-tomcat8-1.3.1.pom(SHA1: 63fd7d71c0b3d2434b7324b8a4ec8912e6c83bd8)/org/apache/cxf/fediz/systests/fediz-systests-tomcat8/1.3.1/fediz-systests-tomcat8-1.3.1.jar.asc(SHA1: 49c6919765e73bbb085167c9b34a15449d5388db)/org/apache/cxf/fediz/systests/fediz-systests-tomcat8/1.3.1/fediz-systests-tomcat8-1.3.1-sources.jar.asc(SHA1: 38671841d2898c02b22efd5901e9d77145b44345)/org/apache/cxf/fediz/systests/fediz-systests-tomcat8/1.3.1/fediz-systests-tomcat8-1.3.1.jar(SHA1: 82f1462934056c97f61d5f7c7281df935292c33a)/org/apache/cxf/fediz/systests/webapps/fediz-systests-webapps-simple/1.3.1/fediz-systests-webapps-simple-1.3.1-javadoc.jar.asc(SHA1: dfa87ce09d17bf9c86729d756e1ac17f04ec4885)/org/apache/cxf/fediz/systests/webapps/fediz-systests-webapps-simple/1.3.1/fediz-systests-webapps-simple-1.3.1.war.asc(SHA1: ca0f1e343cd8c75a121386eee55b4cd8749c5e80)/org/apache/cxf/fediz/systests/webapps/fediz-systests-webapps-simple/1.3.1/fediz-systests-webapps-simple-1.3.1-javadoc.jar(SHA1:
cxf git commit: [CXF-7008] Regression: CXF-5788 - JMS replyToDestination doesn't work
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 46017d9a2 -> 7d19676c1 [CXF-7008] Regression: CXF-5788 - JMS replyToDestination doesn't work (cherry picked from commit 0f51e22bc7e13630aeac1996fba4d06e97dea37c) Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/7d19676c Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/7d19676c Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/7d19676c Branch: refs/heads/3.1.x-fixes Commit: 7d19676c18dd98b82be79bce79d9c82c302a7e11 Parents: 46017d9 Author: Tadayoshi SatoAuthored: Fri Aug 12 16:06:48 2016 +0900 Committer: Freeman Fang Committed: Fri Aug 12 17:06:04 2016 +0800 -- .../apache/cxf/transport/jms/JMSConduit.java| 2 +- .../cxf/transport/jms/JMSConfiguration.java | 22 ++--- .../cxf/systest/jms/JMSClientServerTest.java| 34 3 files changed, 53 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/7d19676c/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java -- diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java index 1a8afc9..9088ba6 100644 --- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java +++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java @@ -209,7 +209,7 @@ public class JMSConduit extends AbstractConduit implements JMSExchangeSender, Me String jmsMessageID = sendMessage(request, outMessage, replyToDestination, correlationId, closer, session); boolean useSyncReceive = ((correlationId == null || userCID != null) && !jmsConfig.isPubSubDomain()) -|| !replyToDestination.equals(staticReplyDestination); +|| (!replyToDestination.equals(staticReplyDestination) && headers.getJMSReplyTo() != null); if (correlationId == null) { correlationId = jmsMessageID; correlationMap.put(correlationId, exchange); http://git-wip-us.apache.org/repos/asf/cxf/blob/7d19676c/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java -- diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java index 5dc0e31..46a0d95 100644 --- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java +++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java @@ -75,6 +75,7 @@ public class JMSConfiguration { * Destination name to send out as replyTo address in the message */ private String replyToDestination; +private volatile Destination replyToDestinationDest; private String messageType = JMSConstants.TEXT_MESSAGE_TYPE; private boolean pubSubDomain; private boolean replyPubSubDomain; @@ -418,14 +419,27 @@ public class JMSConfiguration { } return resolver.resolveDestinationName(session, replyToDestinationName, pubSubDomain); } - + public Destination getReplyToDestination(Session session, String userDestination) throws JMSException { -if (userDestination == null) { +if (userDestination != null) { +return destinationResolver.resolveDestinationName(session, userDestination, replyPubSubDomain); +} +if (replyToDestination == null) { return getReplyDestination(session); } -return destinationResolver.resolveDestinationName(session, userDestination, replyPubSubDomain); +Destination result = replyToDestinationDest; +if (result == null) { +synchronized (this) { +result = replyToDestinationDest; +if (result == null) { +result = destinationResolver.resolveDestinationName(session, replyToDestination, replyPubSubDomain); +replyToDestinationDest = result; +} +} +} +return result; } - + public Destination getReplyDestination(Session session) throws JMSException { Destination result = replyDestinationDest; if (result == null) { http://git-wip-us.apache.org/repos/asf/cxf/blob/7d19676c/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java -- diff --git
cxf git commit: [CXF-7008] Regression: CXF-5788 - JMS replyToDestination doesn't work
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes e2f73f233 -> 4bb0d4ea2 [CXF-7008] Regression: CXF-5788 - JMS replyToDestination doesn't work (cherry picked from commit 0f51e22bc7e13630aeac1996fba4d06e97dea37c) (cherry picked from commit 7d19676c18dd98b82be79bce79d9c82c302a7e11) Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4bb0d4ea Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4bb0d4ea Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4bb0d4ea Branch: refs/heads/3.0.x-fixes Commit: 4bb0d4ea2c15484f4bc032dbe90405a43a99fd6f Parents: e2f73f2 Author: Tadayoshi SatoAuthored: Fri Aug 12 16:06:48 2016 +0900 Committer: Freeman Fang Committed: Fri Aug 12 17:06:45 2016 +0800 -- .../apache/cxf/transport/jms/JMSConduit.java| 2 +- .../cxf/transport/jms/JMSConfiguration.java | 22 ++--- .../cxf/systest/jms/JMSClientServerTest.java| 34 3 files changed, 53 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/4bb0d4ea/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java -- diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java index 00eba50..4c40da4 100644 --- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java +++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java @@ -212,7 +212,7 @@ public class JMSConduit extends AbstractConduit implements JMSExchangeSender, Me String jmsMessageID = sendMessage(request, outMessage, replyToDestination, correlationId, closer, session); boolean useSyncReceive = ((correlationId == null || userCID != null) && !jmsConfig.isPubSubDomain()) -|| !replyToDestination.equals(staticReplyDestination); +|| (!replyToDestination.equals(staticReplyDestination) && headers.getJMSReplyTo() != null); if (correlationId == null) { correlationId = jmsMessageID; correlationMap.put(correlationId, exchange); http://git-wip-us.apache.org/repos/asf/cxf/blob/4bb0d4ea/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java -- diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java index 5dc0e31..46a0d95 100644 --- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java +++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java @@ -75,6 +75,7 @@ public class JMSConfiguration { * Destination name to send out as replyTo address in the message */ private String replyToDestination; +private volatile Destination replyToDestinationDest; private String messageType = JMSConstants.TEXT_MESSAGE_TYPE; private boolean pubSubDomain; private boolean replyPubSubDomain; @@ -418,14 +419,27 @@ public class JMSConfiguration { } return resolver.resolveDestinationName(session, replyToDestinationName, pubSubDomain); } - + public Destination getReplyToDestination(Session session, String userDestination) throws JMSException { -if (userDestination == null) { +if (userDestination != null) { +return destinationResolver.resolveDestinationName(session, userDestination, replyPubSubDomain); +} +if (replyToDestination == null) { return getReplyDestination(session); } -return destinationResolver.resolveDestinationName(session, userDestination, replyPubSubDomain); +Destination result = replyToDestinationDest; +if (result == null) { +synchronized (this) { +result = replyToDestinationDest; +if (result == null) { +result = destinationResolver.resolveDestinationName(session, replyToDestination, replyPubSubDomain); +replyToDestinationDest = result; +} +} +} +return result; } - + public Destination getReplyDestination(Session session) throws JMSException { Destination result = replyDestinationDest; if (result == null) { http://git-wip-us.apache.org/repos/asf/cxf/blob/4bb0d4ea/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java