[1/2] cxf git commit: [CXF-6987] Also consider the classes defined on an application when singletons are populated. This closes #149
Repository: cxf Updated Branches: refs/heads/master 4d76ebba4 -> cb405d427 [CXF-6987] Also consider the classes defined on an application when singletons are populated. This closes #149 Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6becb31c Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6becb31c Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6becb31c Branch: refs/heads/master Commit: 6becb31c62ef0845a5078f4ec2124fe7bc264e58 Parents: 4d76ebb Author: John D. Ament Authored: Tue Aug 2 19:49:29 2016 -0400 Committer: reta Committed: Thu Aug 4 20:29:43 2016 -0400 -- .../cxf/cdi/JAXRSCdiResourceExtension.java | 211 --- .../jaxrs/BookStoreCustomApplication.java | 12 +- 2 files changed, 140 insertions(+), 83 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/6becb31c/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java -- diff --git a/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java b/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java index 85b63f0..99f6d87 100644 --- a/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java +++ b/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java @@ -19,8 +19,13 @@ package org.apache.cxf.cdi; import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import java.util.List; import java.util.ServiceLoader; +import java.util.Set; import javax.enterprise.event.Observes; import javax.enterprise.inject.spi.AfterBeanDiscovery; @@ -41,21 +46,22 @@ import javax.ws.rs.ext.Provider; import org.apache.cxf.Bus; import org.apache.cxf.bus.extension.ExtensionManagerBus; import org.apache.cxf.feature.Feature; +import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; import org.apache.cxf.jaxrs.utils.ResourceUtils; /** * Apache CXF portable CDI extension to support initialization of JAX-RS resources. */ -public class JAXRSCdiResourceExtension implements Extension { +public class JAXRSCdiResourceExtension implements Extension { private Bean< ? > busBean; private Bus bus; - + private final List< Bean< ? > > applicationBeans = new ArrayList< Bean< ? > >(); private final List< Bean< ? > > serviceBeans = new ArrayList< Bean< ? > >(); private final List< Bean< ? > > providerBeans = new ArrayList< Bean< ? > >(); private final List< Bean< ? extends Feature > > featureBeans = new ArrayList< Bean< ? extends Feature > >(); - + @SuppressWarnings("unchecked") public void collect(@Observes final ProcessBean< T > event) { if (event.getAnnotated().isAnnotationPresent(ApplicationPath.class)) { @@ -66,54 +72,56 @@ public class JAXRSCdiResourceExtension implements Extension { providerBeans.add(event.getBean()); } else if (event.getBean().getTypes().contains(Feature.class)) { featureBeans.add((Bean< ? extends Feature >)event.getBean()); -} else if (CdiBusBean.CXF.equals(event.getBean().getName()) +} else if (CdiBusBean.CXF.equals(event.getBean().getName()) && Bus.class.isAssignableFrom(event.getBean().getBeanClass())) { busBean = event.getBean(); } } - + public void load(@Observes final AfterDeploymentValidation event, final BeanManager beanManager) { bus = (Bus)beanManager.getReference( -busBean, -busBean.getBeanClass(), +busBean, +busBean.getBeanClass(), beanManager.createCreationalContext(busBean) ); - + for (final Bean< ? > application: applicationBeans) { final Application instance = (Application)beanManager.getReference( -application, -application.getBeanClass(), -beanManager.createCreationalContext(application) +application, +application.getBeanClass(), +beanManager.createCreationalContext(application) ); - + // If there is an application without any singletons and classes defined, we will -// create a server factory bean with all services and providers discovered. +// create a server factory bean with all services and providers discovered. if (instance.getSingletons().isEmpty() && instance.getClasses().isEmpty()) { final JAXRSServerFactoryBean factory = createFactoryInstance(instance, -loadServic
[2/2] cxf git commit: CXF-6995: Fix the overlap between ResourceUtils.createApplication and JAXRSCdiResourceExtension beans discovery
CXF-6995: Fix the overlap between ResourceUtils.createApplication and JAXRSCdiResourceExtension beans discovery Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/cb405d42 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/cb405d42 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/cb405d42 Branch: refs/heads/master Commit: cb405d4275a5cf30187c4fbf957dbbb70a9eeacf Parents: 6becb31 Author: reta Authored: Thu Aug 4 20:14:33 2016 -0400 Committer: reta Committed: Thu Aug 4 20:30:02 2016 -0400 -- .../cxf/cdi/JAXRSCdiResourceExtension.java | 26 ++-- 1 file changed, 7 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/cb405d42/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java -- diff --git a/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java b/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java index 99f6d87..e674f45 100644 --- a/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java +++ b/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java @@ -22,8 +22,8 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.Map; import java.util.List; +import java.util.Map; import java.util.ServiceLoader; import java.util.Set; @@ -150,42 +150,30 @@ public class JAXRSCdiResourceExtension implements Extension { private JAXRSServerFactoryBean createFactoryInstance(final Application application, final BeanManager beanManager) { final JAXRSServerFactoryBean instance = ResourceUtils.createApplication(application, false, false); -final Map< Class< ? >, List< Object > > classified = classifySingletons(application, beanManager); +final Map< Class< ? >, List< Object > > classified = classes2singletons(application, beanManager); instance.setServiceBeans(classified.get(Path.class)); instance.setProviders(classified.get(Provider.class)); -instance.setFeatures(CastUtils.cast(classified.get(Feature.class), Feature.class)); + instance.getFeatures().addAll(CastUtils.cast(classified.get(Feature.class), Feature.class)); instance.setBus(bus); return instance; } /** - * JAX-RS application has defined singletons as being instances of any providers, resources and features. + * JAX-RS application has defined singletons as being classes of any providers, resources and features. * In the JAXRSServerFactoryBean, those should be split around several method calls depending on instance * type. At the moment, only the Feature is CXF-specific and should be replaced by JAX-RS Feature implementation. * @param application the application instance - * @return classified singletons by instance types + * @return classified instances of classes by instance types */ -private Map< Class< ? >, List< Object > > classifySingletons(final Application application, +private Map< Class< ? >, List< Object > > classes2singletons(final Application application, final BeanManager beanManager) { -final Set singletons = application.getSingletons(); -final Map< Class< ? >, List< Object > > classified = - new HashMap<>(); +final Map< Class< ? >, List< Object > > classified = new HashMap<>(); classified.put(Feature.class, new ArrayList<>()); classified.put(Provider.class, new ArrayList<>()); classified.put(Path.class, new ArrayList<>()); -for (final Object singleton: singletons) { -if (singleton instanceof Feature) { -classified.get(Feature.class).add(singleton); -} else if (singleton.getClass().isAnnotationPresent(Provider.class)) { -classified.get(Provider.class).add(singleton); -} else if (singleton.getClass().isAnnotationPresent(Path.class)) { -classified.get(Path.class).add(singleton); -} -} - // now loop through the classes Set> classes = application.getClasses(); if (!classes.isEmpty()) {
cxf git commit: [CXF-6987] Also consider the classes defined on an application when singletons are populated. This closes #149
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 3610d3fa4 -> 503567af6 [CXF-6987] Also consider the classes defined on an application when singletons are populated. This closes #149 Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/503567af Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/503567af Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/503567af Branch: refs/heads/3.1.x-fixes Commit: 503567af618e7b7a402df5455be7ef7ea0c0a9b6 Parents: 3610d3f Author: John D. Ament Authored: Tue Aug 2 19:49:29 2016 -0400 Committer: reta Committed: Thu Aug 4 18:40:35 2016 -0400 -- .../cxf/cdi/JAXRSCdiResourceExtension.java | 197 ++- .../jaxrs/BookStoreCustomApplication.java | 12 +- 2 files changed, 115 insertions(+), 94 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/503567af/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java -- diff --git a/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java b/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java index b5d88c6..ba69f15 100644 --- a/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java +++ b/integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java @@ -20,10 +20,12 @@ package org.apache.cxf.cdi; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.ServiceLoader; +import java.util.Set; import javax.enterprise.event.Observes; import javax.enterprise.inject.spi.AfterBeanDiscovery; @@ -51,15 +53,15 @@ import org.apache.cxf.jaxrs.utils.ResourceUtils; /** * Apache CXF portable CDI extension to support initialization of JAX-RS resources. */ -public class JAXRSCdiResourceExtension implements Extension { +public class JAXRSCdiResourceExtension implements Extension { private Bean< ? > busBean; private Bus bus; - + private final List< Bean< ? > > applicationBeans = new ArrayList< Bean< ? > >(); private final List< Bean< ? > > serviceBeans = new ArrayList< Bean< ? > >(); private final List< Bean< ? > > providerBeans = new ArrayList< Bean< ? > >(); private final List< Bean< ? extends Feature > > featureBeans = new ArrayList< Bean< ? extends Feature > >(); - + @SuppressWarnings("unchecked") public void collect(@Observes final ProcessBean< T > event) { if (event.getAnnotated().isAnnotationPresent(ApplicationPath.class)) { @@ -70,54 +72,56 @@ public class JAXRSCdiResourceExtension implements Extension { providerBeans.add(event.getBean()); } else if (event.getBean().getTypes().contains(Feature.class)) { featureBeans.add((Bean< ? extends Feature >)event.getBean()); -} else if (CdiBusBean.CXF.equals(event.getBean().getName()) +} else if (CdiBusBean.CXF.equals(event.getBean().getName()) && Bus.class.isAssignableFrom(event.getBean().getBeanClass())) { busBean = event.getBean(); } } - + public void load(@Observes final AfterDeploymentValidation event, final BeanManager beanManager) { bus = (Bus)beanManager.getReference( -busBean, -busBean.getBeanClass(), +busBean, +busBean.getBeanClass(), beanManager.createCreationalContext(busBean) ); - + for (final Bean< ? > application: applicationBeans) { final Application instance = (Application)beanManager.getReference( -application, -application.getBeanClass(), -beanManager.createCreationalContext(application) +application, +application.getBeanClass(), +beanManager.createCreationalContext(application) ); - + // If there is an application without any singletons and classes defined, we will -// create a server factory bean with all services and providers discovered. +// create a server factory bean with all services and providers discovered. if (instance.getSingletons().isEmpty() && instance.getClasses().isEmpty()) { final JAXRSServerFactoryBean factory = createFactoryInstance(instance, -loadServices(beanManager), loadProviders(beanManager), loadFeatures(beanManager)); -factory.init(); +loadServices(beanManager, Collections.>emptySet()), +loadProviders(beanManager, Collections.>e
cxf git commit: Recording .gitmergeinfo Changes
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 75ce1c4bd -> d3be058e4 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/d3be058e Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d3be058e Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d3be058e Branch: refs/heads/3.0.x-fixes Commit: d3be058e453eec89ea9293e5c610f5f3fedebfbe Parents: 75ce1c4 Author: Colm O hEigeartaigh Authored: Thu Aug 4 18:20:04 2016 +0100 Committer: Colm O hEigeartaigh Committed: Thu Aug 4 18:20:04 2016 +0100 -- .gitmergeinfo | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/d3be058e/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index 457b67c..e187794 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -241,6 +241,7 @@ B 35c7bb64928cf92da260c588b6d4ea9d60ccb2f3 B 35da295262a43a59717b6f17e739335a04d197ca B 35f01c94841870afa8331e0591aec8a3bc4ca94d B 35fd58669e740af4e7a83fc6ff544321c0fc8e38 +B 3610d3fa455685ea012e44fb7971ef925fa00fa8 B 362437e222ea79e92078323d865fb0b2d7195610 B 3634fd60f85ae12f9de68c69cb2d15a38dac772c B 36d2bf61511d1921a38d065eb474be802f2f949e @@ -846,6 +847,7 @@ B b7ce0bf1e5106b7913269c1aa24c4ab3aa5631ee B b7d89466ab1c0ef68156cef6deb5a911fbf511f2 B b84bd51dad062c605e8acdcdcfce610aaed7c3b3 B b86d467cd18b5fe91300185a8c62e66d2b20375b +B b86fcc444a31e9b203822a9639a1ac2fd18ac27e B b8fe59b5d696e31b607efca1dc32f2521e99884a B ba00202288bce9ba80692f151c2d73b101400c50 B ba17570e53cec4386f7c6fd40f075c6fbc1c3981 @@ -927,6 +929,7 @@ B ca0b59607b5c401b94fa918abb7b866184a9e1bd B ca1f38bcbcc5097af7e537173cacb24806b4b490 B caae5fb26da8cb211bf2a84fb0116d22400826e0 B cab2ad9c5027ae9574de002ddc70908156e6f722 +B cb0807a79eb133e30e949330775350927db945ef B cb19d05174a3bd078b391c4f6c151ee6e34e2956 B cb2160fee6782b8638477ae7af5ad4cd82d6b88f B cb3e85497e96020bec19a7edb9ae3b02b277bbc9
[3/3] cxf git commit: Splitting STSProperties into a separate file
Splitting STSProperties into a separate file Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/3610d3fa Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/3610d3fa Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/3610d3fa Branch: refs/heads/3.1.x-fixes Commit: 3610d3fa455685ea012e44fb7971ef925fa00fa8 Parents: cb0807a Author: Colm O hEigeartaigh Authored: Thu Aug 4 16:11:39 2016 +0100 Committer: Colm O hEigeartaigh Committed: Thu Aug 4 18:16:20 2016 +0100 -- .../sts/token/validator/SAMLTokenValidator.java | 8 +++- .../cxf/systest/sts/deployment/cxf-x509.xml | 2 +- .../systest/sts/deployment/stax-cxf-x509.xml| 2 +- .../cxf/systest/sts/deployment/sts/cxf-sts.xml | 46 +++- .../cxf/systest/sts/deployment/sts/realms.xml | 17 .../sts/deployment/sts/sts-properties.xml | 45 +++ 6 files changed, 75 insertions(+), 45 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/3610d3fa/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java -- diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java index 7ac6650..59edca2 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java @@ -231,8 +231,12 @@ public class SAMLTokenValidator implements TokenValidator { // Get the realm of the SAML token String tokenRealm = null; -if (samlRealmCodec != null) { -tokenRealm = samlRealmCodec.getRealmFromToken(assertion); +SAMLRealmCodec codec = samlRealmCodec; +if (codec == null) { +codec = stsProperties.getSamlRealmCodec(); +} +if (codec != null) { +tokenRealm = codec.getRealmFromToken(assertion); // verify the realm against the cached token if (secToken != null) { Map props = secToken.getProperties(); http://git-wip-us.apache.org/repos/asf/cxf/blob/3610d3fa/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-x509.xml -- diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-x509.xml b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-x509.xml index bf00fdb..2790c80 100644 --- a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-x509.xml +++ b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-x509.xml @@ -29,7 +29,7 @@ - + http://git-wip-us.apache.org/repos/asf/cxf/blob/3610d3fa/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-x509.xml -- diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-x509.xml b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-x509.xml index b38e515..26fe7a8 100644 --- a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-x509.xml +++ b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-x509.xml @@ -29,7 +29,7 @@ - + http://git-wip-us.apache.org/repos/asf/cxf/blob/3610d3fa/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/sts/cxf-sts.xml -- diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/sts/cxf-sts.xml b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/sts/cxf-sts.xml index 7c54d26..cb737f9 100644 --- a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/sts/cxf-sts.xml +++ b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/sts/cxf-sts.xml @@ -26,13 +26,11 @@ - - - + - - + + @@ -47,18 +45,13 @@ - - - - + +
[2/3] cxf git commit: More config refactoring
More config refactoring Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/cb0807a7 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/cb0807a7 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/cb0807a7 Branch: refs/heads/3.1.x-fixes Commit: cb0807a79eb133e30e949330775350927db945ef Parents: b86fcc4 Author: Colm O hEigeartaigh Authored: Thu Aug 4 14:30:43 2016 +0100 Committer: Colm O hEigeartaigh Committed: Thu Aug 4 18:16:20 2016 +0100 -- .../sts/delegation/cxf-sts-transport.xml| 13 +-- .../cxf/systest/sts/deployment/cxf-sts.xml | 111 --- .../systest/sts/deployment/cxf-transport.xml| 2 +- .../systest/sts/deployment/cxf-ut-encrypted.xml | 2 +- .../cxf/systest/sts/deployment/cxf-ut.xml | 2 +- .../cxf/systest/sts/deployment/cxf-x509.xml | 2 +- .../cxf/systest/sts/deployment/realms.xml | 33 -- .../sts/deployment/stax-cxf-transport.xml | 2 +- .../sts/deployment/stax-cxf-ut-encrypted.xml| 2 +- .../cxf/systest/sts/deployment/stax-cxf-ut.xml | 2 +- .../systest/sts/deployment/stax-cxf-x509.xml| 2 +- .../cxf/systest/sts/deployment/sts/cxf-sts.xml | 111 +++ .../cxf/systest/sts/deployment/sts/realms.xml | 33 ++ .../sts/issuer/cxf-issuer-sts-transport.xml | 99 + 14 files changed, 160 insertions(+), 256 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/cb0807a7/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/delegation/cxf-sts-transport.xml -- diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/delegation/cxf-sts-transport.xml b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/delegation/cxf-sts-transport.xml index 7240914..2510ebb 100644 --- a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/delegation/cxf-sts-transport.xml +++ b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/delegation/cxf-sts-transport.xml @@ -24,6 +24,9 @@ + + + @@ -83,16 +86,6 @@ https://localhost:(\d)*/doubleit/services/doubleittransport.* - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/cxf/blob/cb0807a7/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml -- diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml deleted file mode 100644 index 7c54d26..000 --- a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml +++ /dev/null @@ -1,111 +0,0 @@ - - -http://www.springframework.org/schema/beans"; xmlns:cxf="http://cxf.apache.org/core"; xmlns:jaxws="http://cxf.apache.org/jaxws"; xmlns:sec="http://cxf.apache.org/configuration/security"; xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"; xmlns:test="http://apache.org/hello_world_soap_http"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:util="http://www.springframework.org/schema/util"; xsi:schemaLocation=" http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/sc hemas/configuration/http-jetty.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd";> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -http(s)?://localhost:(\d)*/doubleit/services/doubleit.* - - - - - - - - - - - - - - -htt
[1/3] cxf git commit: Refactoring UT Encrypted STS tests
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 21f50ebda -> 3610d3fa4 Refactoring UT Encrypted STS tests Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b86fcc44 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b86fcc44 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b86fcc44 Branch: refs/heads/3.1.x-fixes Commit: b86fcc444a31e9b203822a9639a1ac2fd18ac27e Parents: 21f50eb Author: Colm O hEigeartaigh Authored: Thu Aug 4 13:56:47 2016 +0100 Committer: Colm O hEigeartaigh Committed: Thu Aug 4 18:16:19 2016 +0100 -- .../sts/asymmetric/AsymmetricBindingTest.java | 8 .../sts/symmetric/SymmetricBindingTest.java | 8 .../cxf/systest/sts/deployment/cxf-sts.xml | 7 +++ .../systest/sts/deployment/cxf-ut-encrypted.xml | 48 +++ .../cxf/systest/sts/deployment/cxf-ut.xml | 32 - .../sts/deployment/stax-cxf-ut-encrypted.xml| 49 .../cxf/systest/sts/deployment/stax-cxf-ut.xml | 33 - 7 files changed, 120 insertions(+), 65 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/b86fcc44/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/asymmetric/AsymmetricBindingTest.java -- diff --git a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/asymmetric/AsymmetricBindingTest.java b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/asymmetric/AsymmetricBindingTest.java index 7f64568..614361f 100644 --- a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/asymmetric/AsymmetricBindingTest.java +++ b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/asymmetric/AsymmetricBindingTest.java @@ -88,9 +88,17 @@ public class AsymmetricBindingTest extends AbstractBusClientServerTestBase { stsServer.setContext("cxf-ut.xml"); assertTrue(launchServer(stsServer)); +stsServer = new STSServer(); +stsServer.setContext("cxf-ut-encrypted.xml"); +assertTrue(launchServer(stsServer)); + StaxSTSServer staxStsServer = new StaxSTSServer(); staxStsServer.setContext("stax-cxf-ut.xml"); assertTrue(launchServer(staxStsServer)); + +staxStsServer = new StaxSTSServer(); +staxStsServer.setContext("stax-cxf-ut-encrypted.xml"); +assertTrue(launchServer(staxStsServer)); } @Parameters(name = "{0}") http://git-wip-us.apache.org/repos/asf/cxf/blob/b86fcc44/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java -- diff --git a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java index bbeb002..05681fc 100644 --- a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java +++ b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java @@ -99,9 +99,17 @@ public class SymmetricBindingTest extends AbstractBusClientServerTestBase { stsServer.setContext("cxf-ut.xml"); assertTrue(launchServer(stsServer)); +stsServer = new STSServer(); +stsServer.setContext("cxf-ut-encrypted.xml"); +assertTrue(launchServer(stsServer)); + StaxSTSServer staxStsServer = new StaxSTSServer(); staxStsServer.setContext("stax-cxf-ut.xml"); assertTrue(launchServer(staxStsServer)); + +staxStsServer = new StaxSTSServer(); +staxStsServer.setContext("stax-cxf-ut-encrypted.xml"); +assertTrue(launchServer(staxStsServer)); } @Parameters(name = "{0}") http://git-wip-us.apache.org/repos/asf/cxf/blob/b86fcc44/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml -- diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml index 926dc01..7c54d26 100644 --- a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml +++ b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml @@ -83,6 +83,12 @@ + + +http://www.w3.org/2001/04/xmlenc#aes128-cbc"/> +http://www.w3.org/2001/04/xmlenc#rsa-
[2/3] cxf git commit: More config refactoring
More config refactoring Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a3928641 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a3928641 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a3928641 Branch: refs/heads/master Commit: a3928641e1be035e68ff891cb40f228ab19c3e3a Parents: 686dfd6 Author: Colm O hEigeartaigh Authored: Thu Aug 4 14:30:43 2016 +0100 Committer: Colm O hEigeartaigh Committed: Thu Aug 4 18:03:54 2016 +0100 -- .../sts/delegation/cxf-sts-transport.xml| 13 +-- .../cxf/systest/sts/deployment/cxf-sts.xml | 111 --- .../systest/sts/deployment/cxf-transport.xml| 2 +- .../systest/sts/deployment/cxf-ut-encrypted.xml | 2 +- .../cxf/systest/sts/deployment/cxf-ut.xml | 2 +- .../cxf/systest/sts/deployment/cxf-x509.xml | 2 +- .../cxf/systest/sts/deployment/realms.xml | 33 -- .../sts/deployment/stax-cxf-transport.xml | 2 +- .../sts/deployment/stax-cxf-ut-encrypted.xml| 2 +- .../cxf/systest/sts/deployment/stax-cxf-ut.xml | 2 +- .../systest/sts/deployment/stax-cxf-x509.xml| 2 +- .../cxf/systest/sts/deployment/sts/cxf-sts.xml | 111 +++ .../cxf/systest/sts/deployment/sts/realms.xml | 33 ++ .../sts/issuer/cxf-issuer-sts-transport.xml | 99 + 14 files changed, 160 insertions(+), 256 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/a3928641/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/delegation/cxf-sts-transport.xml -- diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/delegation/cxf-sts-transport.xml b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/delegation/cxf-sts-transport.xml index 7240914..2510ebb 100644 --- a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/delegation/cxf-sts-transport.xml +++ b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/delegation/cxf-sts-transport.xml @@ -24,6 +24,9 @@ + + + @@ -83,16 +86,6 @@ https://localhost:(\d)*/doubleit/services/doubleittransport.* - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/cxf/blob/a3928641/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml -- diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml deleted file mode 100644 index 7c54d26..000 --- a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml +++ /dev/null @@ -1,111 +0,0 @@ - - -http://www.springframework.org/schema/beans"; xmlns:cxf="http://cxf.apache.org/core"; xmlns:jaxws="http://cxf.apache.org/jaxws"; xmlns:sec="http://cxf.apache.org/configuration/security"; xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"; xmlns:test="http://apache.org/hello_world_soap_http"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:util="http://www.springframework.org/schema/util"; xsi:schemaLocation=" http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/sc hemas/configuration/http-jetty.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd";> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -http(s)?://localhost:(\d)*/doubleit/services/doubleit.* - - - - - - - - - - - - - - -http://w
[1/3] cxf git commit: Splitting STSProperties into a separate file
Repository: cxf Updated Branches: refs/heads/master fdea67f0b -> 4d76ebba4 Splitting STSProperties into a separate file Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4d76ebba Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4d76ebba Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4d76ebba Branch: refs/heads/master Commit: 4d76ebba427b0c7e1b3a014fd7c1cf7ff92c8138 Parents: a392864 Author: Colm O hEigeartaigh Authored: Thu Aug 4 16:11:39 2016 +0100 Committer: Colm O hEigeartaigh Committed: Thu Aug 4 18:03:54 2016 +0100 -- .../sts/token/validator/SAMLTokenValidator.java | 8 +++- .../cxf/systest/sts/deployment/cxf-x509.xml | 2 +- .../systest/sts/deployment/stax-cxf-x509.xml| 2 +- .../cxf/systest/sts/deployment/sts/cxf-sts.xml | 46 +++- .../cxf/systest/sts/deployment/sts/realms.xml | 17 .../sts/deployment/sts/sts-properties.xml | 45 +++ 6 files changed, 75 insertions(+), 45 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/4d76ebba/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java -- diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java index 7ac6650..59edca2 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java @@ -231,8 +231,12 @@ public class SAMLTokenValidator implements TokenValidator { // Get the realm of the SAML token String tokenRealm = null; -if (samlRealmCodec != null) { -tokenRealm = samlRealmCodec.getRealmFromToken(assertion); +SAMLRealmCodec codec = samlRealmCodec; +if (codec == null) { +codec = stsProperties.getSamlRealmCodec(); +} +if (codec != null) { +tokenRealm = codec.getRealmFromToken(assertion); // verify the realm against the cached token if (secToken != null) { Map props = secToken.getProperties(); http://git-wip-us.apache.org/repos/asf/cxf/blob/4d76ebba/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-x509.xml -- diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-x509.xml b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-x509.xml index bf00fdb..2790c80 100644 --- a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-x509.xml +++ b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-x509.xml @@ -29,7 +29,7 @@ - + http://git-wip-us.apache.org/repos/asf/cxf/blob/4d76ebba/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-x509.xml -- diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-x509.xml b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-x509.xml index b38e515..26fe7a8 100644 --- a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-x509.xml +++ b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/stax-cxf-x509.xml @@ -29,7 +29,7 @@ - + http://git-wip-us.apache.org/repos/asf/cxf/blob/4d76ebba/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/sts/cxf-sts.xml -- diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/sts/cxf-sts.xml b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/sts/cxf-sts.xml index 7c54d26..cb737f9 100644 --- a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/sts/cxf-sts.xml +++ b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/sts/cxf-sts.xml @@ -26,13 +26,11 @@ - - - + - - + + @@ -47,18 +45,13 @@ -
[3/3] cxf git commit: Refactoring UT Encrypted STS tests
Refactoring UT Encrypted STS tests Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/686dfd64 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/686dfd64 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/686dfd64 Branch: refs/heads/master Commit: 686dfd647c2dca0e181163eb486c32d8ea84856b Parents: fdea67f Author: Colm O hEigeartaigh Authored: Thu Aug 4 13:56:47 2016 +0100 Committer: Colm O hEigeartaigh Committed: Thu Aug 4 18:03:54 2016 +0100 -- .../sts/asymmetric/AsymmetricBindingTest.java | 8 .../sts/symmetric/SymmetricBindingTest.java | 8 .../cxf/systest/sts/deployment/cxf-sts.xml | 7 +++ .../systest/sts/deployment/cxf-ut-encrypted.xml | 48 +++ .../cxf/systest/sts/deployment/cxf-ut.xml | 32 - .../sts/deployment/stax-cxf-ut-encrypted.xml| 49 .../cxf/systest/sts/deployment/stax-cxf-ut.xml | 33 - 7 files changed, 120 insertions(+), 65 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/686dfd64/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/asymmetric/AsymmetricBindingTest.java -- diff --git a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/asymmetric/AsymmetricBindingTest.java b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/asymmetric/AsymmetricBindingTest.java index f3082f1..47a68cc 100644 --- a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/asymmetric/AsymmetricBindingTest.java +++ b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/asymmetric/AsymmetricBindingTest.java @@ -88,9 +88,17 @@ public class AsymmetricBindingTest extends AbstractBusClientServerTestBase { stsServer.setContext("cxf-ut.xml"); assertTrue(launchServer(stsServer)); +stsServer = new STSServer(); +stsServer.setContext("cxf-ut-encrypted.xml"); +assertTrue(launchServer(stsServer)); + StaxSTSServer staxStsServer = new StaxSTSServer(); staxStsServer.setContext("stax-cxf-ut.xml"); assertTrue(launchServer(staxStsServer)); + +staxStsServer = new StaxSTSServer(); +staxStsServer.setContext("stax-cxf-ut-encrypted.xml"); +assertTrue(launchServer(staxStsServer)); } @Parameters(name = "{0}") http://git-wip-us.apache.org/repos/asf/cxf/blob/686dfd64/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java -- diff --git a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java index bbeb002..05681fc 100644 --- a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java +++ b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/symmetric/SymmetricBindingTest.java @@ -99,9 +99,17 @@ public class SymmetricBindingTest extends AbstractBusClientServerTestBase { stsServer.setContext("cxf-ut.xml"); assertTrue(launchServer(stsServer)); +stsServer = new STSServer(); +stsServer.setContext("cxf-ut-encrypted.xml"); +assertTrue(launchServer(stsServer)); + StaxSTSServer staxStsServer = new StaxSTSServer(); staxStsServer.setContext("stax-cxf-ut.xml"); assertTrue(launchServer(staxStsServer)); + +staxStsServer = new StaxSTSServer(); +staxStsServer.setContext("stax-cxf-ut-encrypted.xml"); +assertTrue(launchServer(staxStsServer)); } @Parameters(name = "{0}") http://git-wip-us.apache.org/repos/asf/cxf/blob/686dfd64/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml -- diff --git a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml index 926dc01..7c54d26 100644 --- a/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml +++ b/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml @@ -83,6 +83,12 @@ + + +http://www.w3.org/2001/04/xmlenc#aes128-cbc"/> +http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/> + + @@ -90,6 +96,7 @@
svn commit: r994464 - in /websites/production/cxf/content: cache/docs.pageCache docs/jax-rs-jose.html
Author: buildbot Date: Thu Aug 4 13:47:32 2016 New Revision: 994464 Log: Production update by buildbot for cxf Modified: websites/production/cxf/content/cache/docs.pageCache websites/production/cxf/content/docs/jax-rs-jose.html Modified: websites/production/cxf/content/cache/docs.pageCache == Binary files - no diff available. Modified: websites/production/cxf/content/docs/jax-rs-jose.html == --- websites/production/cxf/content/docs/jax-rs-jose.html (original) +++ websites/production/cxf/content/docs/jax-rs-jose.html Thu Aug 4 13:47:32 2016 @@ -119,11 +119,11 @@ Apache CXF -- JAX-RS JOSE /**/ +/*]]>*/ IntroductionMaven DependenciesJava and JCE Policy JOSE Overview and Implementation JWA AlgorithmsJWK KeysJWS Signature Signature and Verification ProvidersJWS CompactJWS JSONJWS with Detached ContentJWS with Unencoded Payload @@ -321,6 +321,13 @@ SecretKey wrapperKey2 = CryptoUtils.crea KeyEncryptionProvider keyEncryption1 = JweUtils.getSecretKeyEncryptionAlgorithm(wrapperKey1, KeyAlgorithm.A128KW); KeyEncryptionProvider keyEncryption2 = JweUtils.getSecretKeyEncryptionAlgorithm(wrapperKey2, KeyAlgorithm.A128KW); +// If you work with the public keys do this instead: +// PublicKey publicKey1 = ...; +// KeyEncryptionProvider keyEncryption1 = JweUtils.getPublicKeyEncryptionProvider(publicKey1, KeyAlgorithm.RSA_AEP); +// PublicKey publicKey2 = ...; +// KeyEncryptionProvider keyEncryption2 = JweUtils.getPublicKeyEncryptionProvider(publicKey2, KeyAlgorithm.RSA_AEP); + + // Create ContentEncryptionProvider: ContentEncryptionProvider contentEncryption = new AesGcmContentEncryptionAlgorithm(CEK_BYTES, ContentAlgorithm.A128GCM); // If a single recipient then this line is enough:
svn commit: r994458 - in /websites/production/cxf/content: cache/docs.pageCache docs/jax-rs-jose.html
Author: buildbot Date: Thu Aug 4 12:47:45 2016 New Revision: 994458 Log: Production update by buildbot for cxf Modified: websites/production/cxf/content/cache/docs.pageCache websites/production/cxf/content/docs/jax-rs-jose.html Modified: websites/production/cxf/content/cache/docs.pageCache == Binary files - no diff available. Modified: websites/production/cxf/content/docs/jax-rs-jose.html == --- websites/production/cxf/content/docs/jax-rs-jose.html (original) +++ websites/production/cxf/content/docs/jax-rs-jose.html Thu Aug 4 12:47:45 2016 @@ -119,11 +119,11 @@ Apache CXF -- JAX-RS JOSE /**/ +/*]]>*/ IntroductionMaven DependenciesJava and JCE Policy JOSE Overview and Implementation JWA AlgorithmsJWK KeysJWS Signature Signature and Verification ProvidersJWS CompactJWS JSONJWS with Detached ContentJWS with Unencoded Payload @@ -313,28 +313,42 @@ String decryptedText = decryption.decryp assertEquals(content, decryptedText); JWE JSONWhile JWE Compact is optimized and represents a concatenation of 5 Base64URL values, JWE JSON is an open JSON container, see https://tools.ietf.org/html/rfc7516#appendix-A.4"; rel="nofollow">Appendix A4.The most interesting feature of JWE JSON is that allows a content be encrypted by multiple key encryption keys, with te resulting sequence targeted at multiple recipients. For example, the immediate consumer will decrypt the content with its own key decryption key, forward the payload to the next consumer, etc. https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJsonProducer.java"; rel="nofollow">JweJsonProducer and https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose/src/m ain/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumer.java" rel="nofollow">JweJsonConsumer support producing and consuming JWS JSON sequences.Here is the code example:CXF JweJson final String text = "The true sign of intelligence is not knowledge but imagination."; +// Create the secret keys for encrypting the content encryption key: SecretKey wrapperKey1 = CryptoUtils.createSecretKeySpec(WRAPPER_BYTES1, "AES"); SecretKey wrapperKey2 = CryptoUtils.createSecretKeySpec(WRAPPER_BYTES2, "AES"); - -JweHeaders protectedHeaders = new JweHeaders(ContentAlgorithm.A128GCM); -JweHeaders sharedUnprotectedHeaders = new JweHeaders(); -sharedUnprotectedHeaders.setJsonWebKeysUrl("https://server.example.com/keys.jwks";); -sharedUnprotectedHeaders.setKeyEncryptionAlgorithm(KeyAlgorithm.A128KW); - -ContentEncryptionProvider contentEncryption = new AesGcmContentEncryptionAlgorithm(CEK_BYTES, ContentAlgorithm.A128GCM); -// if a single recipient then this line is enough: -// JweUtils.getContentEncryptionProvider(ContentAlgorithm.A128GCM); - -KeyEncryptionProvider keyEncryption1 = JweUtils.getSecretKeyEncryptionAlgorithm(wrapperKey1, KeyAlgorithm.A128KW); -JweEncryptionProvider jweEnc1 = new JweEncryption(keyEncryption1, contentEncryption); +// Create KeyEncryptionProviders initialized with these secret keys: +KeyEncryptionProvider keyEncryption1 = JweUtils.getSecretKeyEncryptionAlgorithm(wrapperKey1, KeyAlgorithm.A128KW); KeyEncryptionProvider keyEncryption2 = JweUtils.getSecretKeyEncryptionAlgorithm(wrapperKey2, KeyAlgorithm.A128KW); -JweEncryptionProvider jweEnc2 = new JweEncryption(keyEncryption2, contentEncryption); +// Create ContentEncryptionProvider: +ContentEncryptionProvider contentEncryption = new AesGcmContentEncryptionAlgorithm(CEK_BYTES, ContentAlgorithm.A128GCM); +// If a single recipient then this line is enough: +//ContentEncryptionProvider contentEncryption = JweUtils.getContentEncryptionProvider(ContentAlgorithm.A128GCM); + +// Prepare JweEncryptionProviders, one per each recipient. ListjweProviders = new LinkedList (); -jweProviders.add(jweEnc1); -jweProviders.add(jweEnc2); - +jweProviders.add(new JweEncryption(keyEncryption1, contentEncryption)); +jweProviders.add(new JweEncryption(keyEncryption2, contentEncryption)); + + +// Let the recipients know that the key encryption algorithm is A128KW. +// This step is optional if the recipients support A128KW only. +// Note because these headers are shared A128KW needs to be supported by all the recipients. +// Per-reciepient specific headers can be used instead to note the key encryption algorithm if req
cxf git commit: Minor updatew to JweUtils
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 2bc15f89b -> 21f50ebda Minor updatew to JweUtils Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/21f50ebd Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/21f50ebd Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/21f50ebd Branch: refs/heads/3.1.x-fixes Commit: 21f50ebda6a66a4ae3860dd95b63add684546ced Parents: 2bc15f8 Author: Sergey Beryozkin Authored: Thu Aug 4 13:15:23 2016 +0100 Committer: Sergey Beryozkin Committed: Thu Aug 4 13:17:42 2016 +0100 -- .../org/apache/cxf/rs/security/jose/jwe/JweUtils.java | 14 ++ 1 file changed, 14 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/21f50ebd/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java -- diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java index 92038f3..aa53f27 100644 --- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java +++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java @@ -508,6 +508,11 @@ public final class JweUtils { } public static JweEncryptionProvider createJweEncryptionProvider(PublicKey key, KeyAlgorithm keyAlgo, + ContentAlgorithm contentEncryptionAlgo) { +return createJweEncryptionProvider(key, keyAlgo, contentEncryptionAlgo, null); +} +public static JweEncryptionProvider createJweEncryptionProvider(PublicKey key, + KeyAlgorithm keyAlgo, ContentAlgorithm contentEncryptionAlgo, String compression) { KeyEncryptionProvider keyEncryptionProvider = getPublicKeyEncryptionProvider(key, keyAlgo); @@ -520,6 +525,11 @@ public final class JweUtils { } public static JweEncryptionProvider createJweEncryptionProvider(SecretKey key, KeyAlgorithm keyAlgo, + ContentAlgorithm contentEncryptionAlgo) { +return createJweEncryptionProvider(key, keyAlgo, contentEncryptionAlgo, null); +} +public static JweEncryptionProvider createJweEncryptionProvider(SecretKey key, + KeyAlgorithm keyAlgo, ContentAlgorithm contentEncryptionAlgo, String compression) { KeyEncryptionProvider keyEncryptionProvider = getSecretKeyEncryptionAlgorithm(key, keyAlgo); @@ -531,6 +541,10 @@ public final class JweUtils { return createJweEncryptionProvider(keyEncryptionProvider, headers); } public static JweEncryptionProvider createJweEncryptionProvider(JsonWebKey key, + ContentAlgorithm contentEncryptionAlgo) { +return createJweEncryptionProvider(key, contentEncryptionAlgo, null); +} +public static JweEncryptionProvider createJweEncryptionProvider(JsonWebKey key, ContentAlgorithm contentEncryptionAlgo, String compression) { KeyEncryptionProvider keyEncryptionProvider = getKeyEncryptionProvider(key);
cxf git commit: Minor updatew to JweUtils
Repository: cxf Updated Branches: refs/heads/master 764008097 -> fdea67f0b Minor updatew to JweUtils Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/fdea67f0 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/fdea67f0 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/fdea67f0 Branch: refs/heads/master Commit: fdea67f0bd1388f78247754f3df38f245f64d73d Parents: 7640080 Author: Sergey Beryozkin Authored: Thu Aug 4 13:15:23 2016 +0100 Committer: Sergey Beryozkin Committed: Thu Aug 4 13:15:23 2016 +0100 -- .../org/apache/cxf/rs/security/jose/jwe/JweUtils.java | 14 ++ 1 file changed, 14 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/fdea67f0/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java -- diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java index 92038f3..aa53f27 100644 --- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java +++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java @@ -508,6 +508,11 @@ public final class JweUtils { } public static JweEncryptionProvider createJweEncryptionProvider(PublicKey key, KeyAlgorithm keyAlgo, + ContentAlgorithm contentEncryptionAlgo) { +return createJweEncryptionProvider(key, keyAlgo, contentEncryptionAlgo, null); +} +public static JweEncryptionProvider createJweEncryptionProvider(PublicKey key, + KeyAlgorithm keyAlgo, ContentAlgorithm contentEncryptionAlgo, String compression) { KeyEncryptionProvider keyEncryptionProvider = getPublicKeyEncryptionProvider(key, keyAlgo); @@ -520,6 +525,11 @@ public final class JweUtils { } public static JweEncryptionProvider createJweEncryptionProvider(SecretKey key, KeyAlgorithm keyAlgo, + ContentAlgorithm contentEncryptionAlgo) { +return createJweEncryptionProvider(key, keyAlgo, contentEncryptionAlgo, null); +} +public static JweEncryptionProvider createJweEncryptionProvider(SecretKey key, + KeyAlgorithm keyAlgo, ContentAlgorithm contentEncryptionAlgo, String compression) { KeyEncryptionProvider keyEncryptionProvider = getSecretKeyEncryptionAlgorithm(key, keyAlgo); @@ -531,6 +541,10 @@ public final class JweUtils { return createJweEncryptionProvider(keyEncryptionProvider, headers); } public static JweEncryptionProvider createJweEncryptionProvider(JsonWebKey key, + ContentAlgorithm contentEncryptionAlgo) { +return createJweEncryptionProvider(key, contentEncryptionAlgo, null); +} +public static JweEncryptionProvider createJweEncryptionProvider(JsonWebKey key, ContentAlgorithm contentEncryptionAlgo, String compression) { KeyEncryptionProvider keyEncryptionProvider = getKeyEncryptionProvider(key);
[1/3] cxf git commit: [CXF-6990] Sorting tag list before writing out
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 90f9a1555 -> 75ce1c4bd refs/heads/3.1.x-fixes fd958fdbc -> 2bc15f89b refs/heads/master bacef091c -> 764008097 [CXF-6990] Sorting tag list before writing out Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2bc15f89 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2bc15f89 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2bc15f89 Branch: refs/heads/3.1.x-fixes Commit: 2bc15f89b93716aeaa7c37fc650a177408257a98 Parents: fd958fd Author: Francesco Chicchiriccò Authored: Thu Aug 4 11:38:43 2016 +0200 Committer: Francesco Chicchiriccò Committed: Thu Aug 4 11:38:43 2016 +0200 -- .../org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java | 10 ++ 1 file changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/2bc15f89/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java -- diff --git a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java index e6f7be2..ae6dc27 100644 --- a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java +++ b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java @@ -23,6 +23,7 @@ import java.io.OutputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -141,6 +142,15 @@ public class Swagger2Serializers extends SwaggerSerializers { } } } +if (replaceTags && data.getTags() != null) { +Collections.sort(data.getTags(), new Comparator() { + +@Override +public int compare(final Tag tag1, final Tag tag2) { +return tag1.getName().compareTo(tag2.getName()); +} +}); +} super.writeTo(data, type, genericType, annotations, mediaType, headers, out); }
[3/3] cxf git commit: Sorting tag list before writing out
Sorting tag list before writing out Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/76400809 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/76400809 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/76400809 Branch: refs/heads/master Commit: 764008097bd14edc7531c990c4b056ab0a2dc040 Parents: bacef09 Author: Francesco Chicchiriccò Authored: Thu Aug 4 11:38:43 2016 +0200 Committer: Francesco Chicchiriccò Committed: Thu Aug 4 11:47:17 2016 +0200 -- .../org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java | 10 ++ 1 file changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/76400809/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java -- diff --git a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java index e6f7be2..ae6dc27 100644 --- a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java +++ b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java @@ -23,6 +23,7 @@ import java.io.OutputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -141,6 +142,15 @@ public class Swagger2Serializers extends SwaggerSerializers { } } } +if (replaceTags && data.getTags() != null) { +Collections.sort(data.getTags(), new Comparator() { + +@Override +public int compare(final Tag tag1, final Tag tag2) { +return tag1.getName().compareTo(tag2.getName()); +} +}); +} super.writeTo(data, type, genericType, annotations, mediaType, headers, out); }
[2/3] cxf git commit: [CXF-6990] Sorting tag list before writing out
[CXF-6990] Sorting tag list before writing out Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/75ce1c4b Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/75ce1c4b Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/75ce1c4b Branch: refs/heads/3.0.x-fixes Commit: 75ce1c4bd7b08cad5ee0bc8684cd289bba06c975 Parents: 90f9a15 Author: Francesco Chicchiriccò Authored: Thu Aug 4 11:46:38 2016 +0200 Committer: Francesco Chicchiriccò Committed: Thu Aug 4 11:46:38 2016 +0200 -- .../org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java | 10 ++ 1 file changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/75ce1c4b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java -- diff --git a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java index c6dcdae..230489c 100644 --- a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java +++ b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Serializers.java @@ -23,6 +23,7 @@ import java.io.OutputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -142,6 +143,15 @@ public class Swagger2Serializers extends SwaggerSerializers { } } } +if (replaceTags && data.getTags() != null) { +Collections.sort(data.getTags(), new Comparator() { + +@Override +public int compare(final Tag tag1, final Tag tag2) { +return tag1.getName().compareTo(tag2.getName()); +} +}); +} super.writeTo(data, type, genericType, annotations, mediaType, headers, out); }