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:32 UTC

[syncope] branch 2_1_X updated (de1a909 -> e07c0ae)

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

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


    from de1a909  Fixing weird behavior with autocomplete and search by clicking on magnifier icon
     new 3ad8524  Upgrading Tomcat
     new e07c0ae  [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                                            |  2 +-
 4 files changed, 40 insertions(+), 9 deletions(-)


[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 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit e07c0aeadb9d00b07a2ecec283d34b94a30e04a7
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/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java b/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java
index 8e0809f..3666d11 100644
--- a/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java
+++ b/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java
@@ -407,6 +407,7 @@ public class SyncopeClient {
                 mediaType,
                 restClientFactory.getAddress(),
                 restClientFactory.getProviders(),
-                getJWT());
+                getJWT(),
+                tlsClientParameters);
     }
 }
diff --git a/client/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchRequest.java b/client/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchRequest.java
index bc62a93..c3c33c9 100644
--- a/client/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchRequest.java
+++ b/client/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/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchResponse.java b/client/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchResponse.java
index 80a32e8..5b6ee8b 100644
--- a/client/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchResponse.java
+++ b/client/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;


[syncope] 01/02: Upgrading Tomcat

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

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

commit 3ad8524800584978c886475e8b03d7807b2de3fb
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Tue May 12 17:30:16 2020 +0200

    Upgrading Tomcat
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 075b5c0..663cb47 100644
--- a/pom.xml
+++ b/pom.xml
@@ -534,7 +534,7 @@ 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>
+    <tomcat.version>9.0.35</tomcat.version>
 
     <nodejs.version>v8.11.4</nodejs.version>    
     <protractor.version>5.4.0</protractor.version>