cxf git commit: Support @Policy annotation on impl methods. Fixes the Policy annotation test Colm added
Repository: cxf Updated Branches: refs/heads/master abc147c8c -> 28f130c59 Support @Policy annotation on impl methods. Fixes the Policy annotation test Colm added Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/28f130c5 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/28f130c5 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/28f130c5 Branch: refs/heads/master Commit: 28f130c59cad98037b4812f21d3610b96a3edc49 Parents: abc147c Author: Daniel Kulp Authored: Tue May 24 13:30:21 2016 -0400 Committer: Daniel Kulp Committed: Tue May 24 13:30:21 2016 -0400 -- .../java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java | 5 ++--- .../cxf/wsdl/service/factory/ReflectionServiceFactoryBean.java | 4 +++- .../cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java | 4 +++- .../test/java/org/apache/cxf/systest/ws/fault/FaultTest.java| 2 -- 4 files changed, 8 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/28f130c5/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java -- diff --git a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java index b35295e..c9e2e32 100644 --- a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java +++ b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java @@ -91,9 +91,8 @@ public class PolicyAnnotationListener implements FactoryBeanListener { if (ep.getEndpointInfo().getInterface() != null) { addPolicies(factory, ep, cls); -// this will allow us to support annotations in Implementations, but only for -// class level annotations. Method level annotations are not currently supported -// for implementations. The call has been moved here so that the ServiceInfo +// this will allow us to support annotations in Implementations. +// The call has been moved here so that the ServiceInfo // policy stuff is loaded before jaxws factory calls the PolicyEngineImpl addEndpointImplPolicies(factory, ep, implCls); } http://git-wip-us.apache.org/repos/asf/cxf/blob/28f130c5/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/ReflectionServiceFactoryBean.java -- diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/ReflectionServiceFactoryBean.java b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/ReflectionServiceFactoryBean.java index 1c65fac..c55b832 100644 --- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/ReflectionServiceFactoryBean.java +++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/ReflectionServiceFactoryBean.java @@ -84,6 +84,7 @@ import org.apache.cxf.resource.ResourceManager; import org.apache.cxf.service.Service; import org.apache.cxf.service.ServiceImpl; import org.apache.cxf.service.ServiceModelSchemaValidator; +import org.apache.cxf.service.factory.FactoryBeanListener; import org.apache.cxf.service.factory.FactoryBeanListener.Event; import org.apache.cxf.service.factory.ServiceConstructionException; import org.apache.cxf.service.factory.SimpleMethodDispatcher; @@ -355,7 +356,8 @@ public class ReflectionServiceFactoryBean extends org.apache.cxf.service.factory } public void updateBindingOperation(BindingOperationInfo boi) { -//nothing +Method m = getMethodDispatcher().getMethod(boi); +sendEvent(FactoryBeanListener.Event.BINDING_OPERATION_CREATED, boi.getBinding(), boi, m); } public Endpoint createEndpoint(EndpointInfo ei) throws EndpointException { http://git-wip-us.apache.org/repos/asf/cxf/blob/28f130c5/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java -- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java index 0d3d6a7..fbbf957 100644 --- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java +++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java @@ -30,7 +30,9 @@ import org.example.contract.doubleit.DoubleItFault; import org.example.contract.doubleit.DoubleItPortType; @WebService(targetNamespace = "http://w
[1/2] cxf git commit: Fixing 3.1.x build failure
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 8f0f05a7d -> 4de35dea1 Fixing 3.1.x build failure Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/35fd5866 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/35fd5866 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/35fd5866 Branch: refs/heads/3.1.x-fixes Commit: 35fd58669e740af4e7a83fc6ff544321c0fc8e38 Parents: 4c64e8b Author: Sergey Beryozkin Authored: Tue May 24 17:26:46 2016 +0100 Committer: Sergey Beryozkin Committed: Tue May 24 17:26:46 2016 +0100 -- .../security/jose/jwejws/JAXRSJwsJsonTest.java | 21 +++- 1 file changed, 7 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/35fd5866/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJwsJsonTest.java -- diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJwsJsonTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJwsJsonTest.java index 9ee411b..cb632d0 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJwsJsonTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJwsJsonTest.java @@ -82,8 +82,8 @@ public class JAXRSJwsJsonTest extends AbstractBusClientServerTestBase { public void testJwsJsonPlainTextHmacUnencoded() throws Exception { String address = "https://localhost:"; + PORT + "/jwsjsonhmac"; BookStore bs = createBookStore(address, - Collections.singletonMap(JoseConstants.RSSEC_SIGNATURE_PROPS, - "org/apache/cxf/systest/jaxrs/security/secret.jwk.properties"), +Collections.singletonMap(JoseConstants.RSSEC_SIGNATURE_PROPS, +"org/apache/cxf/systest/jaxrs/security/secret.jwk.properties"), null, false); String text = bs.echoText("book"); @@ -177,20 +177,13 @@ public class JAXRSJwsJsonTest extends AbstractBusClientServerTestBase { } } -private BookStore createBookStore(String address, Object properties, +private BookStore createBookStore(String address, Object props, List extraProviders) throws Exception { return createBookStore(address, - Collections.singletonMap(JoseConstants.RSSEC_SIGNATURE_PROPS, properties), - extraProviders, - true); -} -private BookStore createBookStore(String address, - Map mapProperties, - List extraProviders) throws Exception { -return createBookStore(address, - mapProperties, - extraProviders, - true); +props instanceof Map ? (Map)props : Collections.singletonMap( +JoseConstants.RSSEC_SIGNATURE_PROPS, props), +extraProviders, +true); } private BookStore createBookStore(String address, Map mapProperties,
[2/2] cxf git commit: Merge branch '3.1.x-fixes' of https://git-wip-us.apache.org/repos/asf/cxf into 3.1.x-fixes
Merge branch '3.1.x-fixes' of https://git-wip-us.apache.org/repos/asf/cxf into 3.1.x-fixes Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4de35dea Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4de35dea Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4de35dea Branch: refs/heads/3.1.x-fixes Commit: 4de35dea112079d2b28e52eed3d65bdc988599b8 Parents: 35fd586 8f0f05a Author: Sergey Beryozkin Authored: Tue May 24 17:28:04 2016 +0100 Committer: Sergey Beryozkin Committed: Tue May 24 17:28:04 2016 +0100 -- .../ws/fault/DoubleItPortTypeImplJavaFirst.java | 62 .../apache/cxf/systest/ws/fault/FaultTest.java | 37 .../cxf/systest/ws/fault/DoubleItFault.wsdl | 3 + .../systest/ws/fault/SignedEncryptedPolicy.xml | 13 .../cxf/systest/ws/fault/SymmetricUTPolicy.xml | 42 + .../org/apache/cxf/systest/ws/fault/client.xml | 60 ++- .../org/apache/cxf/systest/ws/fault/server.xml | 6 ++ 7 files changed, 221 insertions(+), 2 deletions(-) --
svn commit: r989045 - in /websites/production/cxf/content: cache/docs.pageCache docs/jax-rs-jose.html
Author: buildbot Date: Tue May 24 15:47:34 2016 New Revision: 989045 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 Tue May 24 15:47:34 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 @@ -271,13 +271,13 @@ String nextJwsJson = consumer.validateAn // use WebClient to post nextJwsJson to the next consumer, with nextJwsJson being nearly identical to the original // double-signed JWS JSON signature, minus the signature which was already validated, in this case nextJwsJson will // only have a single signature -The above code produces a JWS JSON sequence containing two signatures, similarly to https://tools.ietf.org/html/rfc7515#appendix-A.6.4"; rel="nofollow">this example. If the sequence contains a single signature only then the JWS JSON 'signatures' array will contain a single 'signature' element, or the whole sequence can be https://tools.ietf.org/html/rfc7515#appendix-A.6.4"; rel="nofollow">flattened instead with the actual 'signatures' array dropped. JwsJsonProducer does not produce the flattened sequence when only a single signature is used by default because 3rd party JWS JSON consumers may only be able to process the sequences with the 'signatures' array, so pass a 'supportFlattened' flag to JwsJsonProducer if needed. Does it make sense to use JWS JSON if you do not plan to do multiple signatures ? Indeed, if it is only a single signature then using JWS Co mpact is a good alternative, likely to be used most often.However, even if you do a single signature, you may still want to try JWS JSON because is is easier to observe the individual JWS JSON structure parts when, example, checking the logs or TCP-tracing HTTP requests/responses. This is especially true when we start talking about an unencoded payload option, see below.JWS with Detached Contenthttps://tools.ietf.org/html/rfc7515#appendix-F"; rel="nofollow">JWS with a Detached Content provides a way to integrity-protect some data without actually having these data included in the resulting JWS sequence.For example, if the producer and consumer can both access the same shared piece of data, then the producer can sign these data, post the JWS sequence (without the data) to the consumer. The consumer will validate this JWS sequence and assert the data have not been modifi ed by the time it has received and started validating the sequence. JWS Compact and JWS JSON Producer and Consumer provider constructors accept an optional 'detached' flag in cases were it is required. JWS with Unencoded PayloadBy default, JWS Compact and JWS JSON sequences have the data first Base64Url encoded and then inlined in the resulting sequence. This is useful especially for JWS Compact which is used in OAuth2/OIDC flows to represent the signed access or id tokens. One concern around the data being inlined is that it takes an extra time to Base64Url encode them which may become noticeable with large payloads, and another one is that one can not see the data while looking at JWS sequences in the logs or trace screens.Thus a https://tools.ietf.org/html/rfc7797"; rel="nofollow">JWS with Unencoded Payload option (JWS header 'b64' pr operty set to false) has been introduced to let users configure JWS Signature providers not to encode the actual data payload, see https://tools.ietf.org/html/rfc7797#page-7"; rel="nofollow">this example.Both JWS JSON and JWS Compact support 'b64' property.In CXF you can apply this option to both JWS Compact (only for detached payloads at the moment) and JWS JSON sequences, here is a JWS JSON code fragment: JWS JSON Unencoded +The above code produces a JWS JSON sequence containing two signatures, similarly to https://tools.ietf.org/html/rfc7515#appendix-A.6.4"; rel="nofollow">this example. If the sequence c
[1/2] cxf git commit: Recording .gitmergeinfo Changes
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 1f2cc8efe -> d2d10aa94 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/d2d10aa9 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d2d10aa9 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d2d10aa9 Branch: refs/heads/3.0.x-fixes Commit: d2d10aa94c81740dde231761bbec013f51262107 Parents: 0c2c56e Author: Colm O hEigeartaigh Authored: Tue May 24 16:46:45 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue May 24 16:46:45 2016 +0100 -- .gitmergeinfo | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/d2d10aa9/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index a7e55c9..8dd34d8 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -1116,6 +1116,7 @@ M 8bcb5133c602b1cbe642cfd5fbb46099a28b3016 M 8c22c4cee5ab1b31a4c8e843601627b3445da312 M 8c8c99834cfda285f511b02ae73d7cd5c50f31a2 M 8d2b0180518fcec6274ac2f288e74ed1ff5ce76a +M 8f0f05a7deffe4254e82a95b33a5e23aaea0c285 M 8f2218ef37a8d5b6da84b3d2d3ec8ea83122e9b8 M 8fc7bfa3d054e9aebcb43f51e083ff7cf3b47010 M 9043011518147bbc2dac036681fd64d7ce578bc2
[2/2] cxf git commit: Adding @Ignore'd test-case for policy annotation issue
Adding @Ignore'd test-case for policy annotation issue Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0c2c56ed Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0c2c56ed Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0c2c56ed Branch: refs/heads/3.0.x-fixes Commit: 0c2c56edf603f0464cc8ffd4abe3353ecd88f80e Parents: 1f2cc8e Author: Colm O hEigeartaigh Authored: Tue May 24 16:41:50 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue May 24 16:46:45 2016 +0100 -- .../ws/fault/DoubleItPortTypeImplJavaFirst.java | 62 .../apache/cxf/systest/ws/fault/FaultTest.java | 37 .../cxf/systest/ws/fault/DoubleItFault.wsdl | 3 + .../systest/ws/fault/SignedEncryptedPolicy.xml | 13 .../cxf/systest/ws/fault/SymmetricUTPolicy.xml | 42 + .../org/apache/cxf/systest/ws/fault/client.xml | 60 ++- .../org/apache/cxf/systest/ws/fault/server.xml | 6 ++ 7 files changed, 221 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/0c2c56ed/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java -- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java new file mode 100644 index 000..0d3d6a7 --- /dev/null +++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java @@ -0,0 +1,62 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.ws.fault; + +import java.security.Principal; + +import javax.annotation.Resource; +import javax.jws.WebService; +import javax.xml.ws.WebServiceContext; + +import org.apache.cxf.annotations.Policy; +import org.apache.cxf.feature.Features; +import org.example.contract.doubleit.DoubleItFault; +import org.example.contract.doubleit.DoubleItPortType; + +@WebService(targetNamespace = "http://www.example.org/contract/DoubleIt";, +serviceName = "DoubleItService", +endpointInterface = "org.example.contract.doubleit.DoubleItPortType") +@Features(features = "org.apache.cxf.feature.LoggingFeature") +// @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml") +public class DoubleItPortTypeImplJavaFirst implements DoubleItPortType { +@Resource +WebServiceContext wsContext; + +//@Policies({ +// @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml") +//@Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SignedEncryptedPolicy.xml", + // placement = Placement.BINDING_OPERATION) +//}) + +@Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml") +public int doubleIt(int numberToDouble) throws DoubleItFault { + +Principal pr = wsContext.getUserPrincipal(); +if (pr == null || "alice".equals(pr.getName())) { +return numberToDouble * 2; +} + +org.example.schema.doubleit.DoubleItFault internalFault = +new org.example.schema.doubleit.DoubleItFault(); +internalFault.setMajor((short)124); +internalFault.setMinor((short)1256); +throw new DoubleItFault("This is a fault", internalFault); +} + +} http://git-wip-us.apache.org/repos/asf/cxf/blob/0c2c56ed/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java -- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java index 08f3e7f..81f8242 100644 --- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java +++ b/systests/ws-
cxf git commit: Adding @Ignore'd test-case for policy annotation issue
Repository: cxf Updated Branches: refs/heads/master 49658f950 -> abc147c8c Adding @Ignore'd test-case for policy annotation issue Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/abc147c8 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/abc147c8 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/abc147c8 Branch: refs/heads/master Commit: abc147c8c77a003049b8b6758391e3a1ca568a80 Parents: 49658f9 Author: Colm O hEigeartaigh Authored: Tue May 24 16:41:50 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue May 24 16:45:56 2016 +0100 -- .../ws/fault/DoubleItPortTypeImplJavaFirst.java | 62 .../apache/cxf/systest/ws/fault/FaultTest.java | 37 .../cxf/systest/ws/fault/DoubleItFault.wsdl | 3 + .../systest/ws/fault/SignedEncryptedPolicy.xml | 13 .../cxf/systest/ws/fault/SymmetricUTPolicy.xml | 42 + .../org/apache/cxf/systest/ws/fault/client.xml | 60 ++- .../org/apache/cxf/systest/ws/fault/server.xml | 6 ++ 7 files changed, 221 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/abc147c8/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java -- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java new file mode 100644 index 000..0d3d6a7 --- /dev/null +++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java @@ -0,0 +1,62 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.ws.fault; + +import java.security.Principal; + +import javax.annotation.Resource; +import javax.jws.WebService; +import javax.xml.ws.WebServiceContext; + +import org.apache.cxf.annotations.Policy; +import org.apache.cxf.feature.Features; +import org.example.contract.doubleit.DoubleItFault; +import org.example.contract.doubleit.DoubleItPortType; + +@WebService(targetNamespace = "http://www.example.org/contract/DoubleIt";, +serviceName = "DoubleItService", +endpointInterface = "org.example.contract.doubleit.DoubleItPortType") +@Features(features = "org.apache.cxf.feature.LoggingFeature") +// @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml") +public class DoubleItPortTypeImplJavaFirst implements DoubleItPortType { +@Resource +WebServiceContext wsContext; + +//@Policies({ +// @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml") +//@Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SignedEncryptedPolicy.xml", + // placement = Placement.BINDING_OPERATION) +//}) + +@Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml") +public int doubleIt(int numberToDouble) throws DoubleItFault { + +Principal pr = wsContext.getUserPrincipal(); +if (pr == null || "alice".equals(pr.getName())) { +return numberToDouble * 2; +} + +org.example.schema.doubleit.DoubleItFault internalFault = +new org.example.schema.doubleit.DoubleItFault(); +internalFault.setMajor((short)124); +internalFault.setMinor((short)1256); +throw new DoubleItFault("This is a fault", internalFault); +} + +} http://git-wip-us.apache.org/repos/asf/cxf/blob/abc147c8/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java -- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java index 69ad62d..755f11b 100644 --- a/systests/ws-security/src/te
cxf git commit: Adding @Ignore'd test-case for policy annotation issue
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 4c64e8b5f -> 8f0f05a7d Adding @Ignore'd test-case for policy annotation issue Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8f0f05a7 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8f0f05a7 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8f0f05a7 Branch: refs/heads/3.1.x-fixes Commit: 8f0f05a7deffe4254e82a95b33a5e23aaea0c285 Parents: 4c64e8b Author: Colm O hEigeartaigh Authored: Tue May 24 16:41:50 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue May 24 16:42:32 2016 +0100 -- .../ws/fault/DoubleItPortTypeImplJavaFirst.java | 62 .../apache/cxf/systest/ws/fault/FaultTest.java | 37 .../cxf/systest/ws/fault/DoubleItFault.wsdl | 3 + .../systest/ws/fault/SignedEncryptedPolicy.xml | 13 .../cxf/systest/ws/fault/SymmetricUTPolicy.xml | 42 + .../org/apache/cxf/systest/ws/fault/client.xml | 60 ++- .../org/apache/cxf/systest/ws/fault/server.xml | 6 ++ 7 files changed, 221 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/8f0f05a7/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java -- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java new file mode 100644 index 000..0d3d6a7 --- /dev/null +++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java @@ -0,0 +1,62 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.ws.fault; + +import java.security.Principal; + +import javax.annotation.Resource; +import javax.jws.WebService; +import javax.xml.ws.WebServiceContext; + +import org.apache.cxf.annotations.Policy; +import org.apache.cxf.feature.Features; +import org.example.contract.doubleit.DoubleItFault; +import org.example.contract.doubleit.DoubleItPortType; + +@WebService(targetNamespace = "http://www.example.org/contract/DoubleIt";, +serviceName = "DoubleItService", +endpointInterface = "org.example.contract.doubleit.DoubleItPortType") +@Features(features = "org.apache.cxf.feature.LoggingFeature") +// @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml") +public class DoubleItPortTypeImplJavaFirst implements DoubleItPortType { +@Resource +WebServiceContext wsContext; + +//@Policies({ +// @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml") +//@Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SignedEncryptedPolicy.xml", + // placement = Placement.BINDING_OPERATION) +//}) + +@Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml") +public int doubleIt(int numberToDouble) throws DoubleItFault { + +Principal pr = wsContext.getUserPrincipal(); +if (pr == null || "alice".equals(pr.getName())) { +return numberToDouble * 2; +} + +org.example.schema.doubleit.DoubleItFault internalFault = +new org.example.schema.doubleit.DoubleItFault(); +internalFault.setMajor((short)124); +internalFault.setMinor((short)1256); +throw new DoubleItFault("This is a fault", internalFault); +} + +} http://git-wip-us.apache.org/repos/asf/cxf/blob/8f0f05a7/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java -- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java index 69ad62d..755f11b 100644 --- a/systests/ws-secur
cxf git commit: [CXF-6915] Support for inlined unencoded payloads in JWS Compact
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes f5b83ad36 -> 4c64e8b5f [CXF-6915] Support for inlined unencoded payloads in JWS Compact Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4c64e8b5 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4c64e8b5 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4c64e8b5 Branch: refs/heads/3.1.x-fixes Commit: 4c64e8b5f8af67d2e163ad575fd6e7191c6636d1 Parents: f5b83ad Author: Sergey Beryozkin Authored: Tue May 24 16:24:15 2016 +0100 Committer: Sergey Beryozkin Committed: Tue May 24 16:25:55 2016 +0100 -- .../jose/jaxrs/JwsWriterInterceptor.java| 22 ++ .../security/jose/jws/JwsCompactConsumer.java | 6 - .../security/jose/jws/JwsCompactProducer.java | 3 --- .../security/jose/jwejws/JAXRSJweJwsTest.java | 13 +++ .../security/jose/jwejws/JAXRSJwsJsonTest.java | 24 +++- 5 files changed, 54 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/4c64e8b5/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java -- diff --git a/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java b/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java index e4d8aff..6bf79ed 100644 --- a/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java +++ b/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java @@ -47,6 +47,7 @@ import org.apache.cxf.rs.security.jose.jws.JwsSignatureProvider; public class JwsWriterInterceptor extends AbstractJwsWriterProvider implements WriterInterceptor { private boolean contentTypeRequired = true; private boolean useJwsOutputStream; +private boolean encodePayload = true; private JsonMapObjectReaderWriter writer = new JsonMapObjectReaderWriter(); @Override public void aroundWriteTo(WriterInterceptorContext ctx) throws IOException, WebApplicationException { @@ -57,6 +58,9 @@ public class JwsWriterInterceptor extends AbstractJwsWriterProvider implements W JwsHeaders headers = new JwsHeaders(); JwsSignatureProvider sigProvider = getInitializedSigProvider(headers); setContentTypeIfNeeded(headers, ctx); +if (!encodePayload) { +headers.setPayloadEncodingStatus(false); +} OutputStream actualOs = ctx.getOutputStream(); if (useJwsOutputStream) { JwsSignature jwsSignature = sigProvider.createJwsSignature(headers); @@ -65,12 +69,19 @@ public class JwsWriterInterceptor extends AbstractJwsWriterProvider implements W byte[] headerBytes = StringUtils.toBytesUTF8(writer.toJson(headers)); Base64UrlUtility.encodeAndStream(headerBytes, 0, headerBytes.length, jwsStream); jwsStream.write(new byte[]{'.'}); - -Base64UrlOutputStream base64Stream = new Base64UrlOutputStream(jwsStream); -ctx.setOutputStream(base64Stream); + +Base64UrlOutputStream base64Stream = null; +if (encodePayload) { +base64Stream = new Base64UrlOutputStream(jwsStream); +ctx.setOutputStream(base64Stream); +} else { +ctx.setOutputStream(jwsStream); +} ctx.proceed(); setJoseMediaType(ctx); -base64Stream.flush(); +if (base64Stream != null) { +base64Stream.flush(); +} jwsStream.flush(); } else { CachedOutputStream cos = new CachedOutputStream(); @@ -107,4 +118,7 @@ public class JwsWriterInterceptor extends AbstractJwsWriterProvider implements W MediaType joseMediaType = JAXRSUtils.toMediaType(JoseConstants.MEDIA_TYPE_JOSE); ctx.setMediaType(joseMediaType); } +public void setEncodePayload(boolean encodePayload) { +this.encodePayload = encodePayload; +} } http://git-wip-us.apache.org/repos/asf/cxf/blob/4c64e8b5/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/JwsCompactConsumer.java -- diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/JwsCompactConsumer.java b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/JwsCompactConsumer.java index 9d57222..8ec1194 100644 --- a/rt/rs/security/
cxf git commit: [CXF-6915] Support for inlined unencoded payloads in JWS Compact
Repository: cxf Updated Branches: refs/heads/master 517ef67f1 -> 49658f950 [CXF-6915] Support for inlined unencoded payloads in JWS Compact Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/49658f95 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/49658f95 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/49658f95 Branch: refs/heads/master Commit: 49658f950be04296afb7e5a8a49e572aeeff80c4 Parents: 517ef67 Author: Sergey Beryozkin Authored: Tue May 24 16:24:15 2016 +0100 Committer: Sergey Beryozkin Committed: Tue May 24 16:24:15 2016 +0100 -- .../jose/jaxrs/JwsWriterInterceptor.java| 22 ++ .../security/jose/jws/JwsCompactConsumer.java | 6 - .../security/jose/jws/JwsCompactProducer.java | 3 --- .../security/jose/jwejws/JAXRSJweJwsTest.java | 13 +++ .../security/jose/jwejws/JAXRSJwsJsonTest.java | 24 +++- 5 files changed, 54 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/49658f95/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java -- diff --git a/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java b/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java index e4d8aff..6bf79ed 100644 --- a/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java +++ b/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java @@ -47,6 +47,7 @@ import org.apache.cxf.rs.security.jose.jws.JwsSignatureProvider; public class JwsWriterInterceptor extends AbstractJwsWriterProvider implements WriterInterceptor { private boolean contentTypeRequired = true; private boolean useJwsOutputStream; +private boolean encodePayload = true; private JsonMapObjectReaderWriter writer = new JsonMapObjectReaderWriter(); @Override public void aroundWriteTo(WriterInterceptorContext ctx) throws IOException, WebApplicationException { @@ -57,6 +58,9 @@ public class JwsWriterInterceptor extends AbstractJwsWriterProvider implements W JwsHeaders headers = new JwsHeaders(); JwsSignatureProvider sigProvider = getInitializedSigProvider(headers); setContentTypeIfNeeded(headers, ctx); +if (!encodePayload) { +headers.setPayloadEncodingStatus(false); +} OutputStream actualOs = ctx.getOutputStream(); if (useJwsOutputStream) { JwsSignature jwsSignature = sigProvider.createJwsSignature(headers); @@ -65,12 +69,19 @@ public class JwsWriterInterceptor extends AbstractJwsWriterProvider implements W byte[] headerBytes = StringUtils.toBytesUTF8(writer.toJson(headers)); Base64UrlUtility.encodeAndStream(headerBytes, 0, headerBytes.length, jwsStream); jwsStream.write(new byte[]{'.'}); - -Base64UrlOutputStream base64Stream = new Base64UrlOutputStream(jwsStream); -ctx.setOutputStream(base64Stream); + +Base64UrlOutputStream base64Stream = null; +if (encodePayload) { +base64Stream = new Base64UrlOutputStream(jwsStream); +ctx.setOutputStream(base64Stream); +} else { +ctx.setOutputStream(jwsStream); +} ctx.proceed(); setJoseMediaType(ctx); -base64Stream.flush(); +if (base64Stream != null) { +base64Stream.flush(); +} jwsStream.flush(); } else { CachedOutputStream cos = new CachedOutputStream(); @@ -107,4 +118,7 @@ public class JwsWriterInterceptor extends AbstractJwsWriterProvider implements W MediaType joseMediaType = JAXRSUtils.toMediaType(JoseConstants.MEDIA_TYPE_JOSE); ctx.setMediaType(joseMediaType); } +public void setEncodePayload(boolean encodePayload) { +this.encodePayload = encodePayload; +} } http://git-wip-us.apache.org/repos/asf/cxf/blob/49658f95/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/JwsCompactConsumer.java -- diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/JwsCompactConsumer.java b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/JwsCompactConsumer.java index 9d57222..8ec1194 100644 --- a/rt/rs/security/jose-paren
svn commit: r989039 - in /websites/production/cxf/content: cache/docs.pageCache docs/jax-rs-jose.html
Author: buildbot Date: Tue May 24 13:47:34 2016 New Revision: 989039 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 Tue May 24 13:47:34 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 @@ -271,7 +271,7 @@ String nextJwsJson = consumer.validateAn // use WebClient to post nextJwsJson to the next consumer, with nextJwsJson being nearly identical to the original // double-signed JWS JSON signature, minus the signature which was already validated, in this case nextJwsJson will // only have a single signature -The above code produces a JWS JSON sequence containing two signatures, similarly to https://tools.ietf.org/html/rfc7515#appendix-A.6.4"; rel="nofollow">this example. If the sequence contains a single signature only then the JWS JSON 'signatures' array will contain a single 'signature' element, or the whole sequence can be https://tools.ietf.org/html/rfc7515#appendix-A.6.4"; rel="nofollow">flattened instead with the actual 'signatures' array dropped. JwsJsonProducer does not produce the flattened sequence when only a single signature is used by default because 3rd party JWS JSON consumers may only be able to process the sequences with the 'signatures' array, so pass a 'supportFlattened' flag to JwsJsonProducer if needed. Does it make sense to use JWS JSON if you do not plan to do multiple signatures ? Indeed, if it is only a single signature then using JWS Co mpact is a good alternative, likely to be used most often.However, even if you do a single signature, you may still want to try JWS JSON because is is easier to observe the individual JWS JSON structure parts when, example, checking the logs or TCP-tracing HTTP requests/responses. This is especially true when we start talking about an unencoded payload option, see below.JWS with Detached Contenthttps://tools.ietf.org/html/rfc7515#appendix-F"; rel="nofollow">JWS with a Detached Content provides a way to integrity-protect some data without actually having these data included in the resulting JWS sequence.For example, if the producer and consumer can both access the same shared piece of data, then the producer can sign these data, post the JWS sequence (without the data) to the consumer. The consumer will validate this JWS sequence and assert the data have not been modifi ed by the time it has received and started validating the sequence. JWS Compact and JWS JSON Producer and Consumer provider constructors accept an optional 'detached' flag in cases were it is required. JWS with Unencoded PayloadBy default, JWS Compact and JWS JSON sequences have the data first Base64Url encoded and then inlined in the resulting sequence. This is useful especially for JWS Compact which is used in OAuth2/OIDC flows to represent the signed access or id tokens. One concern around the data being inlined is that it takes an extra time to Base64Url encode them which may become noticeable with large payloads, and another one is that one can not see the data while looking at JWS sequences in the logs or trace screens.Thus a https://tools.ietf.org/html/rfc7797"; rel="nofollow">JWS with Unencoded Payload option (JWS header 'b64' pr operty set to false) has been introduced to let users configure JWS Signature providers not to encode the actual data payload. As it happens it appears to be most useful when JWS JSON sequences are produced, see https://tools.ietf.org/html/rfc7797#page-7"; rel="nofollow">this example.Note that JWS Compact also supports 'b64' property but only with the detached payloads. It is easier to appreciate the value of disabling Base64Url encoding with JWS JSON as seen in the example.In CXF you can apply this option to both JWS Compact and JWS JSON sequences, here is a JWS JSON code fragment: JWS JSON Unencoded +The a
[4/5] cxf git commit: Squash commit of ws-transfer implementation from Erich Duda (dudaerich) This closes #33
http://git-wip-us.apache.org/repos/asf/cxf/blob/517ef67f/rt/ws/transfer/src/main/java/org/apache/cxf/ws/transfer/resource/ResourceRemote.java -- diff --git a/rt/ws/transfer/src/main/java/org/apache/cxf/ws/transfer/resource/ResourceRemote.java b/rt/ws/transfer/src/main/java/org/apache/cxf/ws/transfer/resource/ResourceRemote.java new file mode 100644 index 000..52916ea --- /dev/null +++ b/rt/ws/transfer/src/main/java/org/apache/cxf/ws/transfer/resource/ResourceRemote.java @@ -0,0 +1,49 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.ws.transfer.resource; + +import org.apache.cxf.ws.addressing.EndpointReferenceType; +import org.apache.cxf.ws.addressing.ReferenceParametersType; +import org.apache.cxf.ws.transfer.Create; +import org.apache.cxf.ws.transfer.CreateResponse; +import org.apache.cxf.ws.transfer.Representation; +import org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory; +import org.apache.cxf.ws.transfer.validationtransformation.ValidAndTransformHelper; + +/** + * Implementation of the Resource interface for resources, which are created remotely. + * @see org.apache.cxf.ws.transfer.resourcefactory.resolver.ResourceResolver + */ +public class ResourceRemote extends ResourceLocal implements ResourceFactory { + +@Override +public CreateResponse create(Create body) { +Representation representation = body.getRepresentation(); +ValidAndTransformHelper.validationAndTransformation( +getResourceTypeIdentifiers(), representation, null); +ReferenceParametersType refParams = getManager().create(representation); +CreateResponse response = new CreateResponse(); +response.setResourceCreated(new EndpointReferenceType()); +response.getResourceCreated().setReferenceParameters(refParams); +response.setRepresentation(body.getRepresentation()); +return response; +} + +} http://git-wip-us.apache.org/repos/asf/cxf/blob/517ef67f/rt/ws/transfer/src/main/java/org/apache/cxf/ws/transfer/resourcefactory/ResourceFactory.java -- diff --git a/rt/ws/transfer/src/main/java/org/apache/cxf/ws/transfer/resourcefactory/ResourceFactory.java b/rt/ws/transfer/src/main/java/org/apache/cxf/ws/transfer/resourcefactory/ResourceFactory.java new file mode 100644 index 000..da28d43 --- /dev/null +++ b/rt/ws/transfer/src/main/java/org/apache/cxf/ws/transfer/resourcefactory/ResourceFactory.java @@ -0,0 +1,61 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +package org.apache.cxf.ws.transfer.resourcefactory; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.jws.soap.SOAPBinding; +import javax.xml.ws.Action; +import javax.xml.ws.soap.Addressing; +import org.apache.cxf.ws.transfer.Create; +import org.apache.cxf.ws.transfer.CreateResponse; +import org.apache.cxf.ws.transfer.shared.TransferConstants; + +/** + * The interface definition of a Resource Factory web service, according to the specification. + */ + +@WebService(targetNamespace = TransferConstants.TRANSFER_2011_03_NAMESPACE, +name = TransferConstants.NAME_RESOURCE_FACTORY) +@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) +@Addressing(enabled = true, required = true) +public interface Resou
[5/5] cxf git commit: Squash commit of ws-transfer implementation from Erich Duda (dudaerich) This closes #33
Squash commit of ws-transfer implementation from Erich Duda (dudaerich) This closes #33 Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/517ef67f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/517ef67f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/517ef67f Branch: refs/heads/master Commit: 517ef67f1a69d386de44153e5e09d51cb47bf4d7 Parents: e158c96 Author: Daniel Kulp Authored: Tue May 24 09:26:41 2016 -0400 Committer: Daniel Kulp Committed: Tue May 24 09:26:41 2016 -0400 -- rt/ws/pom.xml | 1 + rt/ws/transfer/pom.xml | 91 +++ .../apache/cxf/ws/transfer/dialect/Dialect.java | 64 ++ .../dialect/fragment/FragmentDialect.java | 622 +++ .../fragment/FragmentDialectConstants.java | 51 ++ .../dialect/fragment/faults/FragmentFault.java | 44 ++ .../fragment/faults/InvalidExpression.java | 42 ++ .../fragment/faults/UnsupportedLanguage.java| 41 ++ .../fragment/faults/UnsupportedMode.java| 42 ++ .../language/FragmentDialectLanguage.java | 37 ++ .../language/FragmentDialectLanguageQName.java | 134 .../FragmentDialectLanguageXPath10.java | 160 + .../transfer/manager/MemoryResourceManager.java | 160 + .../ws/transfer/manager/ResourceManager.java| 59 ++ .../cxf/ws/transfer/resource/Resource.java | 101 +++ .../cxf/ws/transfer/resource/ResourceLocal.java | 191 ++ .../ws/transfer/resource/ResourceRemote.java| 49 ++ .../resourcefactory/ResourceFactory.java| 61 ++ .../resourcefactory/ResourceFactoryImpl.java| 153 + .../resolver/ResourceReference.java | 61 ++ .../resolver/ResourceResolver.java | 39 ++ .../resolver/SimpleResourceResolver.java| 69 ++ .../ws/transfer/shared/TransferConstants.java | 60 ++ .../shared/faults/InvalidRepresentation.java| 41 ++ .../ws/transfer/shared/faults/PutDenied.java| 44 ++ .../transfer/shared/faults/UnknownDialect.java | 43 ++ .../transfer/shared/faults/UnknownResource.java | 42 ++ .../transfer/shared/faults/WSTransferFault.java | 45 ++ .../ResourceTransformer.java| 30 + .../ResourceTypeIdentifier.java | 36 ++ .../ResourceTypeIdentifierResult.java | 56 ++ .../ResourceValidator.java | 31 + .../ValidAndTransformHelper.java| 63 ++ .../XSDResourceTypeIdentifier.java | 87 +++ .../XSDResourceValidator.java | 88 +++ .../XSLTResourceTransformer.java| 87 +++ .../reference-parameter-parsing.xml | 27 + .../main/resources/schemas/catalog-fragment.cat | 21 + .../src/main/resources/schemas/catalog.cat | 23 + .../src/main/resources/schemas/fragment.xsd | 87 +++ .../src/main/resources/schemas/transfer.xjb | 37 ++ .../src/main/resources/schemas/transfer.xsd | 192 ++ .../src/main/resources/schemas/ws-addr.xsd | 141 + .../integration/FragmentGetQNameTest.java | 171 + .../integration/FragmentGetXPath10Test.java | 333 ++ .../integration/FragmentPutAddTest.java | 238 +++ .../integration/FragmentPutInsertAfterTest.java | 194 ++ .../FragmentPutInsertBeforeTest.java| 194 ++ .../integration/FragmentPutRemoveTest.java | 113 .../integration/FragmentPutReplaceTest.java | 419 + .../integration/IntegrationBaseTest.java| 196 ++ .../integration/ResourceFactoryTest.java| 135 .../ws/transfer/integration/ResourceTest.java | 168 + .../unit/MemoryResourceManagerTest.java | 204 ++ .../transfer/unit/XSDResourceValidatorTest.java | 60 ++ .../unit/XSLTResourceTransformerTest.java | 60 ++ .../invalidRepresentation.xml | 26 + .../xml/xsdresourcevalidator/schema.xsd | 35 ++ .../validRepresentation.xml | 27 + .../xsltresourcetransformer/representation.xml | 26 + .../xml/xsltresourcetransformer/stylesheet.xsl | 43 ++ systests/pom.xml| 3 +- systests/ws-transfer/pom.xml| 61 ++ .../systest/ws/transfer/CreateStudentTest.java | 103 +++ .../systest/ws/transfer/CreateTeacherTest.java | 91 +++ .../cxf/systest/ws/transfer/DeleteTest.java | 118 .../apache/cxf/systest/ws/transfer/GetTest.java | 111 .../apache/cxf/systest/ws/transfer/PutTest.java | 129 .../cxf/systest/ws/transfer/TestUtils.java | 174 ++ .../cxf/systest/ws/transfer/UIDManager.java | 40 ++ .../transfer/resolver/MyResourceResolver.java | 55 ++ .../validator/StudentPutResourceValidator.java | 47 ++ .../validator/TeacherResourceValidator.java | 51 ++ .../src/test/resources/schema/stu
[1/5] cxf git commit: Squash commit of ws-transfer implementation from Erich Duda (dudaerich) This closes #33
Repository: cxf Updated Branches: refs/heads/master e158c96dc -> 517ef67f1 http://git-wip-us.apache.org/repos/asf/cxf/blob/517ef67f/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/validator/StudentPutResourceValidator.java -- diff --git a/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/validator/StudentPutResourceValidator.java b/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/validator/StudentPutResourceValidator.java new file mode 100644 index 000..c96eec5 --- /dev/null +++ b/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/validator/StudentPutResourceValidator.java @@ -0,0 +1,47 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.systest.ws.transfer.validator; + +import org.w3c.dom.Element; +import org.apache.cxf.ws.transfer.Representation; +import org.apache.cxf.ws.transfer.shared.faults.PutDenied; +import org.apache.cxf.ws.transfer.validationtransformation.ResourceValidator; + +public class StudentPutResourceValidator implements ResourceValidator { + +public static final String UID_NAMESPACE = "http://university.edu/student";; + +public static final String UID_NAME = "uid"; + +@Override +public boolean validate(Representation newRepresentation, Representation oldRepresentation) { +Element newRepresentationEl = (Element) newRepresentation.getAny(); +Element oldRepresentationEl = (Element) oldRepresentation.getAny(); + +String newUid = newRepresentationEl.getElementsByTagNameNS(UID_NAMESPACE, UID_NAME).item(0).getTextContent(); +String oldUid = oldRepresentationEl.getElementsByTagNameNS(UID_NAMESPACE, UID_NAME).item(0).getTextContent(); + +if (!newUid.equals(oldUid)) { +throw new PutDenied(); +} +return true; +} + +} http://git-wip-us.apache.org/repos/asf/cxf/blob/517ef67f/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/validator/TeacherResourceValidator.java -- diff --git a/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/validator/TeacherResourceValidator.java b/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/validator/TeacherResourceValidator.java new file mode 100644 index 000..0371366 --- /dev/null +++ b/systests/ws-transfer/src/test/java/org/apache/cxf/systest/ws/transfer/validator/TeacherResourceValidator.java @@ -0,0 +1,51 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.systest.ws.transfer.validator; + +import org.w3c.dom.Element; +import org.apache.cxf.ws.transfer.Representation; +import org.apache.cxf.ws.transfer.shared.faults.PutDenied; +import org.apache.cxf.ws.transfer.validationtransformation.ResourceValidator; + +public class TeacherResourceValidator implements ResourceValidator { + +public static final String UID_NAMESPACE = "http://university.edu/teacher";; + +public static final String UID_NAME = "uid"; + +@Override +public boolean validate(Representation newRepresentation, Representation oldRepresentation) { +if (oldRepresentation != null) { +Element newRepresentationEl = (Element) newRepresentation.getAny(); +Element oldRepresentati
[2/5] cxf git commit: Squash commit of ws-transfer implementation from Erich Duda (dudaerich) This closes #33
http://git-wip-us.apache.org/repos/asf/cxf/blob/517ef67f/rt/ws/transfer/src/test/java/org/apache/cxf/ws/transfer/integration/IntegrationBaseTest.java -- diff --git a/rt/ws/transfer/src/test/java/org/apache/cxf/ws/transfer/integration/IntegrationBaseTest.java b/rt/ws/transfer/src/test/java/org/apache/cxf/ws/transfer/integration/IntegrationBaseTest.java new file mode 100644 index 000..2059a7a --- /dev/null +++ b/rt/ws/transfer/src/test/java/org/apache/cxf/ws/transfer/integration/IntegrationBaseTest.java @@ -0,0 +1,196 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.ws.transfer.integration; + +import java.io.StringReader; +import java.util.HashMap; +import java.util.Map; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.stream.XMLStreamException; +import javax.xml.ws.BindingProvider; + +import org.w3c.dom.Document; +import org.apache.cxf.Bus; +import org.apache.cxf.BusFactory; +import org.apache.cxf.endpoint.Server; +import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; +import org.apache.cxf.jaxws.JaxWsServerFactoryBean; +import org.apache.cxf.staxutils.StaxUtils; +import org.apache.cxf.ws.addressing.AddressingProperties; +import org.apache.cxf.ws.addressing.ContextUtils; +import org.apache.cxf.ws.addressing.EndpointReferenceType; +import org.apache.cxf.ws.addressing.JAXWSAConstants; +import org.apache.cxf.ws.addressing.ReferenceParametersType; +import org.apache.cxf.ws.transfer.Representation; +import org.apache.cxf.ws.transfer.dialect.fragment.ExpressionType; +import org.apache.cxf.ws.transfer.manager.ResourceManager; +import org.apache.cxf.ws.transfer.resource.Resource; +import org.apache.cxf.ws.transfer.resource.ResourceLocal; +import org.apache.cxf.ws.transfer.resource.ResourceRemote; +import org.apache.cxf.ws.transfer.resourcefactory.ResourceFactory; +import org.apache.cxf.ws.transfer.resourcefactory.ResourceFactoryImpl; +import org.apache.cxf.ws.transfer.resourcefactory.resolver.SimpleResourceResolver; +import org.apache.cxf.ws.transfer.shared.TransferConstants; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; + +public class IntegrationBaseTest { + +public static final String RESOURCE_FACTORY_ADDRESS = "local://ResourceFactory"; + +public static final String RESOURCE_ADDRESS = "local://ResourceLocal"; + +public static final String RESOURCE_REMOTE_ADDRESS = "local://ResourceRemote"; + +public static final String RESOURCE_REMOTE_MANAGER_ADDRESS = "local://ResourceRemote" ++ TransferConstants.RESOURCE_REMOTE_SUFFIX; + +public static final String RESOURCE_LOCAL_ADDRESS = "local://ResourceLocal"; + +protected static DocumentBuilderFactory documentBuilderFactory; + +protected static DocumentBuilder documentBuilder; + +protected static Document document; + +protected Bus bus; + +@BeforeClass +public static void beforeClass() throws ParserConfigurationException { +documentBuilderFactory = DocumentBuilderFactory.newInstance(); +documentBuilder = documentBuilderFactory.newDocumentBuilder(); +document = documentBuilder.newDocument(); +} + +@AfterClass +public static void afterClass() { +documentBuilderFactory = null; +documentBuilder = null; +document = null; +} + +@Before +public void before() { +bus = BusFactory.getDefaultBus(); +} + +@After +public void after() { +bus.shutdown(true); +bus = null; +} + +protected Server createLocalResourceFactory(ResourceManager manager) { +ResourceFactoryImpl implementor = new ResourceFactoryImpl(); +implementor.setResourceResolver(new SimpleResourceResolver(RESOURCE_ADDRESS, manager)); +JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean(); +factory.setBus(bus); +factory.setServiceClass(ResourceFactory.class); +factory.setAddress(RESOURCE_FACTORY_ADDRES
[3/5] cxf git commit: Squash commit of ws-transfer implementation from Erich Duda (dudaerich) This closes #33
http://git-wip-us.apache.org/repos/asf/cxf/blob/517ef67f/rt/ws/transfer/src/test/java/org/apache/cxf/ws/transfer/integration/FragmentGetQNameTest.java -- diff --git a/rt/ws/transfer/src/test/java/org/apache/cxf/ws/transfer/integration/FragmentGetQNameTest.java b/rt/ws/transfer/src/test/java/org/apache/cxf/ws/transfer/integration/FragmentGetQNameTest.java new file mode 100644 index 000..9346dc7 --- /dev/null +++ b/rt/ws/transfer/src/test/java/org/apache/cxf/ws/transfer/integration/FragmentGetQNameTest.java @@ -0,0 +1,171 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.ws.transfer.integration; + +import javax.xml.bind.JAXBElement; +import javax.xml.stream.XMLStreamException; +import javax.xml.ws.soap.SOAPFaultException; + +import org.w3c.dom.Element; +import org.apache.cxf.endpoint.Server; +import org.apache.cxf.ws.addressing.ReferenceParametersType; +import org.apache.cxf.ws.transfer.Get; +import org.apache.cxf.ws.transfer.GetResponse; +import org.apache.cxf.ws.transfer.dialect.fragment.ExpressionType; +import org.apache.cxf.ws.transfer.dialect.fragment.FragmentDialectConstants; +import org.apache.cxf.ws.transfer.dialect.fragment.ObjectFactory; +import org.apache.cxf.ws.transfer.dialect.fragment.ValueType; +import org.apache.cxf.ws.transfer.manager.MemoryResourceManager; +import org.apache.cxf.ws.transfer.manager.ResourceManager; +import org.apache.cxf.ws.transfer.resource.Resource; +import org.junit.Assert; +import org.junit.Test; + +public class FragmentGetQNameTest extends IntegrationBaseTest { + +@Test +public void getTest() throws XMLStreamException { +String content = "Text"; +ResourceManager resourceManager = new MemoryResourceManager(); +ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); +Server resource = createLocalResource(resourceManager); +Resource client = createClient(refParams); + +ObjectFactory objectFactory = new ObjectFactory(); + +Get request = new Get(); +request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); +ExpressionType expression = new ExpressionType(); +expression.setLanguage(FragmentDialectConstants.QNAME_LANGUAGE_IRI); +expression.getContent().add("a"); +request.getAny().add(objectFactory.createExpression(expression)); + +GetResponse response = client.get(request); +ValueType value = getValue(response); +Assert.assertEquals(1, value.getContent().size()); +Assert.assertEquals("a", ((Element)value.getContent().get(0)).getLocalName()); + +resource.destroy(); +} + +@Test +public void getWithNamespaceTest() throws XMLStreamException { +String content = "Text"; +ResourceManager resourceManager = new MemoryResourceManager(); +ReferenceParametersType refParams = resourceManager.create(getRepresentation(content)); +Server resource = createLocalResource(resourceManager); +Resource client = createClient(refParams); + +ObjectFactory objectFactory = new ObjectFactory(); + +Get request = new Get(); +request.setDialect(FragmentDialectConstants.FRAGMENT_2011_03_IRI); +ExpressionType expression = new ExpressionType(); +expression.setLanguage(FragmentDialectConstants.QNAME_LANGUAGE_IRI); +expression.getContent().add("ns:a"); +request.getAny().add(objectFactory.createExpression(expression)); + +GetResponse response = client.get(request); +ValueType value = getValue(response); +Assert.assertEquals(1, value.getContent().size()); +Assert.assertEquals("a", ((Element)value.getContent().get(0)).getLocalName()); +Assert.assertEquals("www.example.org", ((Element)value.getContent().get(0)).getNamespaceURI()); + +resource.destroy(); +} + +@Test +public void qetEmptyResultTest() throws XMLStreamException { +String content = "Text"; +ResourceManager resourceManager = new MemoryResourceManager(); +
svn commit: r989035 - in /websites/production/cxf/content: cache/docs.pageCache docs/jax-rs-jose.html
Author: buildbot Date: Tue May 24 12:47:34 2016 New Revision: 989035 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 Tue May 24 12:47:34 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 @@ -375,7 +375,7 @@ public class BookStore { return book; } } -would expect JWS and/or JWE processing done before the resource method is invoked or after this method returned some response.This is what CXF JOSE JAX-RS filters do, they help the client or server code get the application data JWS- or JWE-secured. The filters do it by loadng the configuration properties as described below in the Configuration section, and produce or consume JWS or JWE sequences.Note, JWS Compact and JSON, as well as JWE Compact client and server output filters can do the best effort at keeping the streaming process going while they are signing or encrypting the payload. JWE JSON client/server output filter and JWS Compact client/server input filters will be enhanced in due time to support the streaming too. Most of CXF JOSE system tests enable the streaming capable filters to stream. JWS and JWE JSON input filters are expected to process JSON containers with the properties set in a random order hence by def ault they wil not stream the data in. Register both JWS and JWE out filters if the data need to be signed and encrypted (the filters are ordered such that the data are signed first and encrypted next) and JWS and JWE in filters if the signed data need to be decrypted first and then verified.JWShttps://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java"; rel="nofollow">JwsWriterInterceptor creates compact JWS sequences on the client or server out directions. For example, if you have the client code posting a Book or the server code returning a Book, with this Book representation expected to be signed, then add https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsW riterInterceptor.java" rel="nofollow">JwsWriterInterceptor and set the signature properties on the JAX-RS client or server.https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsClientResponseFilter.java"; rel="nofollow">JwsClientResponseFilter and https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsContainerRequestFilter.java"; rel="nofollow">JwsContainerRequestFilter process the incoming client or server Compact JWS sequences.Here is an example of a JSON Book representation being signed and converted into Compact JWS and POSTed to the target service: +would expect JWS and/or JWE processing done before the resource method is invoked or after this method returned some response.This is what CXF JOSE JAX-RS filters do, they help the client or server code get the application data JWS- or JWE-secured. The filters do it by loadng the configuration properties as described below in the Configuration section, and produce or consume JWS or JWE sequences.Note, JWS Compact and JSON, as well as JWE Compact client and server output filters can do the best effort at keeping the streaming process going while they are signing or encrypting the payload. JWE JSON client/server output filter and JWS Compact client/server input filters will be enhanced in due time to support the streaming too. Most of CXF JOSE system tests enable the streaming capable filters to stream. JWS and JWE JSON input filters are expected to process JSON containers with the properties set in a random order hence by def ault they wil not stream
[1/2] cxf-fediz git commit: Fixing WSS4J issue
Repository: cxf-fediz Updated Branches: refs/heads/master c4641d852 -> c1a294b7a Fixing WSS4J issue Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/69f15dd6 Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/69f15dd6 Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/69f15dd6 Branch: refs/heads/master Commit: 69f15dd67b0294fd2699afdbba3c728b397419f9 Parents: c4641d8 Author: Colm O hEigeartaigh Authored: Tue May 24 12:55:06 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue May 24 12:55:06 2016 +0100 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/69f15dd6/pom.xml -- diff --git a/pom.xml b/pom.xml index 43cda64..c8b8cc2 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ 3.2.9.RELEASE 7.0.69 8.0.33 -2.1.5 +2.1.6-SNAPSHOT 2.7.2 http://localhost:8080/manager/text
[2/2] cxf-fediz git commit: [FEDIZ-166] - "No message body writer" error for OAuthError in the OIDC IdP
[FEDIZ-166] - "No message body writer" error for OAuthError in the OIDC IdP Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/c1a294b7 Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/c1a294b7 Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/c1a294b7 Branch: refs/heads/master Commit: c1a294b7aeebe40b306e0eb814be1e04a4c1e728 Parents: 69f15dd Author: Colm O hEigeartaigh Authored: Tue May 24 12:55:15 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue May 24 12:55:15 2016 +0100 -- services/oidc/src/main/webapp/WEB-INF/applicationContext.xml | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/c1a294b7/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml -- diff --git a/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml b/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml index 53dfdf8..ba27220 100644 --- a/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml +++ b/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml @@ -74,6 +74,7 @@ +
svn commit: r989031 - in /websites/production/cxf/content: cache/docs.pageCache docs/jax-rs-jose.html
Author: buildbot Date: Tue May 24 11:47:39 2016 New Revision: 989031 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 Tue May 24 11:47:39 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 @@ -131,7 +131,7 @@ div.rbtoc1464086818149 li {margin-left: Key and Content Encryption ProvidersJWE CompactJWE JSON JSON Web TokenJWS and JWE Combined JOSE JAX-RS Filters -JWS CompactJWELinking JWT authentications to JWS or JWE content +JWSJWELinking JWT authentications to JWS or JWE content Configuration Configuration Property Containers SignatureEncryption @@ -375,17 +375,21 @@ public class BookStore { return book; } } -would expect JWS and/or JWE processing done before the resource method is invoked or after this method returned some response.This is what CXF JOSE JAX-RS filters do, they help the client or server code get the application data JWS- or JWE-secured. The filters do it by loadng the configuration properties as described below in the Configuration section, and produce or consume JWS or JWE sequences.Note, JWS Compact and JSON, as well as JWE Compact client and server output filters do the best effort at keeping the streaming process going while they are signing or encrypting the payload. JWE JSON client/server output filter and JWS Compact client/server input filters will be enhanced in due time to support the streaming too. Most of CXF JOSE system tests enable the streaming capable filters to stream by default, however this can be disabled. JWS and JWE JSON input filters are expected to process JSON containers with the properti es set in a random order hence by default they wil not stream the data in. Register both JWS and JWE out filters if the data need to be signed and encrypted (the filters are ordered such that the data are signed first and encrypted next) and JWS and JWE in filters if the signed data need to be decrypted first and then verified.JWS Compacthttps://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java"; rel="nofollow">JwsWriterInterceptor creates compact JWS sequences on the client or server out directions. For example, if you have the client code posting a Book or the server code returning a Book, with this Book representation expected to be signed, then add https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/sr c/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java" rel="nofollow">JwsWriterInterceptor and set the signature properties on the JAX-RS client or server.https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsClientResponseFilter.java"; rel="nofollow">JwsClientResponseFilter and https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsContainerRequestFilter.java"; rel="nofollow">JwsContainerRequestFilter process the incoming client or server Compact JWS sequences.Here is an example of a JSON Book representation being signed and converted into Compact JWS and POSTed to the target service: +would expect JWS and/or JWE processing done before the resource method is invoked or after this method returned some response.This is what CXF JOSE JAX-RS filters do, they help the client or server code get the application data JWS- or JWE-secured. The filters do it by loadng the configuration properties as described below in the Configuration section, and produce or consume JWS or JWE sequences.Note, JWS Compact and JSON, as well as JWE Compact client and server output filters can do the best effort at keeping the streaming process going
cxf git commit: Removing TODOs
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes a61399635 -> f5b83ad36 Removing TODOs Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/f5b83ad3 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f5b83ad3 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f5b83ad3 Branch: refs/heads/3.1.x-fixes Commit: f5b83ad364b11bca9c4d3e70bcc68951e096f8ed Parents: a613996 Author: Colm O hEigeartaigh Authored: Mon May 23 10:15:30 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue May 24 09:56:44 2016 +0100 -- .../cxf/binding/soap/saaj/ParseBodyTest.java | 1 - .../ws/security/wss4j/WSS4JFaultCodeTest.java| 19 +++ 2 files changed, 3 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/f5b83ad3/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/ParseBodyTest.java -- diff --git a/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/ParseBodyTest.java b/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/ParseBodyTest.java index c6b2087..afff3b9 100644 --- a/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/ParseBodyTest.java +++ b/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/ParseBodyTest.java @@ -85,7 +85,6 @@ public class ParseBodyTest extends Assert { testUsingStaxUtilsCopyWithSAAJWriter(2); } -// TODO - See CXF-6900 @Test public void testReadSOAPFault() throws Exception { InputStream inStream = getClass().getResourceAsStream("soap12-fault.xml"); http://git-wip-us.apache.org/repos/asf/cxf/blob/f5b83ad3/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JFaultCodeTest.java -- diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JFaultCodeTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JFaultCodeTest.java index 9414679..51824fe 100644 --- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JFaultCodeTest.java +++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JFaultCodeTest.java @@ -220,9 +220,8 @@ public class WSS4JFaultCodeTest extends AbstractSecurityTest { } } -// TODO - See CXF-6900. +// See CXF-6900. @Test -@org.junit.Ignore public void testSignedEncryptedSOAP12Fault() throws Exception { Document doc = readDocument("wsse-response-fault.xml"); @@ -261,20 +260,8 @@ public class WSS4JFaultCodeTest extends AbstractSecurityTest { "org.apache.cxf.ws.security.wss4j.TestPwdCallback" ); -inmsg.put(SecurityConstants.RETURN_SECURITY_ERROR, Boolean.TRUE); - -try { -inHandler.handleMessage(inmsg); -StaxUtils.print(saajMsg.getSOAPPart()); - -fail("Expected failure on a SOAP Fault"); -} catch (SoapFault fault) { -fault.printStackTrace(); -// TODO assertTrue(fault.getReason().startsWith( - // "An error was discovered processing the header")); -QName faultCode = new QName(WSConstants.WSSE_NS, "InvalidSecurity"); -assertTrue(fault.getFaultCode().equals(faultCode)); -} +inHandler.handleMessage(inmsg); +// StaxUtils.print(saajMsg.getSOAPPart()); } }
cxf git commit: Recording .gitmergeinfo Changes
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes f6b005b62 -> 1f2cc8efe 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/1f2cc8ef Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1f2cc8ef Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1f2cc8ef Branch: refs/heads/3.0.x-fixes Commit: 1f2cc8efe99a3f9ee73b22c854fb07348fdec548 Parents: f6b005b Author: Colm O hEigeartaigh Authored: Tue May 24 12:43:24 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue May 24 12:43:24 2016 +0100 -- .gitmergeinfo | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/1f2cc8ef/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index 8ca2fbe..a7e55c9 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -882,6 +882,7 @@ B f4aafc6f8fe4e4964f6a48a50c43ceee3a171a64 B f51fb332753e9600a6b6e6dd17b42c1a1494395a B f5655d81ea6a880cf6b8b1cdcabddf1cd4dbe869 B f595ca026d56ec5e58a38780677598d8f9d9ded5 +B f5b83ad364b11bca9c4d3e70bcc68951e096f8ed B f68a90ad7d8339395db1ab7a8ac551544bb9570e B f68d734e375174773fd411804d12b04fef2bc011 B f6a96430b8b6742065bd8ca0cda44f2e256c4e0b
svn commit: r989027 - in /websites/production/cxf/content: cache/docs.pageCache docs/jax-rs-jose.html
Author: buildbot Date: Tue May 24 10:47:32 2016 New Revision: 989027 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 Tue May 24 10: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 @@ -375,7 +375,41 @@ public class BookStore { return book; } } -would expect JWS and/or JWE processing done before the resource method is invoked or after this method returned some response.This is what CXF JOSE JAX-RS filters do, they help the client or server code get the application data JWS- or JWE-secured. The filters do it by loadng the configuration properties as described below in the Configuration section, and produce or consume JWS or JWE sequences.Note, JWS Compact and JSON, as well as JWE Compact client and server output filters do the best effort at keeping the streaming process going while they are signing or encrypting the payload. JWE JSON client/server output filter and JWS Compact client/server input filters will be enhanced in due time to support the streaming too. Most of CXF JOSE system tests enable the streaming capable filters to stream by default, however this can be disabled. JWS and JWE JSON input filters are expected to process JSON containers with the properti es set in a random order hence by default they wil not stream the data in. Register both JWS and JWE out filters if the data need to be signed and encrypted (the filters are ordered such that the data are signed first and encrypted next) and JWS and JWE in filters if the signed data need to be decrypted first and then verified.JWS Compacthttps://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java"; rel="nofollow">JwsWriterInterceptor creates compact JWS sequences on the client or server out directions. For example, if you have the client code posting a Book or the server code returning a Book, with this Book representation expected to be signed, then add https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/sr c/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java" rel="nofollow">JwsWriterInterceptor and set the signature properties on the JAX-RS client or server.https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsClientResponseFilter.java"; rel="nofollow">JwsClientResponseFilter and https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsContainerRequestFilter.java"; rel="nofollow">JwsContainerRequestFilter process the incoming client or server Compact JWS sequences. https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsJsonWriterInterceptor.java"; rel="nofollow">J wsJsonWriterInterceptor creates JWS JSON sequences on the client or server out directions. https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsJsonClientResponseFilter.java"; rel="nofollow">JwsJsonClientResponseFilter and https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsJsonContainerRequestFilter.java"; rel="nofollow">JwsJsonContainerRequestFilter process the incoming client or server Compact JWS sequences.JWEhttps://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java"; rel="nofollow">JweWriterInterceptor creates Compact JWE sequen ces on the client or server out directions. For example, if you