cxf git commit: Removing slf4j-jdk14 deps from jaxrs spring-boot demos for now again
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 0bc42f47f -> e24153bd6 Removing slf4j-jdk14 deps from jaxrs spring-boot demos for now again Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e24153bd Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e24153bd Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e24153bd Branch: refs/heads/3.1.x-fixes Commit: e24153bd656e056a11fabe84569466df1663c8b6 Parents: 0bc42f4 Author: Sergey BeryozkinAuthored: Wed Mar 29 16:45:38 2017 +0100 Committer: Sergey Beryozkin Committed: Wed Mar 29 16:46:22 2017 +0100 -- distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml | 4 .../release/samples/jax_rs/spring_boot_scan/application/pom.xml | 4 2 files changed, 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/e24153bd/distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml -- diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml b/distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml index 33dce7e..e868b91 100644 --- a/distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml +++ b/distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml @@ -43,10 +43,6 @@ spring-boot-starter-test test - -org.slf4j -slf4j-jdk14 - ${project.artifactId} http://git-wip-us.apache.org/repos/asf/cxf/blob/e24153bd/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml -- diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml index 5c8295d..96a5e30 100644 --- a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml +++ b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml @@ -63,10 +63,6 @@ spring-boot-starter-test test - -org.slf4j -slf4j-jdk14 -
cxf git commit: Removing slf4j-jdk14 deps from jaxrs spring-boot demos for now again
Repository: cxf Updated Branches: refs/heads/master e0ed46f9f -> 1d1b318e5 Removing slf4j-jdk14 deps from jaxrs spring-boot demos for now again Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1d1b318e Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1d1b318e Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1d1b318e Branch: refs/heads/master Commit: 1d1b318e5de8c6e933b0ac38f11bfecce737c3bd Parents: e0ed46f Author: Sergey BeryozkinAuthored: Wed Mar 29 16:45:38 2017 +0100 Committer: Sergey Beryozkin Committed: Wed Mar 29 16:45:38 2017 +0100 -- distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml | 4 .../release/samples/jax_rs/spring_boot_scan/application/pom.xml | 4 2 files changed, 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/1d1b318e/distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml -- diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml b/distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml index 1235abb..f8d8562 100644 --- a/distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml +++ b/distribution/src/main/release/samples/jax_rs/spring_boot/pom.xml @@ -44,10 +44,6 @@ spring-boot-starter-test test - -org.slf4j -slf4j-jdk14 - ${project.artifactId} http://git-wip-us.apache.org/repos/asf/cxf/blob/1d1b318e/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml -- diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml index 224791b..3b023d5 100644 --- a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml +++ b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/pom.xml @@ -64,10 +64,6 @@ spring-boot-starter-test test - -org.slf4j -slf4j-jdk14 -
cxf git commit: [CXF-7291] Making sure PackageUtils.getSharedPackageName ignores Proxy classes, patch from Dennis Kieselhorst applied, This closes #247
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 1960082af -> 0bc42f47f [CXF-7291] Making sure PackageUtils.getSharedPackageName ignores Proxy classes, patch from Dennis Kieselhorst applied, This closes #247 Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0bc42f47 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0bc42f47 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0bc42f47 Branch: refs/heads/3.1.x-fixes Commit: 0bc42f47f79f2e301a6c8fe0c92acd945e43273b Parents: 1960082 Author: Sergey BeryozkinAuthored: Wed Mar 29 16:31:09 2017 +0100 Committer: Sergey Beryozkin Committed: Wed Mar 29 16:32:55 2017 +0100 -- .../java/org/apache/cxf/common/util/PackageUtils.java | 5 - .../org/apache/cxf/common/util/PackageUtilsTest.java | 13 + 2 files changed, 17 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/0bc42f47/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java -- diff --git a/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java b/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java index cd5b306..eaaf5e7 100644 --- a/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java +++ b/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java @@ -19,6 +19,7 @@ package org.apache.cxf.common.util; +import java.lang.reflect.Proxy; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; @@ -56,7 +57,9 @@ public final class PackageUtils { List lParts = new ArrayList
(classes.size()); List currentParts = new ArrayList(); for (Class cls : classes) { -lParts.add(StringUtils.getParts(getPackageName(cls), "\\.")); +if (!Proxy.isProxyClass(cls)) { +lParts.add(StringUtils.getParts(getPackageName(cls), "\\.")); +} } for (int i = 0; i < lParts.get(0).size(); i++) { int j = 1; http://git-wip-us.apache.org/repos/asf/cxf/blob/0bc42f47/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java -- diff --git a/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java b/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java index 2cbd713..ace5282 100644 --- a/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java +++ b/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java @@ -20,11 +20,14 @@ package org.apache.cxf.common.util; +import java.io.Serializable; import java.lang.annotation.Annotation; import java.lang.reflect.Array; import java.util.Arrays; import java.util.Collections; +import org.apache.cxf.validation.BeanValidationProvider; +import org.apache.cxf.validation.ValidationConfiguration; import org.junit.Assert; import org.junit.Test; @@ -100,4 +103,14 @@ public class PackageUtilsTest extends Assert { org.apache.cxf.configuration.spring.JAXBBeanFactory.class)); assertEquals("org.apache.cxf", packageName); } +@Test +public void testSharedPackageNameIgnoreProxyClasses() { +// build any proxy object resulting in com.sun.proxy... +Object proxy = ProxyHelper.getProxy(BeanValidationProvider.class.getClassLoader(), + new Class[]{Serializable.class}, new ReflectionInvokationHandler(new ValidationConfiguration())); +String packageName = PackageUtils.getSharedPackageName( + Arrays.asList(proxy.getClass(), org.apache.cxf.bus.spring.BusApplicationContext.class, + org.apache.cxf.configuration.spring.JAXBBeanFactory.class)); +assertEquals("org.apache.cxf", packageName); +} }
cxf git commit: [CXF-7291] Making sure PackageUtils.getSharedPackageName ignores Proxy classes, patch from Dennis Kieselhorst applied, This closes #247
Repository: cxf Updated Branches: refs/heads/master 11a1e4ef7 -> e0ed46f9f [CXF-7291] Making sure PackageUtils.getSharedPackageName ignores Proxy classes, patch from Dennis Kieselhorst applied, This closes #247 Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e0ed46f9 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e0ed46f9 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e0ed46f9 Branch: refs/heads/master Commit: e0ed46f9f99ac1ec3e0925b3e5666e0b7a69af53 Parents: 11a1e4e Author: Sergey BeryozkinAuthored: Wed Mar 29 16:31:09 2017 +0100 Committer: Sergey Beryozkin Committed: Wed Mar 29 16:31:09 2017 +0100 -- .../java/org/apache/cxf/common/util/PackageUtils.java | 5 - .../org/apache/cxf/common/util/PackageUtilsTest.java | 13 + 2 files changed, 17 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/e0ed46f9/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java -- diff --git a/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java b/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java index d40c3fa..4d7187c 100644 --- a/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java +++ b/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java @@ -19,6 +19,7 @@ package org.apache.cxf.common.util; +import java.lang.reflect.Proxy; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; @@ -56,7 +57,9 @@ public final class PackageUtils { List lParts = new ArrayList
(classes.size()); List currentParts = new ArrayList<>(); for (Class cls : classes) { -lParts.add(StringUtils.getParts(getPackageName(cls), "\\.")); +if (!Proxy.isProxyClass(cls)) { +lParts.add(StringUtils.getParts(getPackageName(cls), "\\.")); +} } for (int i = 0; i < lParts.get(0).size(); i++) { int j = 1; http://git-wip-us.apache.org/repos/asf/cxf/blob/e0ed46f9/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java -- diff --git a/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java b/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java index fb8f279..3a797b6 100644 --- a/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java +++ b/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java @@ -20,11 +20,14 @@ package org.apache.cxf.common.util; +import java.io.Serializable; import java.lang.annotation.Annotation; import java.lang.reflect.Array; import java.util.Arrays; import java.util.Collections; +import org.apache.cxf.validation.BeanValidationProvider; +import org.apache.cxf.validation.ValidationConfiguration; import org.junit.Assert; import org.junit.Test; @@ -100,4 +103,14 @@ public class PackageUtilsTest extends Assert { org.apache.cxf.configuration.spring.JAXBBeanFactory.class)); assertEquals("org.apache.cxf", packageName); } +@Test +public void testSharedPackageNameIgnoreProxyClasses() { +// build any proxy object resulting in com.sun.proxy... +Object proxy = ProxyHelper.getProxy(BeanValidationProvider.class.getClassLoader(), + new Class[]{Serializable.class}, new ReflectionInvokationHandler(new ValidationConfiguration())); +String packageName = PackageUtils.getSharedPackageName( + Arrays.asList(proxy.getClass(), org.apache.cxf.bus.spring.BusApplicationContext.class, + org.apache.cxf.configuration.spring.JAXBBeanFactory.class)); +assertEquals("org.apache.cxf", packageName); +} }
[2/2] cxf-fediz git commit: FEDIZ-197: Use local Port to call STS.
FEDIZ-197: Use local Port to call STS. This closes #15 STSAuthenticationProvider now handles local port (:0) on wsdlLocation. If such a port is used for wsdlLocation, STSAuthenticationProvider will use the localServer port to retrieve the wsdl. Note: org.springframework.web.filter.RequestContextFilter needs to be set for this to work. Signed-off-by: Colm O hEigeartaighProject: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/36480e97 Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/36480e97 Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/36480e97 Branch: refs/heads/master Commit: 36480e97003185385e81bf5cbf8c23cee08dffef Parents: 07ce857 Author: gonzalad Authored: Wed Mar 29 13:39:03 2017 +0200 Committer: Colm O hEigeartaigh Committed: Wed Mar 29 16:08:18 2017 +0100 -- .../service/idp/STSAuthenticationProvider.java | 92 +- .../idp/STSKrbAuthenticationProvider.java | 2 +- .../idp/STSPreAuthAuthenticationProvider.java | 2 +- .../idp/STSUPAuthenticationProvider.java| 2 +- .../service/idp/beans/STSClientAction.java | 87 +++-- .../service/idp/util/LocalServerResolver.java | 98 6 files changed, 178 insertions(+), 105 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/36480e97/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/STSAuthenticationProvider.java -- diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/STSAuthenticationProvider.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/STSAuthenticationProvider.java index d42904b..9310d5c 100644 --- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/STSAuthenticationProvider.java +++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/STSAuthenticationProvider.java @@ -29,9 +29,9 @@ import org.w3c.dom.Element; import org.apache.cxf.Bus; import org.apache.cxf.BusFactory; -//import org.apache.cxf.endpoint.Client; import org.apache.cxf.fediz.core.Claim; import org.apache.cxf.fediz.core.ClaimTypes; +import org.apache.cxf.fediz.service.idp.util.LocalServerResolver; import org.apache.cxf.ws.security.tokenstore.SecurityToken; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.saml.SamlAssertionWrapper; @@ -41,8 +41,6 @@ import org.slf4j.LoggerFactory; import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; -//import org.apache.cxf.transport.http.HTTPConduit; -//import org.apache.cxf.transports.http.configuration.HTTPClientPolicy; /** * A base class for authenticating credentials to the STS @@ -50,45 +48,34 @@ import org.springframework.security.core.authority.SimpleGrantedAuthority; public abstract class STSAuthenticationProvider implements AuthenticationProvider { public static final String HTTP_DOCS_OASIS_OPEN_ORG_WS_SX_WS_TRUST_200512_BEARER = -"http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer;; +"http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer;; public static final String HTTP_DOCS_OASIS_OPEN_ORG_WS_SX_WS_TRUST_200512 = -"http://docs.oasis-open.org/ws-sx/ws-trust/200512/;; +"http://docs.oasis-open.org/ws-sx/ws-trust/200512/;; public static final String HTTP_SCHEMAS_XMLSOAP_ORG_WS_2005_02_TRUST = -"http://schemas.xmlsoap.org/ws/2005/02/trust;; +"http://schemas.xmlsoap.org/ws/2005/02/trust;; private static final Logger LOG = LoggerFactory.getLogger(STSAuthenticationProvider.class); - -protected String wsdlLocation; - protected String namespace = HTTP_DOCS_OASIS_OPEN_ORG_WS_SX_WS_TRUST_200512; - protected String wsdlService; - protected String wsdlEndpoint; - protected String appliesTo; - protected boolean use200502Namespace; - protected String tokenType; - protected Bus bus; - protected Integer lifetime; - -//Required to get IDP roles to use the IDP application, used in future release +// Required to get IDP roles to use the IDP application, used in future release protected String roleURI; - protected Map properties = new HashMap<>(); - +private String wsdlLocation; +private boolean isPortSet; private String customSTSParameter; protected List createAuthorities(SecurityToken token) throws WSSecurityException { List authorities = new ArrayList<>(); -//authorities.add(new
[1/2] cxf-fediz git commit: FEDIZ-197: wsdlLocation shouldn't be changed
Repository: cxf-fediz Updated Branches: refs/heads/master 2e4dac9be -> 36480e970 FEDIZ-197: wsdlLocation shouldn't be changed We should change wsdlLocation to use localPort only if port 0 has been explicitly set. Otherwise, we should use wsdlLocation as is. Signed-off-by: Colm O hEigeartaighProject: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/07ce8579 Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/07ce8579 Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/07ce8579 Branch: refs/heads/master Commit: 07ce85792079b36a962f9ba39dd296894c76d779 Parents: 2e4dac9 Author: gonzalad Authored: Wed Mar 29 09:15:10 2017 +0200 Committer: Colm O hEigeartaigh Committed: Wed Mar 29 16:08:06 2017 +0100 -- .../service/idp/beans/STSClientAction.java | 2 +- .../cxf/fediz/service/idp/util/WebUtils.java| 17 ++-- .../service/idp/beans/STSClientActionTest.java | 87 3 files changed, 96 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/07ce8579/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java -- diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java index e0d324e..ff9f65f 100644 --- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java +++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java @@ -116,7 +116,7 @@ public class STSClientAction { this.wsdlLocation = wsdlLocation; try { URL url = new URL(wsdlLocation); -isPortSet = url.getPort() > 0; +isPortSet = url.getPort() != 0; if (!isPortSet) { LOG.info("Port is 0 for 'wsdlLocation'. Port evaluated when processing first request."); } http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/07ce8579/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/util/WebUtils.java -- diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/util/WebUtils.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/util/WebUtils.java index edf9fde..a1da71a 100644 --- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/util/WebUtils.java +++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/util/WebUtils.java @@ -24,7 +24,6 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.springframework.util.Assert; -import org.springframework.webflow.context.servlet.ServletExternalContext; import org.springframework.webflow.execution.RequestContext; /** @@ -38,12 +37,12 @@ public final class WebUtils { public static HttpServletRequest getHttpServletRequest( final RequestContext context) { -Assert.isInstanceOf(ServletExternalContext.class, -context.getExternalContext(), +Object request = context.getExternalContext().getNativeRequest(); +Assert.isInstanceOf(HttpServletRequest.class, +request, "Cannot obtain HttpServletRequest from event of type: " + context.getExternalContext().getClass().getName()); -return (HttpServletRequest) context.getExternalContext() -.getNativeRequest(); +return (HttpServletRequest) request; } public static HttpSession getHttpSession(final RequestContext context) { @@ -53,12 +52,12 @@ public final class WebUtils { public static HttpServletResponse getHttpServletResponse( final RequestContext context) { -Assert.isInstanceOf(ServletExternalContext.class, -context.getExternalContext(), +Object response = context.getExternalContext().getNativeResponse(); +Assert.isInstanceOf(HttpServletResponse.class, +response, "Cannot obtain HttpServletResponse from event of type: " + context.getExternalContext().getClass().getName()); -return (HttpServletResponse) context.getExternalContext() -.getNativeResponse(); +return (HttpServletResponse) response; } public static String getHttpHeader(RequestContext requestContext, String headerName) {
[3/3] cxf git commit: Recording .gitmergeinfo Changes
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/84ae1490 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/84ae1490 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/84ae1490 Branch: refs/heads/3.0.x-fixes Commit: 84ae1490a4a628e0b3d795cc13b27d41205fc8d1 Parents: ca24a9c Author: Daniel KulpAuthored: Wed Mar 29 08:36:15 2017 -0400 Committer: Daniel Kulp Committed: Wed Mar 29 08:36:15 2017 -0400 -- .gitmergeinfo | 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/84ae1490/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index 32e61c2..1079e6d 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -157,6 +157,7 @@ B 18f06322f8e14ca7e7ffed682851c8448181cd2c B 194224faeb3e8eb6c8feabe6397f6b42ff0f605d B 194694aa38500a6b0042f97e1cafd742126bf527 B 194f9cd98da50140e8184ff4835811875aa5ecfe +B 1960082af04b913d30adf187b8395092196d15cc B 1960703149a11052490cf16ec3682408470298f9 B 19cbe748cf0753671e50a643d845a5700c53777b B 19ebf83eff810328e2dc8fd174bf1d4ea992141f @@ -247,6 +248,7 @@ B 27398c0edc71cabb40180cb1d88eb3cd92afa91c B 2741e4a4d763617df2149736a716e589fffcc8b8 B 27917f3accef78556fa7ed8e79f1746052bfd4d9 B 27a95f050bfdbeb9d3e63af11fc2e8c4370ae549 +B 27ae9979b88540574ee59c487f43c20c877c8be3 B 27c2c25dc3c2c3019543e31afdca7b166911f278 B 280487512eb1c34a6c05bcfe3e2e182388359a25 B 28054f8aa4a3d208ad7ddadef6f11f692be6787b @@ -414,6 +416,7 @@ B 3ec5957b01821138129cc29acb88430fa278d28e B 3ee69e9404d3ffed74e84b223d7d284c081f7fb4 B 3f57636a454757504055ab0973ec2a461fb954be B 3f90fa6a7adb9c3311663424950fa352d7d5bdbb +B 3fd465a1b74c19e819a794ff89227af2c0d268f5 B 402e89f5fdf5ef07cbee449912fd920c727c1886 B 40356fc6b033def4adf817453a483939a249e85d B 40b19d7f6f1877f6c2c397548a4e24582c053706 @@ -1683,6 +1686,7 @@ M 1875a1c2f8c3290e5f3d92d9eab266bb106d6cea M 18a3d43cb0044fcb84d3cc89f138fd9e7110dd04 M 1946e323a0df6e5f9748af82106cff39d7b5d01f M 19e912e8d4b6d3f3a4c2b88b1d53e691496d7dc0 +M 1a4c2ac162b2b67b14e8ad12b06ca87e443dccc4 M 1b5e4078c3b14cf249f39607b1bb2b676d236747 M 1b91b6e630bec0980d94bd04b016748af525d9bd M 1baae69592a128462ef252916bccfb67cd81095b
[1/3] cxf git commit: [CXF-7081] Add support for xbean's asm6 shade
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 0cab8b7fe -> 84ae1490a [CXF-7081] Add support for xbean's asm6 shade Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/3707180a Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/3707180a Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/3707180a Branch: refs/heads/3.0.x-fixes Commit: 3707180a73a10ece1289eac0b6f482c625c50a5b Parents: 0cab8b7 Author: Daniel KulpAuthored: Tue Mar 28 12:08:22 2017 -0400 Committer: Daniel Kulp Committed: Wed Mar 29 08:36:13 2017 -0400 -- .../src/main/java/org/apache/cxf/common/util/ASMHelper.java | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/3707180a/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java -- diff --git a/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java b/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java index bf1d692..2b1f8f3 100644 --- a/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java +++ b/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java @@ -92,10 +92,11 @@ public class ASMHelper { private static synchronized Class getASMClass() throws ClassNotFoundException { if (cwClass == null) { //try the "real" asm first, then the others -tryClass("org.objectweb.asm.ClassWriter"); -tryClass("org.apache.xbean.asm5.ClassWriter"); -tryClass("org.apache.xbean.asm4.ClassWriter"); -tryClass("org.apache.xbean.asm.ClassWriter"); +tryClass("org.objectweb.asm.ClassWriter"); +tryClass("org.apache.xbean.asm5.ClassWriter"); +tryClass("org.apache.xbean.asm6.ClassWriter"); +tryClass("org.apache.xbean.asm4.ClassWriter"); +tryClass("org.apache.xbean.asm.ClassWriter"); tryClass("org.springframework.asm.ClassWriter"); if (cwClass == null) { cwClass = getASMClassWriterClass();
[2/3] cxf git commit: [CXF-4851] Support ContentTransferEncoding on root part
[CXF-4851] Support ContentTransferEncoding on root part Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/ca24a9c7 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ca24a9c7 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ca24a9c7 Branch: refs/heads/3.0.x-fixes Commit: ca24a9c7b9fcfdd6981cc0e535d7ea9e74bc4661 Parents: 3707180 Author: Daniel KulpAuthored: Tue Mar 28 13:21:17 2017 -0400 Committer: Daniel Kulp Committed: Wed Mar 29 08:36:14 2017 -0400 -- .../apache/cxf/attachment/AttachmentDeserializer.java| 9 +++-- .../java/org/apache/cxf/attachment/AttachmentUtil.java | 11 +-- .../org/apache/cxf/attachment/Base64DecoderStream.java | 3 ++- .../apache/cxf/interceptor/AttachmentOutInterceptor.java | 4 .../cxf/binding/soap/interceptor/SoapOutInterceptor.java | 4 .../soap/interceptor/SoapPreProtocolOutInterceptor.java | 6 ++ 6 files changed, 32 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/ca24a9c7/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java index 6d96106..245bf6a 100644 --- a/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java +++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java @@ -132,9 +132,14 @@ public class AttachmentDeserializer { message.put(Message.ENCODING, HttpHeaderHelper.mapCharset(cs)); } } +val = AttachmentUtil.getHeader(ih, "Content-Transfer-Encoding"); -body = new DelegatingInputStream(new MimeBodyPartInputStream(stream, boundary, pbAmount), - this); +MimeBodyPartInputStream mmps = new MimeBodyPartInputStream(stream, boundary, pbAmount); +InputStream ins = AttachmentUtil.decode(mmps, val); +if (ins != mmps) { +ih.remove("Content-Transfer-Encoding"); +} +body = new DelegatingInputStream(ins, this); createCount++; message.setContent(InputStream.class, body); } http://git-wip-us.apache.org/repos/asf/cxf/blob/ca24a9c7/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java index eade807..44e3ab9 100644 --- a/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java +++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java @@ -398,8 +398,12 @@ public final class AttachmentUtil { if (encoding == null) { encoding = "binary"; } -DataSource source = new AttachmentDataSource(ct, - decode(stream, encoding)); + +InputStream ins = decode(stream, encoding); +if (ins != stream) { +headers.remove("Content-Transfer-Encoding"); +} +DataSource source = new AttachmentDataSource(ct, ins); if (!StringUtils.isEmpty(fileName)) { ((AttachmentDataSource)source).setName(fileName); } @@ -421,6 +425,9 @@ public final class AttachmentUtil { } public static InputStream decode(InputStream in, String encoding) throws IOException { +if (encoding == null) { +return in; +} encoding = encoding.toLowerCase(); // some encodings are just pass-throughs, with no real decoding. http://git-wip-us.apache.org/repos/asf/cxf/blob/ca24a9c7/core/src/main/java/org/apache/cxf/attachment/Base64DecoderStream.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/Base64DecoderStream.java b/core/src/main/java/org/apache/cxf/attachment/Base64DecoderStream.java index 6f0a97f..a1ff98e 100644 --- a/core/src/main/java/org/apache/cxf/attachment/Base64DecoderStream.java +++ b/core/src/main/java/org/apache/cxf/attachment/Base64DecoderStream.java @@ -149,7 +149,8 @@ public class Base64DecoderStream extends FilterInputStream { // now check to see if this is normal, or potentially an error // if we didn't get characters as a multiple of 4, we may need to complain about this. if ((readCharacters % 4) != 0) { -throw new IOException("Base64 encoding error, data truncated");
[2/3] cxf git commit: [CXF-4851] Support ContentTransferEncoding on root part
[CXF-4851] Support ContentTransferEncoding on root part Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/03dd596d Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/03dd596d Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/03dd596d Branch: refs/heads/3.1.x-fixes Commit: 03dd596d9270a0257de7ea2f5f0590c6ef02e6ec Parents: c0ff648 Author: Daniel KulpAuthored: Tue Mar 28 13:21:17 2017 -0400 Committer: Daniel Kulp Committed: Wed Mar 29 08:35:32 2017 -0400 -- .../apache/cxf/attachment/AttachmentDeserializer.java| 9 +++-- .../java/org/apache/cxf/attachment/AttachmentUtil.java | 11 +-- .../org/apache/cxf/attachment/Base64DecoderStream.java | 3 ++- .../apache/cxf/interceptor/AttachmentOutInterceptor.java | 4 .../cxf/binding/soap/interceptor/SoapOutInterceptor.java | 4 .../soap/interceptor/SoapPreProtocolOutInterceptor.java | 6 ++ 6 files changed, 32 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/03dd596d/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java index e8dd326..05a5598 100644 --- a/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java +++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java @@ -132,9 +132,14 @@ public class AttachmentDeserializer { message.put(Message.ENCODING, HttpHeaderHelper.mapCharset(cs)); } } +val = AttachmentUtil.getHeader(ih, "Content-Transfer-Encoding"); -body = new DelegatingInputStream(new MimeBodyPartInputStream(stream, boundary, pbAmount), - this); +MimeBodyPartInputStream mmps = new MimeBodyPartInputStream(stream, boundary, pbAmount); +InputStream ins = AttachmentUtil.decode(mmps, val); +if (ins != mmps) { +ih.remove("Content-Transfer-Encoding"); +} +body = new DelegatingInputStream(ins, this); createCount++; message.setContent(InputStream.class, body); } http://git-wip-us.apache.org/repos/asf/cxf/blob/03dd596d/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java index 79af3b1..e9ffc88 100644 --- a/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java +++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java @@ -400,8 +400,12 @@ public final class AttachmentUtil { if (encoding == null) { encoding = "binary"; } -DataSource source = new AttachmentDataSource(ct, - decode(stream, encoding)); + +InputStream ins = decode(stream, encoding); +if (ins != stream) { +headers.remove("Content-Transfer-Encoding"); +} +DataSource source = new AttachmentDataSource(ct, ins); if (!StringUtils.isEmpty(fileName)) { ((AttachmentDataSource)source).setName(fileName); } @@ -423,6 +427,9 @@ public final class AttachmentUtil { } public static InputStream decode(InputStream in, String encoding) throws IOException { +if (encoding == null) { +return in; +} encoding = encoding.toLowerCase(); // some encodings are just pass-throughs, with no real decoding. http://git-wip-us.apache.org/repos/asf/cxf/blob/03dd596d/core/src/main/java/org/apache/cxf/attachment/Base64DecoderStream.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/Base64DecoderStream.java b/core/src/main/java/org/apache/cxf/attachment/Base64DecoderStream.java index 6f0a97f..a1ff98e 100644 --- a/core/src/main/java/org/apache/cxf/attachment/Base64DecoderStream.java +++ b/core/src/main/java/org/apache/cxf/attachment/Base64DecoderStream.java @@ -149,7 +149,8 @@ public class Base64DecoderStream extends FilterInputStream { // now check to see if this is normal, or potentially an error // if we didn't get characters as a multiple of 4, we may need to complain about this. if ((readCharacters % 4) != 0) { -throw new IOException("Base64 encoding error, data truncated");
[3/3] cxf git commit: Recording .gitmergeinfo Changes
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/1960082a Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1960082a Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1960082a Branch: refs/heads/3.1.x-fixes Commit: 1960082af04b913d30adf187b8395092196d15cc Parents: 03dd596 Author: Daniel KulpAuthored: Wed Mar 29 08:35:17 2017 -0400 Committer: Daniel Kulp Committed: Wed Mar 29 08:35:36 2017 -0400 -- .gitmergeinfo | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/1960082a/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index 3cea21c..15bfc89 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -342,6 +342,7 @@ M 0e5fd5a54cb271ba494e7e30b45d4228b33364a9 M 10ed38c6d1f74f75ae231e8b91b7198b4e162ab3 M 11637433df089a638e173d1ef57441e7456cf2ea M 1184e08f0d1c40c754e39fd5d6340d1057fbdd17 +M 11a1e4ef71053e7deca6bd323f5cd27fd9bc6da4 M 11e18bf5622cafdb10723cee895885d676b35a7b M 127acfcf24207eef314efe9ffd72e5a032e02ee1 M 13d33c9ed261e06e44706cffa1671d67d31096a7 @@ -408,6 +409,7 @@ M 6d7985f39b83d28b0ca3e485be8de8f986d6f6c1 M 726c0aa641e408a18fa5f4ff82df682d489874f4 M 7304dfbd8f3044d8d46981abf2058c6cb732d219 M 746914a5084f5db8d0c0f052802c7ef2217b9b6b +M 74a5139520ac289d3a6d93da14573ef7501b8d1d M 74b8db2dcc5fc60a513d9e73e258aeba99727a39 M 7690a1fd087aff24ad8e8e1ab2e0722e24bf3d81 M 7ace8c84cff4696e365800fbba12cc789e97971f @@ -471,6 +473,7 @@ M b418fd7952dc36f1a3e577e457833588a2056104 M b433c753d44350daff5a40ff8eb5a149cf557a68 M b49075882641fcebbbdf1ed8d84247fcf80aa558 M b624c034c5682b54b9faf3d3e90eb0c23cde1a5b +M be2bf8d644887fc1853210b9b82db897c4d73dd0 M c01c68ddda10ec6db492b86d818498bec0bf4228 M c212240f696e3387df19bbcf22d1851aff320078 M c2b13b7473781c3c1a4225a01c319cf8aa92cd0f
[1/3] cxf git commit: [CXF-7081] Add support for xbean's asm6 shade
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes e941dee73 -> 1960082af [CXF-7081] Add support for xbean's asm6 shade Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c0ff6483 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c0ff6483 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c0ff6483 Branch: refs/heads/3.1.x-fixes Commit: c0ff648363f3282127b1d174f1d0a2a66b9d1e82 Parents: e941dee Author: Daniel KulpAuthored: Tue Mar 28 12:08:22 2017 -0400 Committer: Daniel Kulp Committed: Wed Mar 29 08:35:29 2017 -0400 -- .../src/main/java/org/apache/cxf/common/util/ASMHelper.java | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/c0ff6483/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java -- diff --git a/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java b/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java index 7e64216..95865eb 100644 --- a/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java +++ b/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java @@ -92,10 +92,11 @@ public class ASMHelper { private static synchronized Class getASMClass() throws ClassNotFoundException { if (cwClass == null) { //try the "real" asm first, then the others -tryClass("org.objectweb.asm.ClassWriter"); -tryClass("org.apache.xbean.asm5.ClassWriter"); -tryClass("org.apache.xbean.asm4.ClassWriter"); -tryClass("org.apache.xbean.asm.ClassWriter"); +tryClass("org.objectweb.asm.ClassWriter"); +tryClass("org.apache.xbean.asm5.ClassWriter"); +tryClass("org.apache.xbean.asm6.ClassWriter"); +tryClass("org.apache.xbean.asm4.ClassWriter"); +tryClass("org.apache.xbean.asm.ClassWriter"); tryClass("org.springframework.asm.ClassWriter"); if (cwClass == null) { cwClass = getASMClassWriterClass();
[2/2] cxf git commit: [CXF-7081] Add support for xbean's asm6 shade
[CXF-7081] Add support for xbean's asm6 shade Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/74a51395 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/74a51395 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/74a51395 Branch: refs/heads/master Commit: 74a5139520ac289d3a6d93da14573ef7501b8d1d Parents: da23fad Author: Daniel KulpAuthored: Tue Mar 28 12:08:22 2017 -0400 Committer: Daniel Kulp Committed: Wed Mar 29 07:27:53 2017 -0400 -- core/src/main/java/org/apache/cxf/common/util/ASMHelper.java | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/74a51395/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java -- diff --git a/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java b/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java index 4352693..8c90732 100644 --- a/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java +++ b/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java @@ -94,6 +94,7 @@ public class ASMHelper { //try the "real" asm first, then the others tryClass("org.objectweb.asm.ClassWriter"); tryClass("org.apache.xbean.asm5.ClassWriter"); +tryClass("org.apache.xbean.asm6.ClassWriter"); tryClass("org.apache.xbean.asm4.ClassWriter"); tryClass("org.apache.xbean.asm.ClassWriter"); tryClass("org.springframework.asm.ClassWriter");
[1/2] cxf git commit: [CXF-4851] Support ContentTransferEncoding on root part
Repository: cxf Updated Branches: refs/heads/master da23fad19 -> 11a1e4ef7 [CXF-4851] Support ContentTransferEncoding on root part Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/11a1e4ef Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/11a1e4ef Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/11a1e4ef Branch: refs/heads/master Commit: 11a1e4ef71053e7deca6bd323f5cd27fd9bc6da4 Parents: 74a5139 Author: Daniel KulpAuthored: Tue Mar 28 13:21:17 2017 -0400 Committer: Daniel Kulp Committed: Wed Mar 29 07:27:53 2017 -0400 -- .../org/apache/cxf/attachment/AttachmentDeserializer.java | 9 +++-- .../java/org/apache/cxf/attachment/AttachmentUtil.java| 10 -- .../org/apache/cxf/attachment/Base64DecoderStream.java| 3 ++- .../apache/cxf/interceptor/AttachmentOutInterceptor.java | 4 .../cxf/binding/soap/interceptor/SoapOutInterceptor.java | 4 .../soap/interceptor/SoapPreProtocolOutInterceptor.java | 6 ++ 6 files changed, 31 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/11a1e4ef/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java index 25c75c7..3a82dc5 100644 --- a/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java +++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java @@ -132,9 +132,14 @@ public class AttachmentDeserializer { message.put(Message.ENCODING, HttpHeaderHelper.mapCharset(cs)); } } +val = AttachmentUtil.getHeader(ih, "Content-Transfer-Encoding"); -body = new DelegatingInputStream(new MimeBodyPartInputStream(stream, boundary, pbAmount), - this); +MimeBodyPartInputStream mmps = new MimeBodyPartInputStream(stream, boundary, pbAmount); +InputStream ins = AttachmentUtil.decode(mmps, val); +if (ins != mmps) { +ih.remove("Content-Transfer-Encoding"); +} +body = new DelegatingInputStream(ins, this); createCount++; message.setContent(InputStream.class, body); } http://git-wip-us.apache.org/repos/asf/cxf/blob/11a1e4ef/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java index 0e7275a..8c67ae3 100644 --- a/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java +++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java @@ -400,8 +400,11 @@ public final class AttachmentUtil { if (encoding == null) { encoding = "binary"; } -DataSource source = new AttachmentDataSource(ct, - decode(stream, encoding)); +InputStream ins = decode(stream, encoding); +if (ins != stream) { +headers.remove("Content-Transfer-Encoding"); +} +DataSource source = new AttachmentDataSource(ct, ins); if (!StringUtils.isEmpty(fileName)) { ((AttachmentDataSource)source).setName(fileName); } @@ -423,6 +426,9 @@ public final class AttachmentUtil { } public static InputStream decode(InputStream in, String encoding) throws IOException { +if (encoding == null) { +return in; +} encoding = encoding.toLowerCase(); // some encodings are just pass-throughs, with no real decoding. http://git-wip-us.apache.org/repos/asf/cxf/blob/11a1e4ef/core/src/main/java/org/apache/cxf/attachment/Base64DecoderStream.java -- diff --git a/core/src/main/java/org/apache/cxf/attachment/Base64DecoderStream.java b/core/src/main/java/org/apache/cxf/attachment/Base64DecoderStream.java index 70f24cf..9367db4 100644 --- a/core/src/main/java/org/apache/cxf/attachment/Base64DecoderStream.java +++ b/core/src/main/java/org/apache/cxf/attachment/Base64DecoderStream.java @@ -149,7 +149,8 @@ public class Base64DecoderStream extends FilterInputStream { // now check to see if this is normal, or potentially an error // if we didn't get characters as a multiple of 4, we may need to complain about this. if ((readCharacters % 4) != 0) { -
[3/3] cxf git commit: Add another test to check that an exception is thrown if a service response is not signed
Add another test to check that an exception is thrown if a service response is not signed # Conflicts: # systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e2cdb270 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e2cdb270 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e2cdb270 Branch: refs/heads/3.0.x-fixes Commit: e2cdb2700b71d149c8979afb7bd175c3a0d51791 Parents: c806cc3 Author: Colm O hEigeartaighAuthored: Wed Mar 29 11:51:53 2017 +0100 Committer: Colm O hEigeartaigh Committed: Wed Mar 29 12:09:53 2017 +0100 -- .../jaxrs/security/xml/JAXRSXmlSecTest.java | 96 .../cxf/systest/jaxrs/security/xml/server.xml | 13 +++ 2 files changed, 109 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/e2cdb270/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java -- diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java index 747d12f..11ce888 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java @@ -360,6 +360,102 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase { } @Test +<<< HEAD +=== +public void testUnsignedServerResponse() throws Exception { +if (STAX_PORT.equals(test.port)) { +// We are only testing the client here +return; +} +String address = "https://localhost:; + test.port + "/xmlnosigresponse/bookstore/books"; + +JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean(); +bean.setAddress(address); + +SpringBusFactory bf = new SpringBusFactory(); +URL busFile = JAXRSXmlSecTest.class.getResource("client.xml"); +Bus springBus = bf.createBus(busFile.toString()); +bean.setBus(springBus); + +Map properties = new HashMap<>(); +properties.put(SecurityConstants.CALLBACK_HANDLER, + "org.apache.cxf.systest.jaxrs.security.saml.KeystorePasswordCallback"); +properties.put(SecurityConstants.SIGNATURE_USERNAME, "alice"); +properties.put(SecurityConstants.SIGNATURE_PROPERTIES, + "org/apache/cxf/systest/jaxrs/security/alice.properties"); +bean.setProperties(properties); +if (test.streaming) { +XmlSecOutInterceptor sigOutInterceptor = new XmlSecOutInterceptor(); +sigOutInterceptor.setSignRequest(true); +bean.getOutInterceptors().add(sigOutInterceptor); + +XmlSecInInterceptor sigInInterceptor = new XmlSecInInterceptor(); +sigInInterceptor.setRequireSignature(true); +bean.setProvider(sigInInterceptor); +} else { +XmlSigOutInterceptor sigOutInterceptor = new XmlSigOutInterceptor(); +bean.getOutInterceptors().add(sigOutInterceptor); + +XmlSigInInterceptor sigInInterceptor = new XmlSigInInterceptor(); +bean.getInInterceptors().add(sigInInterceptor); +} + +WebClient wc = bean.createWebClient(); + WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(1000L); +try { +wc.post(new Book("CXF", 126L), Book.class); +fail("Failure expected on an unsigned response message"); +} catch (ProcessingException ex) { +assertTrue(ex.getCause() instanceof BadRequestException); +} +} + +@Test +public void testPostBookWithEnvelopedSigKeyName() throws Exception { +// This test only applies to StAX - see CXF-7084 +if (!test.streaming || !STAX_PORT.equals(test.port)) { +return; +} +String address = "https://localhost:; + test.port + "/xmlsigkeyname/bookstore/books"; + +JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean(); +bean.setAddress(address); + +SpringBusFactory bf = new SpringBusFactory(); +URL busFile = JAXRSXmlSecTest.class.getResource("client.xml"); +Bus springBus = bf.createBus(busFile.toString()); +bean.setBus(springBus); + +Map properties = new HashMap<>(); +properties.put(SecurityConstants.CALLBACK_HANDLER, +
[1/3] cxf git commit: Fixing merge
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes c806cc348 -> 0cab8b7fe Fixing merge Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0cab8b7f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0cab8b7f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0cab8b7f Branch: refs/heads/3.0.x-fixes Commit: 0cab8b7fe8d13f4c57fe4f062465811ea2b12ea7 Parents: 8623596 Author: Colm O hEigeartaighAuthored: Wed Mar 29 12:09:47 2017 +0100 Committer: Colm O hEigeartaigh Committed: Wed Mar 29 12:09:53 2017 +0100 -- .../jaxrs/security/xml/JAXRSXmlSecTest.java | 55 ++-- .../cxf/systest/jaxrs/security/xml/server.xml | 4 +- 2 files changed, 6 insertions(+), 53 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/0cab8b7f/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java -- diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java index 11ce888..684f1b6 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java @@ -360,8 +360,6 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase { } @Test -<<< HEAD -=== public void testUnsignedServerResponse() throws Exception { if (STAX_PORT.equals(test.port)) { // We are only testing the client here @@ -377,11 +375,11 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase { Bus springBus = bf.createBus(busFile.toString()); bean.setBus(springBus); -Map properties = new HashMap<>(); -properties.put(SecurityConstants.CALLBACK_HANDLER, +Map properties = new HashMap (); +properties.put("ws-security.callback-handler", "org.apache.cxf.systest.jaxrs.security.saml.KeystorePasswordCallback"); -properties.put(SecurityConstants.SIGNATURE_USERNAME, "alice"); -properties.put(SecurityConstants.SIGNATURE_PROPERTIES, +properties.put("ws-security.signature.username", "alice"); +properties.put("ws-security.signature.properties", "org/apache/cxf/systest/jaxrs/security/alice.properties"); bean.setProperties(properties); if (test.streaming) { @@ -411,51 +409,6 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase { } @Test -public void testPostBookWithEnvelopedSigKeyName() throws Exception { -// This test only applies to StAX - see CXF-7084 -if (!test.streaming || !STAX_PORT.equals(test.port)) { -return; -} -String address = "https://localhost:; + test.port + "/xmlsigkeyname/bookstore/books"; - -JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean(); -bean.setAddress(address); - -SpringBusFactory bf = new SpringBusFactory(); -URL busFile = JAXRSXmlSecTest.class.getResource("client.xml"); -Bus springBus = bf.createBus(busFile.toString()); -bean.setBus(springBus); - -Map properties = new HashMap<>(); -properties.put(SecurityConstants.CALLBACK_HANDLER, - "org.apache.cxf.systest.jaxrs.security.saml.KeystorePasswordCallback"); -properties.put(SecurityConstants.SIGNATURE_USERNAME, "alice"); -properties.put(SecurityConstants.SIGNATURE_PROPERTIES, - "org/apache/cxf/systest/jaxrs/security/alice.properties"); -bean.setProperties(properties); -XmlSecOutInterceptor sigOutInterceptor = new XmlSecOutInterceptor(); -sigOutInterceptor.setSignRequest(true); -sigOutInterceptor.setKeyInfoMustBeAvailable(true); - -SignatureProperties sigProps = new SignatureProperties(); -sigProps.setSignatureKeyName("alice-kn"); -sigProps.setSignatureKeyIdType("KeyName"); -sigOutInterceptor.setSignatureProperties(sigProps); - -bean.getOutInterceptors().add(sigOutInterceptor); - -XmlSecInInterceptor sigInInterceptor = new XmlSecInInterceptor(); -sigInInterceptor.setRequireSignature(true); -bean.setProvider(sigInInterceptor); - -WebClient wc = bean.createWebClient(); - WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(1000L); -Book book = wc.post(new Book("CXF", 126L), Book.class); -
[2/3] cxf git commit: Recording .gitmergeinfo Changes
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/8623596d Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8623596d Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8623596d Branch: refs/heads/3.0.x-fixes Commit: 8623596d04257a1989fad7e776e7221eddb3670b Parents: e2cdb27 Author: Colm O hEigeartaighAuthored: Wed Mar 29 12:02:29 2017 +0100 Committer: Colm O hEigeartaigh Committed: Wed Mar 29 12:09:53 2017 +0100 -- .gitmergeinfo | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/8623596d/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index 94b556a..32e61c2 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -1771,6 +1771,7 @@ M 5156dd256f8f59d22ea2d1ca50197f1b5b3f1788 M 51db79ca7bd2c703a4dbbd42d7761c97af3bad84 M 52598eb9b31ea7dfc7b4b87048e4ded459fbeb87 M 52b83045b6f7298117e9a66758c07fc9f1fba3af +M 533daf232a3edc5ec6add49f7ad95f3f0740c5dd M 536293b5eb795c27a4521c6940c56377a4fa78f0 M 55cb81445f7ec37fddec1278a6991fa00c6ae76d M 56c0db05126292a61a782f05848321b9b8b8b80c
cxf git commit: Making sure XmlSec/Sig/Enc in interceptors do not run on the client side unless the response code is 200
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 92c181e7e -> c806cc348 Making sure XmlSec/Sig/Enc in interceptors do not run on the client side unless the response code is 200 Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c806cc34 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c806cc34 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c806cc34 Branch: refs/heads/3.0.x-fixes Commit: c806cc3481964bf5ab2b01a38127d54dbad805c6 Parents: 92c181e Author: Sergey BeryozkinAuthored: Wed Mar 29 11:52:01 2017 +0100 Committer: Sergey Beryozkin Committed: Wed Mar 29 12:04:26 2017 +0100 -- .../rs/security/xml/AbstractXmlSecInHandler.java | 17 + .../cxf/rs/security/xml/XmlSecInInterceptor.java | 18 +++--- 2 files changed, 28 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/c806cc34/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java -- diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java index 84c8150..23ec06ac 100644 --- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java +++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java @@ -34,6 +34,7 @@ import org.apache.cxf.common.logging.LogUtils; import org.apache.cxf.jaxrs.utils.ExceptionUtils; import org.apache.cxf.jaxrs.utils.JAXRSUtils; import org.apache.cxf.message.Message; +import org.apache.cxf.message.MessageUtils; import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.staxutils.W3CDOMStreamReader; import org.apache.wss4j.dom.WSSConfig; @@ -54,11 +55,14 @@ public abstract class AbstractXmlSecInHandler { } protected Document getDocument(Message message) { -String method = (String)message.get(Message.HTTP_REQUEST_METHOD); -if ("GET".equals(method)) { +if (isServerGet(message)) { return null; +} else { +Integer responseCode = (Integer)message.get(Message.RESPONSE_CODE); +if (responseCode != null && responseCode != 200) { +return null; +} } - Document doc = null; InputStream is = message.getContent(InputStream.class); if (is != null) { @@ -79,13 +83,18 @@ public abstract class AbstractXmlSecInHandler { return doc; } +protected boolean isServerGet(Message message) { +String method = (String)message.get(Message.HTTP_REQUEST_METHOD); +return "GET".equals(method) && !MessageUtils.isRequestor(message); +} + protected void throwFault(String error, Exception ex) { StringBuilder log = new StringBuilder(error); if (ex != null) { log = log.append(" - ").append(ex.getMessage()); } LOG.warning(log.toString()); -Response response = JAXRSUtils.toResponseBuilder(400).entity(error).build(); +Response response = JAXRSUtils.toResponseBuilder(400).entity(error).type("text/plain").build(); throw ExceptionUtils.toBadRequestException(null, response); } http://git-wip-us.apache.org/repos/asf/cxf/blob/c806cc34/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java -- diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java index 44da705..8db3ddf 100644 --- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java +++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java @@ -98,7 +98,7 @@ public class XmlSecInInterceptor extends AbstractPhaseInterceptor imple } public void handleMessage(Message message) throws Fault { -if (isServerGet(message)) { +if (!canDocumentBeRead(message)) { return; } prepareMessage(message); @@ -141,6 +141,18 @@ public class XmlSecInInterceptor extends AbstractPhaseInterceptor imple } } +private boolean canDocumentBeRead(Message message) { +if (isServerGet(message)) { +return false; +} else { +Integer responseCode = (Integer)message.get(Message.RESPONSE_CODE); +if (responseCode != null && responseCode != 200) { +return false; +
[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/e941dee7 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e941dee7 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e941dee7 Branch: refs/heads/3.1.x-fixes Commit: e941dee73c268f61433a433123462b31f66a30c2 Parents: 1a4c2ac 533daf2 Author: Sergey BeryozkinAuthored: Wed Mar 29 12:02:27 2017 +0100 Committer: Sergey Beryozkin Committed: Wed Mar 29 12:02:27 2017 +0100 -- .../jaxrs/security/xml/JAXRSXmlSecTest.java | 49 .../cxf/systest/jaxrs/security/xml/server.xml | 13 ++ 2 files changed, 62 insertions(+) --
[1/2] cxf git commit: Making sure XmlSec/Sig/Enc in interceptors do not run on the client side unless the response code is 200
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 533daf232 -> e941dee73 Making sure XmlSec/Sig/Enc in interceptors do not run on the client side unless the response code is 200 Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1a4c2ac1 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1a4c2ac1 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1a4c2ac1 Branch: refs/heads/3.1.x-fixes Commit: 1a4c2ac162b2b67b14e8ad12b06ca87e443dccc4 Parents: 7962554 Author: Sergey BeryozkinAuthored: Wed Mar 29 11:52:01 2017 +0100 Committer: Sergey Beryozkin Committed: Wed Mar 29 12:02:19 2017 +0100 -- .../rs/security/xml/AbstractXmlSecInHandler.java | 17 + .../cxf/rs/security/xml/XmlSecInInterceptor.java | 18 +++--- 2 files changed, 28 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/1a4c2ac1/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java -- diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java index 27bc803..f204468 100644 --- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java +++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java @@ -34,6 +34,7 @@ import org.apache.cxf.common.logging.LogUtils; import org.apache.cxf.jaxrs.utils.ExceptionUtils; import org.apache.cxf.jaxrs.utils.JAXRSUtils; import org.apache.cxf.message.Message; +import org.apache.cxf.message.MessageUtils; import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.staxutils.W3CDOMStreamReader; import org.apache.wss4j.common.crypto.WSProviderConfig; @@ -70,11 +71,14 @@ public abstract class AbstractXmlSecInHandler { } protected Document getDocument(Message message) { -String method = (String)message.get(Message.HTTP_REQUEST_METHOD); -if ("GET".equals(method)) { +if (isServerGet(message)) { return null; +} else { +Integer responseCode = (Integer)message.get(Message.RESPONSE_CODE); +if (responseCode != null && responseCode != 200) { +return null; +} } - Document doc = null; InputStream is = message.getContent(InputStream.class); if (is != null) { @@ -95,13 +99,18 @@ public abstract class AbstractXmlSecInHandler { return doc; } +protected boolean isServerGet(Message message) { +String method = (String)message.get(Message.HTTP_REQUEST_METHOD); +return "GET".equals(method) && !MessageUtils.isRequestor(message); +} + protected void throwFault(String error, Exception ex) { StringBuilder log = new StringBuilder(error); if (ex != null) { log = log.append(" - ").append(ex.getMessage()); } LOG.warning(log.toString()); -Response response = JAXRSUtils.toResponseBuilder(400).entity(error).build(); +Response response = JAXRSUtils.toResponseBuilder(400).entity(error).type("text/plain").build(); throw ExceptionUtils.toBadRequestException(null, response); } http://git-wip-us.apache.org/repos/asf/cxf/blob/1a4c2ac1/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java -- diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java index ede683d..3ee4f3f 100644 --- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java +++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java @@ -101,7 +101,7 @@ public class XmlSecInInterceptor extends AbstractPhaseInterceptor imple } public void handleMessage(Message message) throws Fault { -if (isServerGet(message)) { +if (!canDocumentBeRead(message)) { return; } prepareMessage(message); @@ -144,6 +144,18 @@ public class XmlSecInInterceptor extends AbstractPhaseInterceptor imple } } +private boolean canDocumentBeRead(Message message) { +if (isServerGet(message)) { +return false; +} else { +Integer responseCode = (Integer)message.get(Message.RESPONSE_CODE); +if (responseCode != null && responseCode != 200) { +
cxf git commit: Add another test to check that an exception is thrown if a service response is not signed
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 796255421 -> 533daf232 Add another test to check that an exception is thrown if a service response is not signed Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/533daf23 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/533daf23 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/533daf23 Branch: refs/heads/3.1.x-fixes Commit: 533daf232a3edc5ec6add49f7ad95f3f0740c5dd Parents: 7962554 Author: Colm O hEigeartaighAuthored: Wed Mar 29 11:51:53 2017 +0100 Committer: Colm O hEigeartaigh Committed: Wed Mar 29 12:00:29 2017 +0100 -- .../jaxrs/security/xml/JAXRSXmlSecTest.java | 49 .../cxf/systest/jaxrs/security/xml/server.xml | 13 ++ 2 files changed, 62 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/533daf23/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java -- diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java index e464a4c..8cdb465 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java @@ -397,6 +397,55 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase { } @Test +public void testUnsignedServerResponse() throws Exception { +if (STAX_PORT.equals(test.port)) { +// We are only testing the client here +return; +} +String address = "https://localhost:; + test.port + "/xmlnosigresponse/bookstore/books"; + +JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean(); +bean.setAddress(address); + +SpringBusFactory bf = new SpringBusFactory(); +URL busFile = JAXRSXmlSecTest.class.getResource("client.xml"); +Bus springBus = bf.createBus(busFile.toString()); +bean.setBus(springBus); + +Map properties = new HashMap<>(); +properties.put(SecurityConstants.CALLBACK_HANDLER, + "org.apache.cxf.systest.jaxrs.security.saml.KeystorePasswordCallback"); +properties.put(SecurityConstants.SIGNATURE_USERNAME, "alice"); +properties.put(SecurityConstants.SIGNATURE_PROPERTIES, + "org/apache/cxf/systest/jaxrs/security/alice.properties"); +bean.setProperties(properties); +if (test.streaming) { +XmlSecOutInterceptor sigOutInterceptor = new XmlSecOutInterceptor(); +sigOutInterceptor.setSignRequest(true); +bean.getOutInterceptors().add(sigOutInterceptor); + +XmlSecInInterceptor sigInInterceptor = new XmlSecInInterceptor(); +sigInInterceptor.setRequireSignature(true); +bean.setProvider(sigInInterceptor); +} else { +XmlSigOutInterceptor sigOutInterceptor = new XmlSigOutInterceptor(); +bean.getOutInterceptors().add(sigOutInterceptor); + +XmlSigInInterceptor sigInInterceptor = new XmlSigInInterceptor(); +bean.getInInterceptors().add(sigInInterceptor); +} + +WebClient wc = bean.createWebClient(); + WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(1000L); +try { +wc.post(new Book("CXF", 126L), Book.class); +fail("Failure expected on an unsigned response message"); +} catch (ProcessingException ex) { +assertTrue(ex.getCause() instanceof BadRequestException); +} +} + +@Test public void testPostBookWithEnvelopedSigKeyName() throws Exception { // This test only applies to StAX - see CXF-7084 if (!test.streaming || !STAX_PORT.equals(test.port)) { http://git-wip-us.apache.org/repos/asf/cxf/blob/533daf23/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/xml/server.xml -- diff --git a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/xml/server.xml b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/xml/server.xml index a1aaf40..b662e16 100644 --- a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/xml/server.xml +++ b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/xml/server.xml @@ -128,6 +128,19 @@ under the License.
cxf git commit: Add another test to check that an exception is thrown if a service response is not signed
Repository: cxf Updated Branches: refs/heads/master be2bf8d64 -> da23fad19 Add another test to check that an exception is thrown if a service response is not signed Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/da23fad1 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/da23fad1 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/da23fad1 Branch: refs/heads/master Commit: da23fad198105185329dccef088267b9fc27c8b8 Parents: be2bf8d Author: Colm O hEigeartaighAuthored: Wed Mar 29 11:51:53 2017 +0100 Committer: Colm O hEigeartaigh Committed: Wed Mar 29 11:53:21 2017 +0100 -- .../jaxrs/security/xml/JAXRSXmlSecTest.java | 49 .../cxf/systest/jaxrs/security/xml/server.xml | 13 ++ 2 files changed, 62 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/da23fad1/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java -- diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java index 1166daa..29d1cc5 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java @@ -397,6 +397,55 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase { } @Test +public void testUnsignedServerResponse() throws Exception { +if (STAX_PORT.equals(test.port)) { +// We are only testing the client here +return; +} +String address = "https://localhost:; + test.port + "/xmlnosigresponse/bookstore/books"; + +JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean(); +bean.setAddress(address); + +SpringBusFactory bf = new SpringBusFactory(); +URL busFile = JAXRSXmlSecTest.class.getResource("client.xml"); +Bus springBus = bf.createBus(busFile.toString()); +bean.setBus(springBus); + +Map properties = new HashMap<>(); +properties.put(SecurityConstants.CALLBACK_HANDLER, + "org.apache.cxf.systest.jaxrs.security.saml.KeystorePasswordCallback"); +properties.put(SecurityConstants.SIGNATURE_USERNAME, "alice"); +properties.put(SecurityConstants.SIGNATURE_PROPERTIES, + "org/apache/cxf/systest/jaxrs/security/alice.properties"); +bean.setProperties(properties); +if (test.streaming) { +XmlSecOutInterceptor sigOutInterceptor = new XmlSecOutInterceptor(); +sigOutInterceptor.setSignRequest(true); +bean.getOutInterceptors().add(sigOutInterceptor); + +XmlSecInInterceptor sigInInterceptor = new XmlSecInInterceptor(); +sigInInterceptor.setRequireSignature(true); +bean.setProvider(sigInInterceptor); +} else { +XmlSigOutInterceptor sigOutInterceptor = new XmlSigOutInterceptor(); +bean.getOutInterceptors().add(sigOutInterceptor); + +XmlSigInInterceptor sigInInterceptor = new XmlSigInInterceptor(); +bean.getInInterceptors().add(sigInInterceptor); +} + +WebClient wc = bean.createWebClient(); + WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(1000L); +try { +wc.post(new Book("CXF", 126L), Book.class); +fail("Failure expected on an unsigned response message"); +} catch (ProcessingException ex) { +assertTrue(ex.getCause() instanceof BadRequestException); +} +} + +@Test public void testPostBookWithEnvelopedSigKeyName() throws Exception { // This test only applies to StAX - see CXF-7084 if (!test.streaming || !STAX_PORT.equals(test.port)) { http://git-wip-us.apache.org/repos/asf/cxf/blob/da23fad1/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/xml/server.xml -- diff --git a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/xml/server.xml b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/xml/server.xml index 5e10787..63c5551 100644 --- a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/xml/server.xml +++ b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/xml/server.xml @@ -128,6 +128,19 @@ under the License. +
cxf git commit: Making sure XmlSec/Sig/Enc in interceptors do not run on the client side unless the response code is 200
Repository: cxf Updated Branches: refs/heads/master 2ea81b5f7 -> be2bf8d64 Making sure XmlSec/Sig/Enc in interceptors do not run on the client side unless the response code is 200 Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/be2bf8d6 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/be2bf8d6 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/be2bf8d6 Branch: refs/heads/master Commit: be2bf8d644887fc1853210b9b82db897c4d73dd0 Parents: 2ea81b5 Author: Sergey BeryozkinAuthored: Wed Mar 29 11:52:01 2017 +0100 Committer: Sergey Beryozkin Committed: Wed Mar 29 11:52:01 2017 +0100 -- .../rs/security/xml/AbstractXmlSecInHandler.java | 17 + .../cxf/rs/security/xml/XmlSecInInterceptor.java | 18 +++--- 2 files changed, 28 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/be2bf8d6/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java -- diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java index 24bac79..3ae5e02 100644 --- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java +++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java @@ -34,6 +34,7 @@ import org.apache.cxf.common.logging.LogUtils; import org.apache.cxf.jaxrs.utils.ExceptionUtils; import org.apache.cxf.jaxrs.utils.JAXRSUtils; import org.apache.cxf.message.Message; +import org.apache.cxf.message.MessageUtils; import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.staxutils.W3CDOMStreamReader; import org.apache.wss4j.common.crypto.WSProviderConfig; @@ -70,11 +71,14 @@ public abstract class AbstractXmlSecInHandler { } protected Document getDocument(Message message) { -String method = (String)message.get(Message.HTTP_REQUEST_METHOD); -if ("GET".equals(method)) { +if (isServerGet(message)) { return null; +} else { +Integer responseCode = (Integer)message.get(Message.RESPONSE_CODE); +if (responseCode != null && responseCode != 200) { +return null; +} } - Document doc = null; InputStream is = message.getContent(InputStream.class); if (is != null) { @@ -94,6 +98,11 @@ public abstract class AbstractXmlSecInHandler { } return doc; } + +protected boolean isServerGet(Message message) { +String method = (String)message.get(Message.HTTP_REQUEST_METHOD); +return "GET".equals(method) && !MessageUtils.isRequestor(message); +} protected void throwFault(String error, Exception ex) { StringBuilder log = new StringBuilder(error); @@ -101,7 +110,7 @@ public abstract class AbstractXmlSecInHandler { log = log.append(" - ").append(ex.getMessage()); } LOG.warning(log.toString()); -Response response = JAXRSUtils.toResponseBuilder(400).entity(error).build(); +Response response = JAXRSUtils.toResponseBuilder(400).entity(error).type("text/plain").build(); throw ExceptionUtils.toBadRequestException(null, response); } http://git-wip-us.apache.org/repos/asf/cxf/blob/be2bf8d6/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java -- diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java index 5730381..e5e45be 100644 --- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java +++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java @@ -101,7 +101,7 @@ public class XmlSecInInterceptor extends AbstractPhaseInterceptor imple } public void handleMessage(Message message) throws Fault { -if (isServerGet(message)) { +if (!canDocumentBeRead(message)) { return; } prepareMessage(message); @@ -144,6 +144,18 @@ public class XmlSecInInterceptor extends AbstractPhaseInterceptor imple } } +private boolean canDocumentBeRead(Message message) { +if (isServerGet(message)) { +return false; +} else { +Integer responseCode = (Integer)message.get(Message.RESPONSE_CODE); +if (responseCode != null && responseCode !=
[3/3] cxf git commit: Fixing merge
Fixing merge Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/79625542 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/79625542 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/79625542 Branch: refs/heads/3.1.x-fixes Commit: 79625542170497e7075bca40c23227c1bc89c9d3 Parents: 6727419 Author: Colm O hEigeartaighAuthored: Wed Mar 29 10:26:32 2017 +0100 Committer: Colm O hEigeartaigh Committed: Wed Mar 29 10:26:32 2017 +0100 -- .../org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java | 5 - 1 file changed, 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/79625542/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java -- diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java index 0a98835..ede683d 100644 --- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java +++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java @@ -338,9 +338,6 @@ public class XmlSecInInterceptor extends AbstractPhaseInterceptor imple } } } -<<< HEAD - -=== private X509Certificate[] getX509CertificatesForKeyName(Crypto sigCrypto, Message msg, KeyNameSecurityToken token) throws XMLSecurityException { @@ -360,8 +357,6 @@ public class XmlSecInInterceptor extends AbstractPhaseInterceptor imple return certs; } - ->>> 2ea81b5... CXF-7084 - Dynamically load signature validation keys using KeyName. protected void throwFault(String error, Exception ex) { LOG.warning(error); Response response = JAXRSUtils.toResponseBuilder(400).entity(error).build();
cxf git commit: Recording .gitmergeinfo Changes
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 622442a78 -> 92c181e7e 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/92c181e7 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/92c181e7 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/92c181e7 Branch: refs/heads/3.0.x-fixes Commit: 92c181e7e7c14b9c7bc78317a1114ea17cd75ae5 Parents: 622442a Author: Colm O hEigeartaighAuthored: Wed Mar 29 10:34:05 2017 +0100 Committer: Colm O hEigeartaigh Committed: Wed Mar 29 10:34:05 2017 +0100 -- .gitmergeinfo | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/92c181e7/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index 5531a9c..94b556a 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -615,6 +615,7 @@ B 5bf7ea849a7de8ec2335f6172b4e05848480fb4a B 5c3c1b4b76b03829fac2304053931743e255af12 B 5c541cd9c16ed2d982085410cb801f2f21dbc82d B 5c678face89e4d38b2879bc4679ce3b92ac3aeb0 +B 5c9026090b50184a06842e5d25e98ab847a63545 B 5ce682771ae91eab61e25eaa90ef416168eb4402 B 5d0476df494674fae85463792acdbfe6744cee84 B 5d0ac9e12b9658fbfea8c7c952783973462eabac @@ -672,6 +673,7 @@ B 66b9f877271669b0fb5bc3328effaf2013b93667 B 66bb668ccf9f94bcf3ca4e51a0bbfa4342448e57 B 66cc4a4e3c0e92d9e6931a5d416f11c2f07f268c B 66f11a98413518fcbc30a47aebe5e7bb758baf2d +B 6727419f6d2fe6cf4b91940dc05b972f58d38da6 B 67432aef1adb8e330c054431de9d0955e3993472 B 67755ea99b1baf4c567196ac6f1e00d342d38132 B 677d43af382f491af4c3ef8205e5570fb9f87734 @@ -783,6 +785,7 @@ B 78fbd425ba4b49908e2b377a979a80ccf9cb29c5 B 7923a6209a05d71cfeb752ed2d45c9e6e7116942 B 793f0a7d2a8eade3238deef212dff5f29e0c5b4d B 794243e6c9ed943a78cde259f40d984514c03559 +B 79625542170497e7075bca40c23227c1bc89c9d3 B 799c5389f754eb588f023b646b8983b50dde00be B 7a0736b8f1adb1a1b64ca15d1b03bedb175a41de B 7a365ca6064803abfff7782a0f972dc8b4e29687
[1/3] cxf git commit: Recording .gitmergeinfo Changes
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes a754efaef -> 796255421 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/6727419f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6727419f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6727419f Branch: refs/heads/3.1.x-fixes Commit: 6727419f6d2fe6cf4b91940dc05b972f58d38da6 Parents: 5c90260 Author: Colm O hEigeartaighAuthored: Wed Mar 29 10:26:20 2017 +0100 Committer: Colm O hEigeartaigh Committed: Wed Mar 29 10:26:20 2017 +0100 -- .gitmergeinfo | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/6727419f/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index 4b17633..3cea21c 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -296,6 +296,7 @@ B e9b997e808857cda15f428aed8a78ea8d1856db7 B e9e1fbe33658421590ec149b0f82c12d2fed2c53 B ea458d27bdbd30b0b3ef785d18e45ddf2a75b74a B ea8b6e270c3a4a62061c4269174b6326a57ea2b5 +B eb55972ac7eb588d17b2f0380913d80ece3fd6b3 B ebce4a65b15a1a99f18c1ea0111affafc447ce7e B ec293bde4f937ba6b28907b228649e61d612a528 B ec3103f88b20fc05e92994b6a06b65b4a91dd75a @@ -360,6 +361,7 @@ M 2538ae42fb0c774023deed5264291b2fe6658cb8 M 26edcd457ea507075a4c82e2787f11f11a432876 M 2b1607831ccf97909122eae9247116d9a075c7cf M 2e8219cf3d047abc3a7e2611bf284aadbc20b7d6 +M 2ea81b5f7dd84d4d179a2d9ac77c5660a8aeb3c9 M 2f8a1f7645c30cb40d4f080ce4b4099964028751 M 2f981e098ea265ab504496fbf9ce4564c894bc19 M 3088952a6e3385ee628cf8c91340908ed3a67aa3
[2/3] cxf git commit: CXF-7084 - Dynamically load signature validation keys using KeyName. Thanks to Hugo Trippaers for the patch. This closes #177.
CXF-7084 - Dynamically load signature validation keys using KeyName. Thanks to Hugo Trippaers for the patch. This closes #177. # Conflicts: # rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/5c902609 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5c902609 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5c902609 Branch: refs/heads/3.1.x-fixes Commit: 5c9026090b50184a06842e5d25e98ab847a63545 Parents: a754efa Author: Colm O hEigeartaighAuthored: Wed Mar 29 10:25:00 2017 +0100 Committer: Colm O hEigeartaigh Committed: Wed Mar 29 10:26:20 2017 +0100 -- .../rs/security/xml/SignatureProperties.java| 16 .../rs/security/xml/XmlSecInInterceptor.java| 41 .../jaxrs/security/xml/JAXRSXmlSecTest.java | 2 +- .../systest/jaxrs/security/xml/stax-server.xml | 12 +- 4 files changed, 69 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/5c902609/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/SignatureProperties.java -- diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/SignatureProperties.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/SignatureProperties.java index 8c861ab..235d70e 100644 --- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/SignatureProperties.java +++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/SignatureProperties.java @@ -18,6 +18,8 @@ */ package org.apache.cxf.rs.security.xml; +import java.util.Map; + public class SignatureProperties { private String signatureAlgo; private String signatureDigestAlgo; @@ -25,6 +27,7 @@ public class SignatureProperties { private String signatureC14nTransform; private String signatureKeyIdType; private String signatureKeyName; +private Map keyNameAliasMap; public void setSignatureAlgo(String signatureAlgo) { this.signatureAlgo = signatureAlgo; @@ -79,4 +82,17 @@ public class SignatureProperties { this.signatureKeyName = signatureKeyName; } +public Map getKeyNameAliasMap() { +return keyNameAliasMap; +} + +/** + * Set the Signature KeyName alias lookup map. It is used on the receiving side for signature. + * It maps a KeyName to a key alias - so it allows us to associate a (e.g.) key alias in + * a keystore with a given KeyName contained in a KeyInfo structure of the Signature. + */ +public void setKeyNameAliasMap(Map keyNameAliasMap) { +this.keyNameAliasMap = keyNameAliasMap; +} + } http://git-wip-us.apache.org/repos/asf/cxf/blob/5c902609/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java -- diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java index 3341793..0a98835 100644 --- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java +++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java @@ -27,6 +27,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.logging.Logger; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; @@ -66,6 +67,7 @@ import org.apache.xml.security.stax.ext.InboundXMLSec; import org.apache.xml.security.stax.ext.XMLSec; import org.apache.xml.security.stax.ext.XMLSecurityConstants; import org.apache.xml.security.stax.ext.XMLSecurityProperties; +import org.apache.xml.security.stax.impl.securityToken.KeyNameSecurityToken; import org.apache.xml.security.stax.securityEvent.AlgorithmSuiteSecurityEvent; import org.apache.xml.security.stax.securityEvent.SecurityEvent; import org.apache.xml.security.stax.securityEvent.SecurityEventConstants; @@ -216,7 +218,19 @@ public class XmlSecInInterceptor extends AbstractPhaseInterceptor imple if (certs != null && certs.length > 0) { properties.setSignatureVerificationKey(certs[0].getPublicKey()); } +} else if (sigCrypto != null && sigProps != null && sigProps.getKeyNameAliasMap() != null) { +Map keyNameAliasMap = sigProps.getKeyNameAliasMap(); +for (Map.Entry mapping:
[1/2] cxf git commit: Removing deprecated methods
Repository: cxf Updated Branches: refs/heads/master 16672c10c -> 2ea81b5f7 Removing deprecated methods Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/eb55972a Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/eb55972a Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/eb55972a Branch: refs/heads/master Commit: eb55972ac7eb588d17b2f0380913d80ece3fd6b3 Parents: 16672c1 Author: Colm O hEigeartaighAuthored: Wed Mar 29 09:54:45 2017 +0100 Committer: Colm O hEigeartaigh Committed: Wed Mar 29 09:54:45 2017 +0100 -- .../cxf/rs/security/xml/SignatureProperties.java| 16 1 file changed, 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/eb55972a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/SignatureProperties.java -- diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/SignatureProperties.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/SignatureProperties.java index 8c861ab..040cbb0 100644 --- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/SignatureProperties.java +++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/SignatureProperties.java @@ -38,31 +38,15 @@ public class SignatureProperties { public String getSignatureDigestAlgo() { return signatureDigestAlgo; } -@Deprecated -public void setSignatureC14Method(String signatureC14Method) { -setSignatureC14nMethod(signatureC14Method); -} public void setSignatureC14nMethod(String signatureC14nMethod) { this.signatureC14nMethod = signatureC14nMethod; } -@Deprecated -public String getSignatureC14Method() { -return getSignatureC14nMethod(); -} public String getSignatureC14nMethod() { return signatureC14nMethod; } -@Deprecated -public void setSignatureC14Transform(String signatureC14Transform) { -setSignatureC14nTransform(signatureC14Transform); -} public void setSignatureC14nTransform(String signatureC14nTransform) { this.signatureC14nTransform = signatureC14nTransform; } -@Deprecated -public String getSignatureC14Transform() { -return getSignatureC14nTransform(); -} public String getSignatureC14nTransform() { return signatureC14nTransform; }
[2/2] cxf git commit: CXF-7084 - Dynamically load signature validation keys using KeyName. Thanks to Hugo Trippaers for the patch. This closes #177.
CXF-7084 - Dynamically load signature validation keys using KeyName. Thanks to Hugo Trippaers for the patch. This closes #177. Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2ea81b5f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2ea81b5f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2ea81b5f Branch: refs/heads/master Commit: 2ea81b5f7dd84d4d179a2d9ac77c5660a8aeb3c9 Parents: eb55972 Author: Colm O hEigeartaighAuthored: Wed Mar 29 10:25:00 2017 +0100 Committer: Colm O hEigeartaigh Committed: Wed Mar 29 10:25:00 2017 +0100 -- .../rs/security/xml/SignatureProperties.java| 16 + .../rs/security/xml/XmlSecInInterceptor.java| 37 .../jaxrs/security/xml/JAXRSXmlSecTest.java | 2 +- .../systest/jaxrs/security/xml/stax-server.xml | 12 ++- 4 files changed, 65 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/2ea81b5f/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/SignatureProperties.java -- diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/SignatureProperties.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/SignatureProperties.java index 040cbb0..13cd047 100644 --- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/SignatureProperties.java +++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/SignatureProperties.java @@ -18,6 +18,8 @@ */ package org.apache.cxf.rs.security.xml; +import java.util.Map; + public class SignatureProperties { private String signatureAlgo; private String signatureDigestAlgo; @@ -25,6 +27,7 @@ public class SignatureProperties { private String signatureC14nTransform; private String signatureKeyIdType; private String signatureKeyName; +private Map keyNameAliasMap; public void setSignatureAlgo(String signatureAlgo) { this.signatureAlgo = signatureAlgo; @@ -63,4 +66,17 @@ public class SignatureProperties { this.signatureKeyName = signatureKeyName; } +public Map getKeyNameAliasMap() { +return keyNameAliasMap; +} + +/** + * Set the Signature KeyName alias lookup map. It is used on the receiving side for signature. + * It maps a KeyName to a key alias - so it allows us to associate a (e.g.) key alias in + * a keystore with a given KeyName contained in a KeyInfo structure of the Signature. + */ +public void setKeyNameAliasMap(Map keyNameAliasMap) { +this.keyNameAliasMap = keyNameAliasMap; +} + } http://git-wip-us.apache.org/repos/asf/cxf/blob/2ea81b5f/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java -- diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java index 4514051..5730381 100644 --- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java +++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/XmlSecInInterceptor.java @@ -27,6 +27,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.logging.Logger; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; @@ -66,6 +67,7 @@ import org.apache.xml.security.stax.ext.InboundXMLSec; import org.apache.xml.security.stax.ext.XMLSec; import org.apache.xml.security.stax.ext.XMLSecurityConstants; import org.apache.xml.security.stax.ext.XMLSecurityProperties; +import org.apache.xml.security.stax.impl.securityToken.KeyNameSecurityToken; import org.apache.xml.security.stax.securityEvent.AlgorithmSuiteSecurityEvent; import org.apache.xml.security.stax.securityEvent.SecurityEvent; import org.apache.xml.security.stax.securityEvent.SecurityEventConstants; @@ -216,7 +218,19 @@ public class XmlSecInInterceptor extends AbstractPhaseInterceptor imple if (certs != null && certs.length > 0) { properties.setSignatureVerificationKey(certs[0].getPublicKey()); } +} else if (sigCrypto != null && sigProps != null && sigProps.getKeyNameAliasMap() != null) { +Map keyNameAliasMap = sigProps.getKeyNameAliasMap(); +for (Map.Entry mapping: keyNameAliasMap.entrySet()) { +CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS); +