[cxf] branch 3.3.x-fixes updated: CXF-8120: JAX-RS 2.1 SSE client: forbidden response without WebApplicationException
This is an automated email from the ASF dual-hosted git repository. reta pushed a commit to branch 3.3.x-fixes in repository https://gitbox.apache.org/repos/asf/cxf.git The following commit(s) were added to refs/heads/3.3.x-fixes by this push: new 1a4505c CXF-8120: JAX-RS 2.1 SSE client: forbidden response without WebApplicationException 1a4505c is described below commit 1a4505c09fa403262a54e0fa745edf78a8c3ba0c Author: reta AuthorDate: Sun Sep 22 12:26:32 2019 -0400 CXF-8120: JAX-RS 2.1 SSE client: forbidden response without WebApplicationException (cherry picked from commit 88e3eb24de7ee6498240aac557ccf3d75a1be9af) --- .../org/apache/cxf/jaxrs/utils/ExceptionUtils.java | 12 .../apache/cxf/jaxrs/client/AbstractClient.java| 10 +--- .../cxf/jaxrs/sse/client/SseEventSourceImpl.java | 10 +++- .../jaxrs/sse/client/SseEventSourceImplTest.java | 64 -- 4 files changed, 80 insertions(+), 16 deletions(-) diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java index 5e8b014..a8c607a 100644 --- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java @@ -21,6 +21,7 @@ package org.apache.cxf.jaxrs.utils; import java.io.PrintWriter; import java.io.StringWriter; +import java.lang.reflect.Constructor; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; @@ -169,4 +170,15 @@ public final class ExceptionUtils { return toWebApplicationException(ex, response); } } + +public static WebApplicationException toWebApplicationException(Response response) { +try { +final Class exceptionClass = ExceptionUtils.getWebApplicationExceptionClass(response, +WebApplicationException.class); +final Constructor ctr = exceptionClass.getConstructor(Response.class); +return (WebApplicationException)ctr.newInstance(response); +} catch (Throwable ex) { +return new WebApplicationException(response); +} +} } diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java index c6f6a88..80eb2cc 100644 --- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java +++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java @@ -23,7 +23,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.lang.annotation.Annotation; -import java.lang.reflect.Constructor; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; @@ -536,14 +535,7 @@ public abstract class AbstractClient implements Client { } protected WebApplicationException convertToWebApplicationException(Response r) { -try { -Class exceptionClass = ExceptionUtils.getWebApplicationExceptionClass(r, - WebApplicationException.class); -Constructor ctr = exceptionClass.getConstructor(Response.class); -return (WebApplicationException)ctr.newInstance(r); -} catch (Throwable ex2) { -return new WebApplicationException(r); -} +return ExceptionUtils.toWebApplicationException(r); } protected T readBody(Response r, Message outMessage, Class cls, diff --git a/rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/client/SseEventSourceImpl.java b/rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/client/SseEventSourceImpl.java index 3a7f78e..f0c2acf 100644 --- a/rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/client/SseEventSourceImpl.java +++ b/rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/client/SseEventSourceImpl.java @@ -41,6 +41,7 @@ import javax.ws.rs.sse.SseEventSource; import org.apache.cxf.common.logging.LogUtils; import org.apache.cxf.endpoint.Endpoint; import org.apache.cxf.jaxrs.client.WebClient; +import org.apache.cxf.jaxrs.utils.ExceptionUtils; /** * SSE Event Source implementation @@ -191,13 +192,20 @@ public class SseEventSourceImpl implements SseEventSource { // A client can be told to stop reconnecting using the HTTP 204 No Content // response code. In this case, we should give up. -if (response.getStatus() == 204) { +final int status = response.getStatus(); +if (status == 204) { LOG.fine("SSE endpoint " + target.getUri() + " returns no data, disconnecting"); state.set(SseSourceState.CLOSED); response.close(); return; } +// Convert unsuccessful responses to instances of
buildbot success in on cxf-site-production
The Buildbot has detected a restored build on builder cxf-site-production while building . Full details are available at: https://ci.apache.org/builders/cxf-site-production/builds/35522 Buildbot URL: https://ci.apache.org/ Buildslave for this Build: bb-cms-slave Build Reason: The Nightly scheduler named 'cxf-site-production' triggered this build Build Source Stamp: [branch cxf/web] HEAD Blamelist: Build succeeded! Sincerely, -The Buildbot
[cxf] branch master updated: CXF-8120: JAX-RS 2.1 SSE client: forbidden response without WebApplicationException
This is an automated email from the ASF dual-hosted git repository. reta pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cxf.git The following commit(s) were added to refs/heads/master by this push: new 88e3eb2 CXF-8120: JAX-RS 2.1 SSE client: forbidden response without WebApplicationException 88e3eb2 is described below commit 88e3eb24de7ee6498240aac557ccf3d75a1be9af Author: reta AuthorDate: Sun Sep 22 12:26:32 2019 -0400 CXF-8120: JAX-RS 2.1 SSE client: forbidden response without WebApplicationException --- .../org/apache/cxf/jaxrs/utils/ExceptionUtils.java | 12 .../apache/cxf/jaxrs/client/AbstractClient.java| 10 +--- .../cxf/jaxrs/sse/client/SseEventSourceImpl.java | 10 +++- .../jaxrs/sse/client/SseEventSourceImplTest.java | 64 -- 4 files changed, 80 insertions(+), 16 deletions(-) diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java index 5e8b014..a8c607a 100644 --- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java @@ -21,6 +21,7 @@ package org.apache.cxf.jaxrs.utils; import java.io.PrintWriter; import java.io.StringWriter; +import java.lang.reflect.Constructor; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; @@ -169,4 +170,15 @@ public final class ExceptionUtils { return toWebApplicationException(ex, response); } } + +public static WebApplicationException toWebApplicationException(Response response) { +try { +final Class exceptionClass = ExceptionUtils.getWebApplicationExceptionClass(response, +WebApplicationException.class); +final Constructor ctr = exceptionClass.getConstructor(Response.class); +return (WebApplicationException)ctr.newInstance(response); +} catch (Throwable ex) { +return new WebApplicationException(response); +} +} } diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java index c6f6a88..80eb2cc 100644 --- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java +++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java @@ -23,7 +23,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.lang.annotation.Annotation; -import java.lang.reflect.Constructor; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; @@ -536,14 +535,7 @@ public abstract class AbstractClient implements Client { } protected WebApplicationException convertToWebApplicationException(Response r) { -try { -Class exceptionClass = ExceptionUtils.getWebApplicationExceptionClass(r, - WebApplicationException.class); -Constructor ctr = exceptionClass.getConstructor(Response.class); -return (WebApplicationException)ctr.newInstance(r); -} catch (Throwable ex2) { -return new WebApplicationException(r); -} +return ExceptionUtils.toWebApplicationException(r); } protected T readBody(Response r, Message outMessage, Class cls, diff --git a/rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/client/SseEventSourceImpl.java b/rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/client/SseEventSourceImpl.java index 3a7f78e..f0c2acf 100644 --- a/rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/client/SseEventSourceImpl.java +++ b/rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/client/SseEventSourceImpl.java @@ -41,6 +41,7 @@ import javax.ws.rs.sse.SseEventSource; import org.apache.cxf.common.logging.LogUtils; import org.apache.cxf.endpoint.Endpoint; import org.apache.cxf.jaxrs.client.WebClient; +import org.apache.cxf.jaxrs.utils.ExceptionUtils; /** * SSE Event Source implementation @@ -191,13 +192,20 @@ public class SseEventSourceImpl implements SseEventSource { // A client can be told to stop reconnecting using the HTTP 204 No Content // response code. In this case, we should give up. -if (response.getStatus() == 204) { +final int status = response.getStatus(); +if (status == 204) { LOG.fine("SSE endpoint " + target.getUri() + " returns no data, disconnecting"); state.set(SseSourceState.CLOSED); response.close(); return; } +// Convert unsuccessful responses to instances of WebApplicationException +if (status != 304 && status >= 300) { +
buildbot failure in on cxf-site-production
The Buildbot has detected a new failure on builder cxf-site-production while building . Full details are available at: https://ci.apache.org/builders/cxf-site-production/builds/35521 Buildbot URL: https://ci.apache.org/ Buildslave for this Build: bb-cms-slave Build Reason: The Nightly scheduler named 'cxf-site-production' triggered this build Build Source Stamp: [branch cxf/web] HEAD Blamelist: BUILD FAILED: failed compile Sincerely, -The Buildbot
[cxf] 02/02: Recording .gitmergeinfo Changes
This is an automated email from the ASF dual-hosted git repository. coheigea pushed a commit to branch 3.2.x-fixes in repository https://gitbox.apache.org/repos/asf/cxf.git commit e2c7d4819cd524dc496aa17a10a1c993cf1d697c Author: Colm O hEigeartaigh AuthorDate: Wed Sep 25 17:16:59 2019 +0100 Recording .gitmergeinfo Changes --- .gitmergeinfo | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitmergeinfo b/.gitmergeinfo index 8ff64b5..6f78719 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -669,6 +669,7 @@ M 0f6490cb4e63118dcf4deedd0345ed4b6a35b669 M 1188522e725c117f46668c54b5e2102f1bf7a414 M 1449f125586deaf6f5d87e282f0e1502eef4b6b4 M 15982b9496d0909ffa37e895a48c8428464196c9 +M 182d5c91002425fd79c6c62c0318a554fb8cecac M 1cc03b9b70bc509d8f8c631563c3964e56e30621 M 1cdf673a8ce2fc5c57318d1a102ca0923cb1d945 M 1f0468398ddb21ecaf6b6eda370e3464e402ef8a
[cxf] branch 3.2.x-fixes updated (25e6b33 -> e2c7d48)
This is an automated email from the ASF dual-hosted git repository. coheigea pushed a change to branch 3.2.x-fixes in repository https://gitbox.apache.org/repos/asf/cxf.git. from 25e6b33 Recording .gitmergeinfo Changes new ea5f3f5 Upgrading Jackson new e2c7d48 Recording .gitmergeinfo Changes The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .gitmergeinfo | 1 + parent/pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)
[cxf] 01/02: Upgrading Jackson
This is an automated email from the ASF dual-hosted git repository. coheigea pushed a commit to branch 3.2.x-fixes in repository https://gitbox.apache.org/repos/asf/cxf.git commit ea5f3f5713dfa1afcd94303e42e9d1268b147f8b Author: Colm O hEigeartaigh AuthorDate: Wed Sep 25 16:50:04 2019 +0100 Upgrading Jackson (cherry picked from commit e821949b8121e6c18a2cec9e8617863d54ec5931) (cherry picked from commit 182d5c91002425fd79c6c62c0318a554fb8cecac) # Conflicts: # parent/pom.xml --- parent/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parent/pom.xml b/parent/pom.xml index 78c49d7..a9327c4 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -97,8 +97,8 @@ 4.4.9 [4.3,4.5.0) 2.4.1 -2.9.9 -2.9.9.3 +2.9.10 +2.9.10 0.7.2 1.1.1 1.2.3
[cxf] branch 3.3.x-fixes updated: Upgrading Jackson
This is an automated email from the ASF dual-hosted git repository. coheigea pushed a commit to branch 3.3.x-fixes in repository https://gitbox.apache.org/repos/asf/cxf.git The following commit(s) were added to refs/heads/3.3.x-fixes by this push: new 182d5c9 Upgrading Jackson 182d5c9 is described below commit 182d5c91002425fd79c6c62c0318a554fb8cecac Author: Colm O hEigeartaigh AuthorDate: Wed Sep 25 16:50:04 2019 +0100 Upgrading Jackson (cherry picked from commit e821949b8121e6c18a2cec9e8617863d54ec5931) --- parent/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parent/pom.xml b/parent/pom.xml index c3f9221..974f577 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -128,8 +128,8 @@ 4.5.10 [4.3,4.5.0) 4.4.12 -2.9.9 -2.9.9.3 +2.9.10 +2.9.10 0.35.5 0.7.2 3.25.0-GA
[cxf] branch master updated: Upgrading Jackson
This is an automated email from the ASF dual-hosted git repository. coheigea pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cxf.git The following commit(s) were added to refs/heads/master by this push: new e821949 Upgrading Jackson e821949 is described below commit e821949b8121e6c18a2cec9e8617863d54ec5931 Author: Colm O hEigeartaigh AuthorDate: Wed Sep 25 16:50:04 2019 +0100 Upgrading Jackson --- parent/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parent/pom.xml b/parent/pom.xml index 64dc927..9eabafa 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -130,8 +130,8 @@ 4.5.10 [4.3,4.5.0) 4.4.12 -2.9.9 -2.9.9.3 +2.9.10 +2.9.10 0.35.5 0.7.2 3.25.0-GA
buildbot success in on cxf-site-production
The Buildbot has detected a restored build on builder cxf-site-production while building . Full details are available at: https://ci.apache.org/builders/cxf-site-production/builds/35512 Buildbot URL: https://ci.apache.org/ Buildslave for this Build: bb-cms-slave Build Reason: The Nightly scheduler named 'cxf-site-production' triggered this build Build Source Stamp: [branch cxf/web] HEAD Blamelist: Build succeeded! Sincerely, -The Buildbot
buildbot failure in on cxf-site-production
The Buildbot has detected a new failure on builder cxf-site-production while building . Full details are available at: https://ci.apache.org/builders/cxf-site-production/builds/35511 Buildbot URL: https://ci.apache.org/ Buildslave for this Build: bb-cms-slave Build Reason: The Nightly scheduler named 'cxf-site-production' triggered this build Build Source Stamp: [branch cxf/web] HEAD Blamelist: BUILD FAILED: failed compile Sincerely, -The Buildbot
[cxf] branch master updated: cxf-services-sts-systests-basic: consolidate checks
This is an automated email from the ASF dual-hosted git repository. buhhunyx pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cxf.git The following commit(s) were added to refs/heads/master by this push: new 11de1e0 cxf-services-sts-systests-basic: consolidate checks 11de1e0 is described below commit 11de1e0dfff9a8f9b157e23983c8e25f8503f868 Author: Alexey Markevich AuthorDate: Wed Sep 25 13:22:00 2019 +0300 cxf-services-sts-systests-basic: consolidate checks --- .../apache/cxf/systest/sts/rest/STSRESTTest.java | 226 ++--- 1 file changed, 65 insertions(+), 161 deletions(-) diff --git a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/rest/STSRESTTest.java b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/rest/STSRESTTest.java index dc68013..cf1ed67 100644 --- a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/rest/STSRESTTest.java +++ b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/rest/STSRESTTest.java @@ -122,8 +122,7 @@ public class STSRESTTest extends AbstractBusClientServerTestBase { @org.junit.Test public void testIssueSAML2Token() throws Exception { -String address = "https://localhost:; + STSPORT + "/SecurityTokenService/token"; -WebClient client = webClient(address) +WebClient client = webClient() .path("saml2.0") .accept(MediaType.APPLICATION_XML); @@ -131,20 +130,13 @@ public class STSRESTTest extends AbstractBusClientServerTestBase { assertNotNull(assertionDoc); // Process the token -List results = processToken(assertionDoc.getDocumentElement()); - -assertTrue(results != null && results.size() == 1); -SamlAssertionWrapper assertion = - (SamlAssertionWrapper)results.get(0).get(WSSecurityEngineResult.TAG_SAML_ASSERTION); -assertNotNull(assertion); +SamlAssertionWrapper assertion = processToken(assertionDoc); assertTrue(assertion.getSaml2() != null && assertion.getSaml1() == null); -assertTrue(assertion.isSigned()); } @org.junit.Test public void testIssueSAML1Token() throws Exception { -String address = "https://localhost:; + STSPORT + "/SecurityTokenService/token"; -WebClient client = webClient(address) +WebClient client = webClient() .path("saml1.1") .accept(MediaType.APPLICATION_XML); @@ -152,20 +144,13 @@ public class STSRESTTest extends AbstractBusClientServerTestBase { assertNotNull(assertionDoc); // Process the token -List results = processToken(assertionDoc.getDocumentElement()); - -assertTrue(results != null && results.size() == 1); -SamlAssertionWrapper assertion = - (SamlAssertionWrapper)results.get(0).get(WSSecurityEngineResult.TAG_SAML_ASSERTION); -assertNotNull(assertion); +SamlAssertionWrapper assertion = processToken(assertionDoc); assertTrue(assertion.getSaml2() == null && assertion.getSaml1() != null); -assertTrue(assertion.isSigned()); } @org.junit.Test public void testIssueSymmetricKeySaml1() throws Exception { -String address = "https://localhost:; + STSPORT + "/SecurityTokenService/token"; -WebClient client = webClient(address) +WebClient client = webClient() .path("saml1.1") .query("keyType", STSConstants.SYMMETRIC_KEY_KEYTYPE) .accept(MediaType.APPLICATION_XML); @@ -174,14 +159,8 @@ public class STSRESTTest extends AbstractBusClientServerTestBase { assertNotNull(assertionDoc); // Process the token -List results = processToken(assertionDoc.getDocumentElement()); - -assertTrue(results != null && results.size() == 1); -SamlAssertionWrapper assertion = - (SamlAssertionWrapper)results.get(0).get(WSSecurityEngineResult.TAG_SAML_ASSERTION); -assertNotNull(assertion); +SamlAssertionWrapper assertion = processToken(assertionDoc); assertTrue(assertion.getSaml2() == null && assertion.getSaml1() != null); -assertTrue(assertion.isSigned()); List methods = assertion.getConfirmationMethods(); String confirmMethod = null; @@ -195,8 +174,7 @@ public class STSRESTTest extends AbstractBusClientServerTestBase { @org.junit.Test public void testIssueSymmetricKeySaml1ShortKeyType() throws Exception { -String address = "https://localhost:; + STSPORT + "/SecurityTokenService/token"; -WebClient client = webClient(address) +WebClient client = webClient() .path("saml1.1") .query("keyType", "SymmetricKey") .accept(MediaType.APPLICATION_XML); @@ -205,14 +183,8 @@ public class STSRESTTest extends AbstractBusClientServerTestBase { assertNotNull(assertionDoc);