You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2020/05/13 07:45:27 UTC

[syncope] branch master updated (ebd39df -> ec10c7b)

This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git.


    from ebd39df  Fixing weird behavior with autocomplete and search by clicking on magnifier icon
     new 401b8ea  Upgrading Tomcat and Wildfly
     new ec10c7b  [SYNCOPE-1561] Propagating TLSClientParameters to BatchRequest and Batch Response

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:
 .../apache/syncope/client/lib/SyncopeClient.java   |  3 ++-
 .../syncope/client/lib/batch/BatchRequest.java     | 20 ++++++++++++++----
 .../syncope/client/lib/batch/BatchResponse.java    | 24 +++++++++++++++++++---
 pom.xml                                            |  4 ++--
 4 files changed, 41 insertions(+), 10 deletions(-)


[syncope] 01/02: Upgrading Tomcat and Wildfly

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 401b8ea836511f57cf1a667e76326be5162432e7
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Tue May 12 17:31:14 2020 +0200

    Upgrading Tomcat and Wildfly
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index f1d5941..fd9350d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -510,8 +510,8 @@ under the License.
     <cargo.log>${log.directory}/cargo.log</cargo.log>
     <cargo.output>${log.directory}/cargo-output.log</cargo.output>
 
-    <tomcat.version>9.0.34</tomcat.version>
-    <wildfly.version>19.0.0.Final</wildfly.version>
+    <tomcat.version>9.0.35</tomcat.version>
+    <wildfly.version>19.1.0.Final</wildfly.version>
     <payara.version>5.201</payara.version>
     <javax.faces.version>2.3.14</javax.faces.version>
 


[syncope] 02/02: [SYNCOPE-1561] Propagating TLSClientParameters to BatchRequest and Batch Response

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit ec10c7b4249515faee7614c8affe4c60f1cf08fb
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Wed May 13 09:43:16 2020 +0200

    [SYNCOPE-1561] Propagating TLSClientParameters to BatchRequest and Batch Response
---
 .../apache/syncope/client/lib/SyncopeClient.java   |  3 ++-
 .../syncope/client/lib/batch/BatchRequest.java     | 20 ++++++++++++++----
 .../syncope/client/lib/batch/BatchResponse.java    | 24 +++++++++++++++++++---
 3 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java
index 2979c9b..bf6ea23 100644
--- a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java
+++ b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java
@@ -406,6 +406,7 @@ public class SyncopeClient {
                 mediaType,
                 restClientFactory.getAddress(),
                 restClientFactory.getProviders(),
-                getJWT());
+                getJWT(),
+                tlsClientParameters);
     }
 }
diff --git a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchRequest.java b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchRequest.java
index bc62a93..c3c33c9 100644
--- a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchRequest.java
+++ b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchRequest.java
@@ -22,8 +22,11 @@ import java.util.List;
 import java.util.UUID;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
+import org.apache.cxf.configuration.jsse.TLSClientParameters;
 import org.apache.cxf.jaxrs.client.Client;
+import org.apache.cxf.jaxrs.client.ClientConfiguration;
 import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.cxf.transport.http.HTTPConduit;
 import org.apache.syncope.common.rest.api.Preference;
 import org.apache.syncope.common.rest.api.RESTHeaders;
 import org.apache.syncope.common.rest.api.batch.BatchPayloadGenerator;
@@ -46,18 +49,22 @@ public class BatchRequest {
 
     private final List<?> providers;
 
+    private final TLSClientParameters tlsClientParameters;
+
     private BatchClientFactoryBean bcfb;
 
     public BatchRequest(
             final MediaType mediaType,
             final String address,
             final List<?> providers,
-            final String jwt) {
+            final String jwt,
+            final TLSClientParameters tlsClientParameters) {
 
         this.mediaType = mediaType;
         this.jwt = jwt;
         this.address = address;
         this.providers = providers;
+        this.tlsClientParameters = tlsClientParameters;
         initBatchClientFactoryBean();
     }
 
@@ -85,7 +92,7 @@ public class BatchRequest {
      * Sends the current request, with items accumulated by invoking methods on proxies obtained via
      * {@link #getService(java.lang.Class)}, to the Batch service, and awaits for synchronous response.
      * It also clears out the accumulated items, in case of reuse of this instance for subsequent requests.
-     * 
+     *
      * @return batch response
      */
     public BatchResponse commit() {
@@ -97,7 +104,7 @@ public class BatchRequest {
      * {@link #getService(java.lang.Class)}, to the Batch service, and awaits for a synchronous or asynchronous
      * response, depending on the {@code async} parameter.
      * It also clears out the accumulated items, in case of reuse of this instance for subsequent requests.
-     * 
+     *
      * @param async whether asynchronous Batch process is requested, or not
      * @return batch response
      */
@@ -110,12 +117,17 @@ public class BatchRequest {
         if (async) {
             webClient.header(RESTHeaders.PREFER, Preference.RESPOND_ASYNC);
         }
+        if (tlsClientParameters != null) {
+            ClientConfiguration config = WebClient.getConfig(webClient);
+            HTTPConduit httpConduit = (HTTPConduit) config.getConduit();
+            httpConduit.setTlsClientParameters(tlsClientParameters);
+        }
 
         String body = BatchPayloadGenerator.generate(bcfb.getBatchRequestItems(), boundary);
         LOG.debug("Batch request body:\n{}", body);
 
         initBatchClientFactoryBean();
 
-        return new BatchResponse(boundary, jwt, webClient.post(body));
+        return new BatchResponse(boundary, jwt, tlsClientParameters, webClient.post(body));
     }
 }
diff --git a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchResponse.java b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchResponse.java
index 80a32e8..5b6ee8b 100644
--- a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchResponse.java
+++ b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchResponse.java
@@ -26,8 +26,11 @@ import java.nio.charset.StandardCharsets;
 import java.util.List;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.Response;
+import org.apache.cxf.configuration.jsse.TLSClientParameters;
 import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.jaxrs.client.ClientConfiguration;
 import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.cxf.transport.http.HTTPConduit;
 import org.apache.syncope.common.rest.api.RESTHeaders;
 import org.apache.syncope.common.rest.api.batch.BatchPayloadParser;
 import org.apache.syncope.common.rest.api.batch.BatchResponseItem;
@@ -47,11 +50,19 @@ public class BatchResponse {
 
     private final URI monitor;
 
+    private final TLSClientParameters tlsClientParameters;
+
     private Response response;
 
-    public BatchResponse(final String boundary, final String jwt, final Response response) {
+    public BatchResponse(
+            final String boundary,
+            final String jwt,
+            final TLSClientParameters tlsClientParameters,
+            final Response response) {
+
         this.boundary = boundary;
         this.jwt = jwt;
+        this.tlsClientParameters = tlsClientParameters;
         this.monitor = response.getLocation();
         this.response = response;
     }
@@ -72,9 +83,16 @@ public class BatchResponse {
      */
     public Response poll() {
         if (monitor != null) {
-            response = WebClient.create(monitor).
+            WebClient webClient = WebClient.create(monitor).
                     header(HttpHeaders.AUTHORIZATION, "Bearer " + jwt).
-                    type(RESTHeaders.multipartMixedWith(boundary.substring(2))).get();
+                    type(RESTHeaders.multipartMixedWith(boundary.substring(2)));
+            if (tlsClientParameters != null) {
+                ClientConfiguration config = WebClient.getConfig(webClient);
+                HTTPConduit httpConduit = (HTTPConduit) config.getConduit();
+                httpConduit.setTlsClientParameters(tlsClientParameters);
+            }
+
+            response = webClient.get();
         }
 
         return response;