This is an automated email from the ASF dual-hosted git repository.
ilgrosso pushed a commit to branch 4_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git
The following commit(s) were added to refs/heads/4_1_X by this push:
new b8b97e0dcc Upgrading WicketStuff and Jakarta Faces
b8b97e0dcc is described below
commit b8b97e0dccbc9e492ca0f82e0a953ff45d1e7354
Author: Francesco Chicchiriccò <[email protected]>
AuthorDate: Wed Sep 9 08:58:26 2026 +0200
Upgrading WicketStuff and Jakarta Faces
---
.../persistence/api/entity/PlainAttrValue.java | 2 +-
.../common/validation/PlainSchemaValidator.java | 26 +++++++++++++---------
.../core/persistence/jpa/inner/PlainAttrTest.java | 2 +-
.../persistence/neo4j/inner/PlainAttrTest.java | 2 +-
.../org/apache/syncope/fit/core/GroupITCase.java | 2 +-
.../apache/syncope/fit/core/PlainSchemaITCase.java | 2 +-
pom.xml | 4 ++--
7 files changed, 22 insertions(+), 18 deletions(-)
diff --git
a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/PlainAttrValue.java
b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/PlainAttrValue.java
index 4029465cc2..f1a83a2d4e 100644
---
a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/PlainAttrValue.java
+++
b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/PlainAttrValue.java
@@ -45,7 +45,7 @@ public class PlainAttrValue implements Serializable {
protected static final Logger LOG =
LoggerFactory.getLogger(PlainAttrValue.class);
- private static final Pattern SPRING_ENV_PROPERTY =
Pattern.compile("^\\$\\{.*\\}$");
+ public static final Pattern SPRING_ENV_PROPERTY =
Pattern.compile("^\\$\\{.*\\}$");
@JsonIgnore
@NotNull
diff --git
a/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/validation/PlainSchemaValidator.java
b/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/validation/PlainSchemaValidator.java
index 047f880d1e..a60a29ec9b 100644
---
a/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/validation/PlainSchemaValidator.java
+++
b/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/validation/PlainSchemaValidator.java
@@ -18,8 +18,11 @@
*/
package org.apache.syncope.core.persistence.common.validation;
+import static
org.apache.syncope.core.persistence.api.entity.PlainAttrValue.SPRING_ENV_PROPERTY;
+
import jakarta.validation.ConstraintValidatorContext;
import java.util.Optional;
+import org.apache.syncope.common.lib.SyncopeConstants;
import org.apache.syncope.common.lib.types.CipherAlgorithm;
import org.apache.syncope.common.lib.types.EntityViolationType;
import org.apache.syncope.core.persistence.api.entity.PlainSchema;
@@ -57,18 +60,19 @@ public class PlainSchemaValidator extends
AbstractValidator<PlainSchemaCheck, Pl
addPropertyNode("secretKey").addPropertyNode("cipherAlgorithm").addConstraintViolation();
return false;
}
- if (schema.getCipherAlgorithm() == CipherAlgorithm.AES) {
- if (Optional.ofNullable(schema.getSecretKey()).
- map(key -> key.length() != 16 && key.length() !=
24 && key.length() != 32).
- orElse(true)) {
+ if (schema.getCipherAlgorithm() == CipherAlgorithm.AES
+ &&
!SyncopeConstants.ENCRYPTED_DECODE_CONVERSION_PATTERN.equals(schema.getConversionPattern())
+ &&
!SPRING_ENV_PROPERTY.matcher(schema.getSecretKey()).matches()
+ && Optional.ofNullable(schema.getSecretKey()).
+ map(key -> key.length() != 16 && key.length()
!= 24 && key.length() != 32).
+ orElse(true)) {
- context.disableDefaultConstraintViolation();
- context.buildConstraintViolationWithTemplate(
- getTemplate(EntityViolationType.InvalidSchema,
- "SecretKey length requirements not met
for AES: must be either 16, 24 or 32")).
-
addPropertyNode("secretKey").addConstraintViolation();
- return false;
- }
+ context.disableDefaultConstraintViolation();
+ context.buildConstraintViolationWithTemplate(
+ getTemplate(EntityViolationType.InvalidSchema,
+ "SecretKey length requirements not met for
AES: must be 16 24 or 32")).
+
addPropertyNode("secretKey").addConstraintViolation();
+ return false;
}
}
diff --git
a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/PlainAttrTest.java
b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/PlainAttrTest.java
index 324934de55..340ba1134f 100644
---
a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/PlainAttrTest.java
+++
b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/PlainAttrTest.java
@@ -167,7 +167,7 @@ public class PlainAttrTest extends AbstractTest {
obscureWithDecodeConversionPattern.setAnyTypeClass(anyTypeClassDAO.findById("other").orElseThrow());
obscureWithDecodeConversionPattern.setType(AttrSchemaType.Encrypted);
obscureWithDecodeConversionPattern.setCipherAlgorithm(CipherAlgorithm.AES);
-
obscureWithDecodeConversionPattern.setSecretKey(SecureRandomUtils.generateRandomUUID().toString());
+
obscureWithDecodeConversionPattern.setSecretKey(SecureRandomUtils.generateRandomPassword(16));
obscureWithDecodeConversionPattern =
plainSchemaDAO.save(obscureWithDecodeConversionPattern);
diff --git
a/core/persistence-neo4j/src/test/java/org/apache/syncope/core/persistence/neo4j/inner/PlainAttrTest.java
b/core/persistence-neo4j/src/test/java/org/apache/syncope/core/persistence/neo4j/inner/PlainAttrTest.java
index 854a7ab463..df515d517c 100644
---
a/core/persistence-neo4j/src/test/java/org/apache/syncope/core/persistence/neo4j/inner/PlainAttrTest.java
+++
b/core/persistence-neo4j/src/test/java/org/apache/syncope/core/persistence/neo4j/inner/PlainAttrTest.java
@@ -180,7 +180,7 @@ public class PlainAttrTest extends AbstractTest {
obscureWithDecodeConversionPattern.setAnyTypeClass(anyTypeClassDAO.findById("other").orElseThrow());
obscureWithDecodeConversionPattern.setType(AttrSchemaType.Encrypted);
obscureWithDecodeConversionPattern.setCipherAlgorithm(CipherAlgorithm.AES);
-
obscureWithDecodeConversionPattern.setSecretKey(SecureRandomUtils.generateRandomUUID().toString());
+
obscureWithDecodeConversionPattern.setSecretKey(SecureRandomUtils.generateRandomPassword(16));
obscureWithDecodeConversionPattern =
plainSchemaDAO.save(obscureWithDecodeConversionPattern);
diff --git
a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
index 177dd7ecc2..8904c97b99 100644
---
a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
+++
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
@@ -638,7 +638,7 @@ public class GroupITCase extends AbstractITCase {
assertEquals("testvalue",
group.getPlainAttr(encrypted.getKey()).orElseThrow().getValues().getFirst());
// 6. update schema again to disallow cleartext values
- encrypted.setConversionPattern(null);
+ encrypted.setConversionPattern("${obscureSecretKey}");
SCHEMA_SERVICE.update(SchemaType.PLAIN, encrypted);
group = GROUP_SERVICE.read(group.getKey());
diff --git
a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PlainSchemaITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PlainSchemaITCase.java
index 1bac452fdc..e8621ee5cc 100644
---
a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PlainSchemaITCase.java
+++
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PlainSchemaITCase.java
@@ -134,7 +134,7 @@ public class PlainSchemaITCase extends AbstractITCase {
schemaTO.setKey("encrypted");
schemaTO.setType(AttrSchemaType.Encrypted);
schemaTO.setCipherAlgorithm(CipherAlgorithm.AES);
- schemaTO.setSecretKey("huhadfhsjfsfsdkj!####");
+ schemaTO.setSecretKey("huhadfhsjfsfsdkj");
createSchema(SchemaType.PLAIN, schemaTO);
}
diff --git a/pom.xml b/pom.xml
index 8f67ed0779..2d072baf0e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -486,7 +486,7 @@ under the License.
<chartjs.version>4.5.1</chartjs.version>
<wicket.version>10.11.0</wicket.version>
- <wicketstuff.version>10.10.0</wicketstuff.version>
+ <wicketstuff.version>10.11.0</wicketstuff.version>
<wicket-bootstrap.version>7.0.15</wicket-bootstrap.version>
<wicket-spring-boot.version>4.1.1</wicket-spring-boot.version>
@@ -530,7 +530,7 @@ under the License.
<tomcat.version>10.1.57</tomcat.version>
<wildfly.version>40.0.1.Final</wildfly.version>
<payara.version>6.2025.11</payara.version>
- <jakarta.faces.version>4.1.15</jakarta.faces.version>
+ <jakarta.faces.version>4.1.16</jakarta.faces.version>
<docker.postgresql.version>18-alpine</docker.postgresql.version>
<docker.mysql.version>9</docker.mysql.version>