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 2022/01/07 18:17:55 UTC

[syncope] branch master updated (273ca7b -> a54bade)

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 273ca7b  Remove CGLib proxies from Spring configuration components - part 1 (#301)
     new 822e3e9  Upgrading Wicket jQuery UI
     new 18a21da  Upgrading asciidoctorj-pdf
     new a54bade  Working around Spring Cloud Gateway tie to Hibernate Validator and not Jakarta Validation API

The 3 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:
 pom.xml                                            |  4 ++--
 .../cloud/gateway/config/DataSizeMax.java          | 21 +++++++++++++-------
 .../cloud/gateway/config/DataSizeMaxValidator.java | 23 ++++++++++++++--------
 .../cloud/gateway/config/HttpClientProperties.java | 20 +++++++++++--------
 4 files changed, 43 insertions(+), 25 deletions(-)
 copy core/persistence-jpa-json/src/main/java/org/apache/syncope/core/persistence/jpa/validation/entity/JPAJSONAttributableCheck.java => sra/src/main/java/org/springframework/cloud/gateway/config/DataSizeMax.java (73%)
 copy common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/batch/BatchResponseItem.java => sra/src/main/java/org/springframework/cloud/gateway/config/DataSizeMaxValidator.java (52%)

[syncope] 02/03: Upgrading asciidoctorj-pdf

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 18a21da32c2f6619a099504e54e6d3586dd1b128
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Tue Jan 4 15:55:48 2022 +0100

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

diff --git a/pom.xml b/pom.xml
index 00a0cb7..cbde1b8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2669,7 +2669,7 @@ under the License.
               <dependency>
                 <groupId>org.asciidoctor</groupId>
                 <artifactId>asciidoctorj-pdf</artifactId>
-                <version>1.6.0</version>
+                <version>1.6.2</version>
               </dependency>
             </dependencies>
             <configuration>

[syncope] 01/03: Upgrading Wicket jQuery UI

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 822e3e94fdb67c8b14a91084efbbded36df30f85
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Mon Jan 3 15:58:58 2022 +0100

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

diff --git a/pom.xml b/pom.xml
index 5141c34..00a0cb7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -470,7 +470,7 @@ under the License.
 
     <wicket.version>9.7.0</wicket.version>
     <wicketstuff.version>9.6.0</wicketstuff.version>
-    <wicket-jqueryui.version>9.6.0</wicket-jqueryui.version>
+    <wicket-jqueryui.version>9.7.0</wicket-jqueryui.version>
     <wicket-bootstrap.version>5.0.6</wicket-bootstrap.version>
     <wicket-spring-boot.version>3.1.6</wicket-spring-boot.version>
 

[syncope] 03/03: Working around Spring Cloud Gateway tie to Hibernate Validator and not Jakarta Validation API

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 a54bade156ddf0f4da9dd1f188d438aa6c1c8b2a
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Fri Jan 7 19:17:03 2022 +0100

    Working around Spring Cloud Gateway tie to Hibernate Validator and not Jakarta Validation API
---
 .../cloud/gateway/config/DataSizeMax.java          | 48 ++++++++++++++++++++++
 .../cloud/gateway/config/DataSizeMaxValidator.java | 41 ++++++++++++++++++
 .../cloud/gateway/config/HttpClientProperties.java | 20 +++++----
 3 files changed, 101 insertions(+), 8 deletions(-)

diff --git a/sra/src/main/java/org/springframework/cloud/gateway/config/DataSizeMax.java b/sra/src/main/java/org/springframework/cloud/gateway/config/DataSizeMax.java
new file mode 100644
index 0000000..9d559a9
--- /dev/null
+++ b/sra/src/main/java/org/springframework/cloud/gateway/config/DataSizeMax.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.springframework.cloud.gateway.config;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import javax.validation.Constraint;
+import javax.validation.Payload;
+import org.springframework.util.unit.DataUnit;
+
+// Keep until
+// https://lists.apache.org/thread/km7c4ojrlw5q5j42cbw7nht6b0f4z5r2
+// is clear.
+@Documented
+@Constraint(validatedBy = DataSizeMaxValidator.class)
+@Target({ ElementType.FIELD, ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface DataSizeMax {
+
+    String message() default "must be less than or equal to {value} {unit}";
+
+    Class<?>[] groups() default {};
+
+    Class<? extends Payload>[] payload() default {};
+
+    int value();
+
+    DataUnit unit();
+}
diff --git a/sra/src/main/java/org/springframework/cloud/gateway/config/DataSizeMaxValidator.java b/sra/src/main/java/org/springframework/cloud/gateway/config/DataSizeMaxValidator.java
new file mode 100644
index 0000000..5e3d5aa
--- /dev/null
+++ b/sra/src/main/java/org/springframework/cloud/gateway/config/DataSizeMaxValidator.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.springframework.cloud.gateway.config;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import org.springframework.util.unit.DataSize;
+
+// Keep until
+// https://lists.apache.org/thread/km7c4ojrlw5q5j42cbw7nht6b0f4z5r2
+// is clear.
+public class DataSizeMaxValidator implements ConstraintValidator<DataSizeMax, DataSize> {
+
+    private DataSize dataSizeMax;
+
+    @Override
+    public void initialize(final DataSizeMax dataSizeMax) {
+        this.dataSizeMax = DataSize.of(dataSizeMax.value(), dataSizeMax.unit());
+    }
+
+    @Override
+    public boolean isValid(final DataSize value, final ConstraintValidatorContext context) {
+        return value == null || dataSizeMax.compareTo(value) >= 0;
+    }
+}
diff --git a/sra/src/main/java/org/springframework/cloud/gateway/config/HttpClientProperties.java b/sra/src/main/java/org/springframework/cloud/gateway/config/HttpClientProperties.java
index a3b095b..1a03102 100644
--- a/sra/src/main/java/org/springframework/cloud/gateway/config/HttpClientProperties.java
+++ b/sra/src/main/java/org/springframework/cloud/gateway/config/HttpClientProperties.java
@@ -31,7 +31,6 @@ import java.util.Collection;
 import java.util.List;
 
 import javax.net.ssl.KeyManagerFactory;
-import javax.validation.constraints.Max;
 
 import reactor.netty.resources.ConnectionProvider;
 import reactor.netty.tcp.SslProvider;
@@ -42,17 +41,19 @@ import org.springframework.boot.web.server.WebServerException;
 import org.springframework.core.style.ToStringCreator;
 import org.springframework.util.ResourceUtils;
 import org.springframework.util.unit.DataSize;
-//import org.springframework.validation.annotation.Validated;
+import org.springframework.util.unit.DataUnit;
+import org.springframework.validation.annotation.Validated;
 
 // CHECKSTYLE:OFF
-// Semi-blind copy from Spring Cloud Gateway sources, to keep until
-// https://github.com/spring-cloud/spring-cloud-gateway/issues/2303
-// is fixed.
+// Semi-blind copy from Spring Cloud Gateway sources, to keep until they are tied
+// to Hibernate Validator and not Jakarta Validation API - see
+// https://lists.apache.org/thread/km7c4ojrlw5q5j42cbw7nht6b0f4z5r2
+// for details.
 /**
  * Configuration properties for the Netty {@link reactor.netty.http.client.HttpClient}.
  */
 @ConfigurationProperties("spring.cloud.gateway.httpclient")
-//@Validated
+@Validated
 @SuppressWarnings("deprecation")
 public class HttpClientProperties {
 
@@ -102,7 +103,7 @@ public class HttpClientProperties {
 		this.responseTimeout = responseTimeout;
 	}
 
-	@Max(Integer.MAX_VALUE)
+	@DataSizeMax(value = Integer.MAX_VALUE, unit = DataUnit.BYTES)
 	public DataSize getMaxHeaderSize() {
 		return maxHeaderSize;
 	}
@@ -111,7 +112,7 @@ public class HttpClientProperties {
 		this.maxHeaderSize = maxHeaderSize;
 	}
 
-	@Max(Integer.MAX_VALUE)
+	@DataSizeMax(value = Integer.MAX_VALUE, unit = DataUnit.BYTES)
 	public DataSize getMaxInitialLineLength() {
 		return maxInitialLineLength;
 	}
@@ -422,6 +423,7 @@ public class HttpClientProperties {
 		private Duration closeNotifyReadTimeout = Duration.ZERO;
 
 		/** The default ssl configuration type. Defaults to TCP. */
+		@Deprecated
 		private SslProvider.DefaultConfigurationType defaultConfigurationType = SslProvider.DefaultConfigurationType.TCP;
 
 		/** Keystore path for Netty HttpClient. */
@@ -587,10 +589,12 @@ public class HttpClientProperties {
 			this.closeNotifyReadTimeout = closeNotifyReadTimeout;
 		}
 
+		@Deprecated
 		public SslProvider.DefaultConfigurationType getDefaultConfigurationType() {
 			return defaultConfigurationType;
 		}
 
+		@Deprecated
 		public void setDefaultConfigurationType(SslProvider.DefaultConfigurationType defaultConfigurationType) {
 			this.defaultConfigurationType = defaultConfigurationType;
 		}