diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 36ca9c565f6..03729d0555f 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -48,7 +48,7 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
@@ -77,7 +77,7 @@ jobs:
# uses a compiled language
- run: |
- mvn -U -T 1C -PskipTests,all
+ mvn -U -T 1C -Dapache.snapshots=true -PskipTests,all
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
diff --git a/.github/workflows/crosschecks.yml b/.github/workflows/crosschecks.yml
index 2dff009b19c..7ba6a2f4432 100644
--- a/.github/workflows/crosschecks.yml
+++ b/.github/workflows/crosschecks.yml
@@ -31,7 +31,7 @@ jobs:
fail-fast: false
matrix:
language: ['java']
- java: [ '21', '26-ea' ]
+ java: [ '25', '26-ea' ]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
@@ -47,7 +47,7 @@ jobs:
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -D'apache.snapshots=true' -P 'skipTests,all'
- name: Validate
if: runner.os == 'Linux'
run: mvn -T 1C checkstyle:check tools:verify-legal-files modernizer:modernizer apache-rat:check
diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml
index a32657a194f..3cc7999b1a8 100644
--- a/.github/workflows/dockerhub.yml
+++ b/.github/workflows/dockerhub.yml
@@ -58,12 +58,12 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all,docker'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all,docker'
- name: 'Push to DockerHub'
run: mvn -f docker/pom.xml docker:push -Ddocker.username=${{secrets.DOCKERHUB_USER}} -Ddocker.password=${{secrets.DOCKERHUB_TOKEN}}
diff --git a/.github/workflows/fit_Elasticsearch.yml b/.github/workflows/fit_Elasticsearch.yml
index 5c555b79141..601c7def800 100644
--- a/.github/workflows/fit_Elasticsearch.yml
+++ b/.github/workflows/fit_Elasticsearch.yml
@@ -34,12 +34,12 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'Elasticsearch / PostgreSQL'
run: mvn -f fit/core-reference/pom.xml -P elasticsearch-it -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true
diff --git a/.github/workflows/fit_OpenSearch.yml b/.github/workflows/fit_OpenSearch.yml
index 7d69bc388d2..dd2f6dd8db0 100644
--- a/.github/workflows/fit_OpenSearch.yml
+++ b/.github/workflows/fit_OpenSearch.yml
@@ -34,12 +34,12 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'zulu'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'OpenSearch / PostgreSQL'
run: mvn -f fit/core-reference/pom.xml -P opensearch-it -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true
diff --git a/.github/workflows/fit_Payara.yml b/.github/workflows/fit_Payara.yml
index ae6de3868d4..8e3c150e1f3 100644
--- a/.github/workflows/fit_Payara.yml
+++ b/.github/workflows/fit_Payara.yml
@@ -34,12 +34,12 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'Payara / PostgreSQL'
run: mvn -f fit/core-reference/pom.xml -P payara-it -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true
diff --git a/.github/workflows/fit_Tomcat_LiveSync.yml b/.github/workflows/fit_Tomcat_LiveSync.yml
index 443292972bf..39e5837d663 100644
--- a/.github/workflows/fit_Tomcat_LiveSync.yml
+++ b/.github/workflows/fit_Tomcat_LiveSync.yml
@@ -34,13 +34,13 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'Tomcat / PostgreSQL / Debezium'
run: mvn -f fit/core-reference/pom.xml -P debezium-it -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true
- name: 'Tomcat / PostgreSQL / SyncRepl'
diff --git a/.github/workflows/fit_Tomcat_PostgreSQL.yml b/.github/workflows/fit_Tomcat_PostgreSQL.yml
index 1058101e800..d0ee4ff9ddc 100644
--- a/.github/workflows/fit_Tomcat_PostgreSQL.yml
+++ b/.github/workflows/fit_Tomcat_PostgreSQL.yml
@@ -34,12 +34,12 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'Tomcat / PostgreSQL'
run: mvn -f fit/core-reference/pom.xml verify -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true
diff --git a/.github/workflows/fit_WA_OIDCC4UI.yml b/.github/workflows/fit_WA_OIDCC4UI.yml
index f77de653d52..f0b8529bfef 100644
--- a/.github/workflows/fit_WA_OIDCC4UI.yml
+++ b/.github/workflows/fit_WA_OIDCC4UI.yml
@@ -34,12 +34,12 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'WA / OIDCC4UI'
run: mvn -f fit/wa-reference/pom.xml verify -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true -Dit.test=OIDCC4UIITCase
diff --git a/.github/workflows/fit_WA_OpenFGA.yml b/.github/workflows/fit_WA_OpenFGA.yml
index f578f41a64d..b3f79a0b6dc 100644
--- a/.github/workflows/fit_WA_OpenFGA.yml
+++ b/.github/workflows/fit_WA_OpenFGA.yml
@@ -34,13 +34,13 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'Unit Tests: OpenFGA'
run: mvn -f ext/openfga/client-openfga/pom.xml -P openfga -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Dianal.phase=none -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true
- name: 'WA / OpenFGA'
diff --git a/.github/workflows/fit_WA_SAML2SP4UI.yml b/.github/workflows/fit_WA_SAML2SP4UI.yml
index 9f7dfda7780..ee1573e4198 100644
--- a/.github/workflows/fit_WA_SAML2SP4UI.yml
+++ b/.github/workflows/fit_WA_SAML2SP4UI.yml
@@ -34,12 +34,12 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'WA / SAML2SP4UI'
run: mkdir -p fit/core-reference/target/test-classes && cp fit/core-reference/src/test/resources/saml.keystore.jks fit/core-reference/target/test-classes && mvn -f fit/wa-reference/pom.xml verify -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true -Dit.test=SAML2SP4UIITCase
diff --git a/.github/workflows/fit_WA_SRA_CASClient.yml b/.github/workflows/fit_WA_SRA_CASClient.yml
index 783a4441b19..f6f1e96a65d 100644
--- a/.github/workflows/fit_WA_SRA_CASClient.yml
+++ b/.github/workflows/fit_WA_SRA_CASClient.yml
@@ -34,12 +34,12 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'WA / SRA / CAS Client'
run: mvn -f fit/wa-reference/pom.xml verify -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true -Dit.test=org.apache.syncope.fit.sra.CASSRAITCase
diff --git a/.github/workflows/fit_WA_SRA_OAuth2.yml b/.github/workflows/fit_WA_SRA_OAuth2.yml
index a9d9463b0c5..9a1465cf6bf 100644
--- a/.github/workflows/fit_WA_SRA_OAuth2.yml
+++ b/.github/workflows/fit_WA_SRA_OAuth2.yml
@@ -34,12 +34,12 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'WA / SRA / OAuth 2.0'
run: mvn -f fit/wa-reference/pom.xml verify -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true -Dit.test=org.apache.syncope.fit.sra.OAUTH2SRAITCase
diff --git a/.github/workflows/fit_WA_SRA_OIDC.yml b/.github/workflows/fit_WA_SRA_OIDC.yml
index 047c981b988..df6bbfc5d0d 100644
--- a/.github/workflows/fit_WA_SRA_OIDC.yml
+++ b/.github/workflows/fit_WA_SRA_OIDC.yml
@@ -34,12 +34,12 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'WA / SRA / OpenID Connect 1.0'
run: mvn -f fit/wa-reference/pom.xml verify -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true -Dit.test=org.apache.syncope.fit.sra.OIDCSRAITCase
diff --git a/.github/workflows/fit_WA_SRA_SAML2.yml b/.github/workflows/fit_WA_SRA_SAML2.yml
index 1bf02f5f248..cf67afdaac3 100644
--- a/.github/workflows/fit_WA_SRA_SAML2.yml
+++ b/.github/workflows/fit_WA_SRA_SAML2.yml
@@ -34,12 +34,12 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'WA / SRA / SAML 2.0'
run: mvn -f fit/wa-reference/pom.xml verify -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true -Dit.test=org.apache.syncope.fit.sra.SAML2SRAITCase
diff --git a/.github/workflows/fit_Wildfly.yml b/.github/workflows/fit_Wildfly.yml
index 2936d90a82a..77409f1c396 100644
--- a/.github/workflows/fit_Wildfly.yml
+++ b/.github/workflows/fit_Wildfly.yml
@@ -34,12 +34,12 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'Wildfly / PostgreSQL'
run: mvn -f fit/core-reference/pom.xml -P wildfly-it -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true
diff --git a/.github/workflows/fit_Zookeeper.yml b/.github/workflows/fit_Zookeeper.yml
index 9d733a59155..23c82d2857d 100644
--- a/.github/workflows/fit_Zookeeper.yml
+++ b/.github/workflows/fit_Zookeeper.yml
@@ -34,12 +34,12 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'Zookeeper / PostgreSQL'
run: mvn -f fit/core-reference/pom.xml -P zookeeper-it -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true
diff --git a/.github/workflows/mariadb.yml b/.github/workflows/mariadb.yml
index 3dd0fb94d65..862f256eb6f 100644
--- a/.github/workflows/mariadb.yml
+++ b/.github/workflows/mariadb.yml
@@ -34,13 +34,13 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'Unit Tests: MariaDB'
run: mvn -f core/persistence-jpa/pom.xml -P mariadb -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Dianal.phase=none -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true
- name: 'Integration Tests: MariaDB'
diff --git a/.github/workflows/mysql.yml b/.github/workflows/mysql.yml
index 71c38d9cf77..4a3420a21fa 100644
--- a/.github/workflows/mysql.yml
+++ b/.github/workflows/mysql.yml
@@ -34,13 +34,13 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'Unit Tests: MySQL'
run: mvn -f core/persistence-jpa/pom.xml -P mysql -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Dianal.phase=none -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true
- name: 'Integration Tests: MySQL'
diff --git a/.github/workflows/neo4j.yml b/.github/workflows/neo4j.yml
index d9f05139d42..1208def78d8 100644
--- a/.github/workflows/neo4j.yml
+++ b/.github/workflows/neo4j.yml
@@ -34,13 +34,13 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'Unit Tests: Neo4j'
run: mvn -f core/persistence-neo4j/pom.xml -P neo4j -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Dianal.phase=none -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true
- name: 'Integration Tests: Neo4j'
diff --git a/.github/workflows/oracle.yml b/.github/workflows/oracle.yml
index 0ae40924314..0560d9a34a7 100644
--- a/.github/workflows/oracle.yml
+++ b/.github/workflows/oracle.yml
@@ -36,13 +36,13 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
- java-version: 21
+ java-version: 25
- name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Build
- run: mvn -U -T 1C -P 'skipTests,all'
+ run: mvn -U -T 1C -Dapache.snapshots=true -P 'skipTests,all'
- name: 'Unit Tests: Oracle'
run: mvn -f core/persistence-jpa/pom.xml -P oracle -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Dianal.phase=none -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true
- name: 'Integration Tests: Oracle'
diff --git a/archetype/pom.xml b/archetype/pom.xml
index a0dc755602a..40a21253bd7 100644
--- a/archetype/pom.xml
+++ b/archetype/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope
syncope
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Archetype
diff --git a/archetype/src/main/resources/archetype-resources/fit/pom.xml b/archetype/src/main/resources/archetype-resources/fit/pom.xml
index 0031a1951eb..bc258c66517 100644
--- a/archetype/src/main/resources/archetype-resources/fit/pom.xml
+++ b/archetype/src/main/resources/archetype-resources/fit/pom.xml
@@ -448,7 +448,6 @@ under the License.
syncope
20
5
- sjvm
http://syncope:8080/syncope/rest/
http://syncope:8080/syncope/rest/keymaster
${anonymousUser}
diff --git a/client/am/console/pom.xml b/client/am/console/pom.xml
index 6f14d2a79d1..af4609cad89 100644
--- a/client/am/console/pom.xml
+++ b/client/am/console/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.client
syncope-client-am
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Client AM Console
diff --git a/client/am/console/src/main/java/org/apache/syncope/client/console/pages/WA.java b/client/am/console/src/main/java/org/apache/syncope/client/console/pages/WA.java
index f6a1003ccdf..ac5618431b3 100644
--- a/client/am/console/src/main/java/org/apache/syncope/client/console/pages/WA.java
+++ b/client/am/console/src/main/java/org/apache/syncope/client/console/pages/WA.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.client.console.pages;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
import de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel;
import jakarta.ws.rs.core.MediaType;
@@ -56,6 +54,7 @@
import org.apache.syncope.client.ui.commons.annotations.AMPage;
import org.apache.syncope.common.keymaster.client.api.ServiceOps;
import org.apache.syncope.common.keymaster.client.api.model.NetworkService;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.apache.syncope.common.lib.types.AMEntitlement;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
@@ -67,13 +66,15 @@
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.spring.injection.annot.SpringBean;
+import tools.jackson.databind.JsonNode;
+import tools.jackson.databind.json.JsonMapper;
@AMPage(label = "WA", icon = "fas fa-id-card", listEntitlement = "", priority = 200)
public class WA extends BasePage {
private static final long serialVersionUID = 9200112197134882164L;
- protected static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build();
+ protected static final JsonMapper MAPPER = new SyncopeJsonMapper();
@SpringBean
protected WAConfigRestClient waConfigRestClient;
@@ -155,7 +156,7 @@ public void onClick(final AjaxRequestTarget target) {
if (properties.has("cas.server.prefix")) {
JsonNode prefix = properties.get("cas.server.prefix");
if (prefix.has("value")) {
- waPrefix = Strings.CS.removeEnd(prefix.get("value").asText(), "/");
+ waPrefix = Strings.CS.removeEnd(prefix.get("value").asString(), "/");
}
}
}
diff --git a/client/am/console/src/main/java/org/apache/syncope/client/console/panels/OIDC.java b/client/am/console/src/main/java/org/apache/syncope/client/console/panels/OIDC.java
index b71c26bf7a5..5e0bbb6a72c 100644
--- a/client/am/console/src/main/java/org/apache/syncope/client/console/panels/OIDC.java
+++ b/client/am/console/src/main/java/org/apache/syncope/client/console/panels/OIDC.java
@@ -18,9 +18,7 @@
*/
package org.apache.syncope.client.console.panels;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
-import java.io.IOException;
import java.util.Optional;
import org.apache.commons.lang3.mutable.Mutable;
import org.apache.syncope.client.console.SyncopeConsoleSession;
@@ -44,6 +42,8 @@
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import tools.jackson.core.JacksonException;
+import tools.jackson.databind.json.JsonMapper;
public class OIDC extends Panel {
@@ -101,7 +101,7 @@ public void onClick(final AjaxRequestTarget target) {
try {
pretty = MAPPER.writerWithDefaultPrettyPrinter().
writeValueAsString(MAPPER.readTree(oidcjwksto.get().getJson()));
- } catch (IOException e) {
+ } catch (JacksonException e) {
LOG.error("Could not pretty-print", e);
pretty = Optional.ofNullable(oidcjwksto.get()).map(OIDCJWKSTO::getJson).orElse(null);
}
diff --git a/client/am/console/src/main/java/org/apache/syncope/client/console/rest/AMSessionDeserializer.java b/client/am/console/src/main/java/org/apache/syncope/client/console/rest/AMSessionDeserializer.java
index 7444b2d82e4..59bba0a39f6 100644
--- a/client/am/console/src/main/java/org/apache/syncope/client/console/rest/AMSessionDeserializer.java
+++ b/client/am/console/src/main/java/org/apache/syncope/client/console/rest/AMSessionDeserializer.java
@@ -18,26 +18,28 @@
*/
package org.apache.syncope.client.console.rest;
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import java.io.IOException;
import java.io.StringWriter;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import org.apache.syncope.common.lib.AMSession;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import tools.jackson.core.JacksonException;
+import tools.jackson.core.JsonParser;
+import tools.jackson.core.exc.JacksonIOException;
+import tools.jackson.databind.DeserializationContext;
+import tools.jackson.databind.JsonNode;
+import tools.jackson.databind.deser.std.StdDeserializer;
+import tools.jackson.databind.json.JsonMapper;
public class AMSessionDeserializer extends StdDeserializer {
- private static final long serialVersionUID = 24527200564172L;
+ protected static final Logger LOG = LoggerFactory.getLogger(AMSessionDeserializer.class);
- private static final Logger LOG = LoggerFactory.getLogger(AMSessionDeserializer.class);
+ protected static final JsonMapper MAPPER = new SyncopeJsonMapper();
public AMSessionDeserializer() {
this(null);
@@ -48,15 +50,13 @@ public AMSessionDeserializer(final Class> vc) {
}
@Override
- public AMSession deserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- JsonNode node = jp.getCodec().readTree(jp);
+ public AMSession deserialize(final JsonParser jp, final DeserializationContext ctxt) throws JacksonException {
+ JsonNode node = jp.readValueAsTree();
AMSession waSession = new AMSession();
if (node.has("authentication_date_formatted")) {
- String authenticationDate = node.get("authentication_date_formatted").textValue();
+ String authenticationDate = node.get("authentication_date_formatted").stringValue();
try {
waSession.setAuthenticationDate(
OffsetDateTime.parse(authenticationDate, DateTimeFormatter.ISO_OFFSET_DATE_TIME));
@@ -66,18 +66,19 @@ public AMSession deserialize(final JsonParser jp, final DeserializationContext c
}
if (node.has("authenticated_principal")) {
- waSession.setPrincipal(node.get("authenticated_principal").textValue());
+ waSession.setPrincipal(node.get("authenticated_principal").stringValue());
}
if (node.has("ticket_granting_ticket")) {
- waSession.setKey(node.get("ticket_granting_ticket").textValue());
+ waSession.setKey(node.get("ticket_granting_ticket").stringValue());
}
- StringWriter writer = new StringWriter();
- JsonGenerator jgen = jp.getCodec().getFactory().createGenerator(writer);
- jgen.setPrettyPrinter(new DefaultPrettyPrinter());
- jp.getCodec().writeTree(jgen, node);
- waSession.setJson(writer.toString());
+ try (StringWriter writer = new StringWriter()) {
+ MAPPER.writerWithDefaultPrettyPrinter().writeValue(writer, node);
+ waSession.setJson(writer.toString());
+ } catch (IOException e) {
+ throw JacksonIOException.construct(e);
+ }
return waSession;
}
diff --git a/client/am/console/src/main/java/org/apache/syncope/client/console/rest/AMSessionRestClient.java b/client/am/console/src/main/java/org/apache/syncope/client/console/rest/AMSessionRestClient.java
index 47e66bd29fe..e4051ac9496 100644
--- a/client/am/console/src/main/java/org/apache/syncope/client/console/rest/AMSessionRestClient.java
+++ b/client/am/console/src/main/java/org/apache/syncope/client/console/rest/AMSessionRestClient.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.client.console.rest;
-import com.fasterxml.jackson.databind.json.JsonMapper;
-import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import java.util.List;
@@ -29,9 +27,11 @@
import org.apache.syncope.common.keymaster.client.api.model.NetworkService;
import org.apache.syncope.common.lib.AMSession;
import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.apache.syncope.common.lib.types.ClientExceptionType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import tools.jackson.jakarta.rs.json.JacksonJsonProvider;
public abstract class AMSessionRestClient implements RestClient {
@@ -39,8 +39,7 @@ public abstract class AMSessionRestClient implements RestClient {
protected static final Logger LOG = LoggerFactory.getLogger(AMSessionRestClient.class);
- protected static final List> JAX_RS_PROVIDERS =
- List.of(new JacksonJsonProvider(JsonMapper.builder().findAndAddModules().build()));
+ protected static final List> JAX_RS_PROVIDERS = List.of(new JacksonJsonProvider(new SyncopeJsonMapper()));
protected final List instances;
diff --git a/client/am/console/src/main/java/org/apache/syncope/client/console/rest/SRAStatisticsRestClient.java b/client/am/console/src/main/java/org/apache/syncope/client/console/rest/SRAStatisticsRestClient.java
index 6bf529856ba..829def79f0d 100644
--- a/client/am/console/src/main/java/org/apache/syncope/client/console/rest/SRAStatisticsRestClient.java
+++ b/client/am/console/src/main/java/org/apache/syncope/client/console/rest/SRAStatisticsRestClient.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.client.console.rest;
-import com.fasterxml.jackson.databind.json.JsonMapper;
-import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import java.util.List;
@@ -29,6 +27,8 @@
import org.apache.syncope.common.keymaster.client.api.model.NetworkService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import tools.jackson.databind.json.JsonMapper;
+import tools.jackson.jakarta.rs.json.JacksonJsonProvider;
public final class SRAStatisticsRestClient {
diff --git a/client/am/console/src/main/java/org/apache/syncope/client/console/rest/WASessionRestClient.java b/client/am/console/src/main/java/org/apache/syncope/client/console/rest/WASessionRestClient.java
index 782c729168b..6fe51783628 100644
--- a/client/am/console/src/main/java/org/apache/syncope/client/console/rest/WASessionRestClient.java
+++ b/client/am/console/src/main/java/org/apache/syncope/client/console/rest/WASessionRestClient.java
@@ -18,10 +18,6 @@
*/
package org.apache.syncope.client.console.rest;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.json.JsonMapper;
-import com.fasterxml.jackson.databind.module.SimpleModule;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import java.io.InputStream;
@@ -30,13 +26,20 @@
import org.apache.syncope.client.console.SyncopeWebApplication;
import org.apache.syncope.common.keymaster.client.api.model.NetworkService;
import org.apache.syncope.common.lib.AMSession;
+import tools.jackson.core.type.TypeReference;
+import tools.jackson.databind.JsonNode;
+import tools.jackson.databind.MapperFeature;
+import tools.jackson.databind.json.JsonMapper;
+import tools.jackson.databind.module.SimpleModule;
public final class WASessionRestClient extends AMSessionRestClient {
private static final long serialVersionUID = 22118820292494L;
protected static final JsonMapper MAPPER = JsonMapper.builder().
- addModule(new SimpleModule().addDeserializer(AMSession.class, new AMSessionDeserializer())).build();
+ addModule(new SimpleModule().addDeserializer(AMSession.class, new AMSessionDeserializer())).
+ enable(MapperFeature.USE_GETTERS_AS_SETTERS).
+ build();
public WASessionRestClient(final List instances) {
super(instances);
diff --git a/client/am/enduser/pom.xml b/client/am/enduser/pom.xml
index 3d9efa6b042..3628b92cec5 100644
--- a/client/am/enduser/pom.xml
+++ b/client/am/enduser/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.client
syncope-client-am
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Client AM Enduser
diff --git a/client/am/lib/pom.xml b/client/am/lib/pom.xml
index 4b71908028d..242d08c2716 100644
--- a/client/am/lib/pom.xml
+++ b/client/am/lib/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.client
syncope-client-am
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Client AM Lib
diff --git a/client/am/pom.xml b/client/am/pom.xml
index b7386df99fc..930d4e082d4 100644
--- a/client/am/pom.xml
+++ b/client/am/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope
syncope-client
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Client AM
diff --git a/client/idm/console/pom.xml b/client/idm/console/pom.xml
index 7ef9fbc2224..add44d1de73 100644
--- a/client/idm/console/pom.xml
+++ b/client/idm/console/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.client
syncope-client-idm
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Client IdM Console
diff --git a/client/idm/console/src/main/java/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel.java b/client/idm/console/src/main/java/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel.java
index 9b4915eebea..0e609842bda 100644
--- a/client/idm/console/src/main/java/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel.java
+++ b/client/idm/console/src/main/java/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel.java
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.client.console.policies;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
@@ -42,6 +41,7 @@
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxDropDownChoicePanel;
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxPalettePanel;
import org.apache.syncope.client.ui.commons.pages.BaseWebPage;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.apache.syncope.common.lib.policy.AbstractCorrelationRuleConf;
import org.apache.syncope.common.lib.policy.DefaultInboundCorrelationRuleConf;
import org.apache.syncope.common.lib.policy.DefaultPushCorrelationRuleConf;
@@ -64,12 +64,13 @@
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.spring.injection.annot.SpringBean;
+import tools.jackson.databind.json.JsonMapper;
public class ProvisioningPolicyModalPanel extends AbstractModalPanel {
private static final long serialVersionUID = 2988891313881271124L;
- protected static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build();
+ protected static final JsonMapper MAPPER = new SyncopeJsonMapper();
@SpringBean
protected ImplementationRestClient implementationRestClient;
diff --git a/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java b/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java
index 1a775d6994d..5802d0fd3cf 100644
--- a/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java
+++ b/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.client.console.topology;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
import java.io.Serializable;
import java.text.MessageFormat;
@@ -44,6 +43,7 @@
import org.apache.syncope.client.ui.commons.pages.BaseWebPage;
import org.apache.syncope.client.ui.commons.wizards.AjaxWizard;
import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.apache.syncope.common.lib.to.ConnInstanceTO;
import org.apache.syncope.common.lib.to.ResourceTO;
import org.apache.syncope.common.lib.types.IdMEntitlement;
@@ -63,12 +63,13 @@
import org.apache.wicket.model.Model;
import org.apache.wicket.model.StringResourceModel;
import org.apache.wicket.spring.injection.annot.SpringBean;
+import tools.jackson.databind.json.JsonMapper;
public class TopologyTogglePanel extends TogglePanel {
private static final long serialVersionUID = -2025535531121434056L;
- protected static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build();
+ protected static final JsonMapper MAPPER = new SyncopeJsonMapper();
@SpringBean
protected ConnectorRestClient connectorRestClient;
diff --git a/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyWebSocketBehavior.java b/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyWebSocketBehavior.java
index 1c81d023b6d..09d346bcdc9 100644
--- a/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyWebSocketBehavior.java
+++ b/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyWebSocketBehavior.java
@@ -18,9 +18,6 @@
*/
package org.apache.syncope.client.console.topology;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.json.JsonMapper;
-import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -37,6 +34,7 @@
import org.apache.syncope.common.keymaster.client.api.ConfParamOps;
import org.apache.syncope.common.keymaster.client.api.ServiceOps;
import org.apache.syncope.common.keymaster.client.api.model.NetworkService;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.apache.wicket.protocol.ws.api.WebSocketBehavior;
import org.apache.wicket.protocol.ws.api.WebSocketRequestHandler;
import org.apache.wicket.protocol.ws.api.message.TextMessage;
@@ -44,6 +42,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.task.SimpleAsyncTaskExecutor;
+import tools.jackson.core.JacksonException;
+import tools.jackson.databind.JsonNode;
+import tools.jackson.databind.json.JsonMapper;
public class TopologyWebSocketBehavior extends WebSocketBehavior {
@@ -51,7 +52,7 @@ public class TopologyWebSocketBehavior extends WebSocketBehavior {
protected static final Logger LOG = LoggerFactory.getLogger(TopologyWebSocketBehavior.class);
- protected static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build();
+ protected static final JsonMapper MAPPER = new SyncopeJsonMapper();
protected static final String CONNECTOR_TEST_TIMEOUT_PARAMETER = "connector.test.timeout";
@@ -140,9 +141,9 @@ protected void timeoutHandlingConnectionChecker(
protected void onMessage(final WebSocketRequestHandler handler, final TextMessage message) {
try {
JsonNode obj = MAPPER.readTree(message.getText());
- switch (Topology.SupportedOperation.valueOf(obj.get("kind").asText())) {
+ switch (Topology.SupportedOperation.valueOf(obj.get("kind").asString())) {
case CHECK_CONNECTOR:
- String ckey = obj.get("target").asText();
+ String ckey = obj.get("target").asString();
if (connectors.containsKey(ckey)) {
handler.push(connectors.get(ckey));
@@ -166,7 +167,7 @@ protected void onMessage(final WebSocketRequestHandler handler, final TextMessag
break;
case CHECK_RESOURCE:
- String rkey = obj.get("target").asText();
+ String rkey = obj.get("target").asString();
if (resources.containsKey(rkey)) {
handler.push(resources.get(rkey));
@@ -191,14 +192,14 @@ protected void onMessage(final WebSocketRequestHandler handler, final TextMessag
case ADD_ENDPOINT:
handler.appendJavaScript(String.format("addEndpoint('%s', '%s', '%s');",
- obj.get("source").asText(),
- obj.get("target").asText(),
- obj.get("scope").asText()));
+ obj.get("source").asString(),
+ obj.get("target").asString(),
+ obj.get("scope").asString()));
break;
default:
}
- } catch (IOException e) {
+ } catch (JacksonException e) {
LOG.error("Error managing websocket message", e);
}
}
diff --git a/client/idm/console/src/main/java/org/apache/syncope/client/console/wizards/any/MergeLinkedAccountsWizardBuilder.java b/client/idm/console/src/main/java/org/apache/syncope/client/console/wizards/any/MergeLinkedAccountsWizardBuilder.java
index 453fde65d61..abf300d3da5 100644
--- a/client/idm/console/src/main/java/org/apache/syncope/client/console/wizards/any/MergeLinkedAccountsWizardBuilder.java
+++ b/client/idm/console/src/main/java/org/apache/syncope/client/console/wizards/any/MergeLinkedAccountsWizardBuilder.java
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.client.console.wizards.any;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import jakarta.ws.rs.HttpMethod;
import jakarta.ws.rs.core.HttpHeaders;
import jakarta.ws.rs.core.MediaType;
@@ -36,6 +35,7 @@
import org.apache.syncope.client.lib.batch.BatchRequest;
import org.apache.syncope.client.ui.commons.Constants;
import org.apache.syncope.client.ui.commons.wizards.AjaxWizard;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.apache.syncope.common.lib.request.LinkedAccountUR;
import org.apache.syncope.common.lib.request.UserUR;
import org.apache.syncope.common.lib.to.LinkedAccountTO;
@@ -50,12 +50,13 @@
import org.apache.wicket.event.IEventSink;
import org.apache.wicket.extensions.wizard.WizardModel;
import org.apache.wicket.model.IModel;
+import tools.jackson.databind.json.JsonMapper;
public class MergeLinkedAccountsWizardBuilder extends BaseAjaxWizardBuilder implements IEventSink {
private static final long serialVersionUID = -9142332740863374891L;
- protected static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build();
+ protected static final JsonMapper MAPPER = new SyncopeJsonMapper();
protected final UserDirectoryPanel parentPanel;
diff --git a/client/idm/lib/pom.xml b/client/idm/lib/pom.xml
index 40584b153cf..e188de05003 100644
--- a/client/idm/lib/pom.xml
+++ b/client/idm/lib/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.client
syncope-client-idm
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Client IdM Lib
diff --git a/client/idm/pom.xml b/client/idm/pom.xml
index ad9b78f41b5..82ce90f8d07 100644
--- a/client/idm/pom.xml
+++ b/client/idm/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope
syncope-client
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Client IdM
diff --git a/client/idrepo/common-ui/pom.xml b/client/idrepo/common-ui/pom.xml
index 3532795ff2e..d44dbc287c4 100644
--- a/client/idrepo/common-ui/pom.xml
+++ b/client/idrepo/common-ui/pom.xml
@@ -22,7 +22,7 @@ under the License.
org.apache.syncope.client
syncope-client-idrepo
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Client IdRepo Common UI
@@ -38,7 +38,7 @@ under the License.
org.springframework.boot
- spring-boot-actuator
+ spring-boot-health
org.springframework.boot
diff --git a/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/MIMETypesLoader.java b/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/MIMETypesLoader.java
index a41082b611a..ee34c0de2af 100644
--- a/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/MIMETypesLoader.java
+++ b/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/MIMETypesLoader.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.client.ui.commons;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
@@ -29,6 +27,8 @@
import org.apache.wicket.util.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import tools.jackson.databind.JsonNode;
+import tools.jackson.databind.json.JsonMapper;
public class MIMETypesLoader implements Serializable {
@@ -50,7 +50,7 @@ public void load() {
JsonNode type = node.path("name");
JsonNode ext = node.path("extension");
if (!type.isMissingNode()) {
- mimeTypesMap.put(type.asText(), ext.isMissingNode() ? "" : ext.asText());
+ mimeTypesMap.put(type.asString(), ext.isMissingNode() ? "" : ext.asString());
}
}
diff --git a/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/actuate/SyncopeCoreHealthIndicator.java b/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/actuate/SyncopeCoreHealthIndicator.java
index b340bcb4201..7624d612bfa 100644
--- a/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/actuate/SyncopeCoreHealthIndicator.java
+++ b/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/actuate/SyncopeCoreHealthIndicator.java
@@ -25,9 +25,9 @@
import org.apache.syncope.common.rest.api.service.UserSelfService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.boot.actuate.health.Health;
-import org.springframework.boot.actuate.health.HealthIndicator;
-import org.springframework.boot.actuate.health.Status;
+import org.springframework.boot.health.contributor.Health;
+import org.springframework.boot.health.contributor.HealthIndicator;
+import org.springframework.boot.health.contributor.Status;
public class SyncopeCoreHealthIndicator implements HealthIndicator {
diff --git a/client/idrepo/console/pom.xml b/client/idrepo/console/pom.xml
index 380927752f2..b27388e2e36 100644
--- a/client/idrepo/console/pom.xml
+++ b/client/idrepo/console/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.client
syncope-client-idrepo
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Client IdRepo Console
@@ -49,11 +49,6 @@ under the License.
wicket-spring-boot-starter
-
- org.springframework.boot
- spring-boot-starter-actuator
-
-
org.springframework.boot
spring-boot-starter-security
@@ -144,6 +139,11 @@ under the License.
disruptor
+
+ org.slf4j
+ jcl-over-slf4j
+
+
org.apache.wicket
wicket-tester
diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/PreferenceManager.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/PreferenceManager.java
index 3624b6e34e5..683c1914c20 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/PreferenceManager.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/PreferenceManager.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.client.console;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import java.io.IOException;
import java.io.Serializable;
import java.io.StringWriter;
@@ -30,10 +28,13 @@
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.apache.wicket.util.cookies.CookieDefaults;
import org.apache.wicket.util.cookies.CookieUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import tools.jackson.core.type.TypeReference;
+import tools.jackson.databind.json.JsonMapper;
public final class PreferenceManager implements Serializable {
@@ -45,7 +46,7 @@ public final class PreferenceManager implements Serializable {
private static final int ONE_YEAR_TIME = 60 * 60 * 24 * 365;
- private static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build();
+ private static final JsonMapper MAPPER = new SyncopeJsonMapper();
private static final TypeReference
-
- org.springframework.boot
- spring-boot-starter-actuator
-
org.springframework.boot
spring-boot-starter-security
@@ -102,6 +98,11 @@ under the License.
disruptor
+
+ org.slf4j
+ jcl-over-slf4j
+
+
org.apache.wicket
wicket-tester
diff --git a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/PreferenceManager.java b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/PreferenceManager.java
index 36282f2e78b..8f5b5b0ea9d 100644
--- a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/PreferenceManager.java
+++ b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/PreferenceManager.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.client.enduser;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import java.io.IOException;
import java.io.Serializable;
import java.io.StringWriter;
@@ -31,10 +29,13 @@
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.apache.wicket.util.cookies.CookieDefaults;
import org.apache.wicket.util.cookies.CookieUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import tools.jackson.core.type.TypeReference;
+import tools.jackson.databind.json.JsonMapper;
public final class PreferenceManager implements Serializable {
@@ -46,7 +47,7 @@ public final class PreferenceManager implements Serializable {
private static final int ONE_YEAR_TIME = 60 * 60 * 24 * 365;
- private static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build();
+ private static final JsonMapper MAPPER = new SyncopeJsonMapper();
private static final TypeReference
- com.fasterxml.jackson.jakarta.rs
+ tools.jackson.jakarta.rs
jackson-jakarta-rs-json-provider
diff --git a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/RestClientExceptionMapper.java b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/RestClientExceptionMapper.java
index 8eb11728ad7..738fe2e7489 100644
--- a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/RestClientExceptionMapper.java
+++ b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/RestClientExceptionMapper.java
@@ -94,13 +94,11 @@ public Exception fromResponse(final Response response) {
}
private static SyncopeClientCompositeException checkSyncopeClientCompositeException(final Response response) {
- SyncopeClientCompositeException compException = SyncopeClientException.buildComposite();
-
// Attempts to read ErrorTO or List as entity...
List errors = null;
try {
ErrorTO error = response.readEntity(ErrorTO.class);
- if (error != null) {
+ if (error != null && error.getType() != null) {
errors = List.of(error);
}
} catch (Exception e) {
@@ -116,6 +114,7 @@ private static SyncopeClientCompositeException checkSyncopeClientCompositeExcept
}
// ...if not possible, attempts to parse response headers
+ SyncopeClientCompositeException compException = SyncopeClientException.buildComposite();
if (errors == null) {
List exTypesInHeaders = response.getStringHeaders().get(RESTHeaders.ERROR_CODE);
if (exTypesInHeaders == null) {
diff --git a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeAnonymousClient.java b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeAnonymousClient.java
index c703687722d..5382f13af3e 100644
--- a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeAnonymousClient.java
+++ b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeAnonymousClient.java
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.client.lib;
-import com.fasterxml.jackson.databind.JsonNode;
import jakarta.ws.rs.core.HttpHeaders;
import jakarta.ws.rs.core.MediaType;
import java.io.IOException;
@@ -35,6 +34,7 @@
import org.apache.syncope.common.lib.info.PlatformInfo;
import org.apache.syncope.common.lib.info.SystemInfo;
import org.apache.syncope.common.rest.api.RESTHeaders;
+import tools.jackson.databind.JsonNode;
public class SyncopeAnonymousClient extends SyncopeClient {
@@ -74,9 +74,9 @@ public Pair gitAndBuildInfo() {
JsonNode info = info();
return Pair.of(
info.has("git") && info.get("git").has("commit") && info.get("git").get("commit").has("id")
- ? info.get("git").get("commit").get("id").asText()
+ ? info.get("git").get("commit").get("id").asString()
: StringUtils.EMPTY,
- info.get("build").get("version").asText());
+ info.get("build").get("version").asString());
} catch (IOException e) {
throw new RuntimeException("While getting build and git Info", e);
}
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 2b88c481f48..1d4b5300598 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
@@ -18,13 +18,10 @@
*/
package org.apache.syncope.client.lib;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import jakarta.ws.rs.core.EntityTag;
import jakarta.ws.rs.core.HttpHeaders;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
-import java.io.IOException;
import java.io.Serializable;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
@@ -59,6 +56,9 @@
import org.apache.syncope.common.rest.api.service.UserSelfService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import tools.jackson.core.type.TypeReference;
+import tools.jackson.databind.MapperFeature;
+import tools.jackson.databind.json.JsonMapper;
/**
* Entry point for client access to all REST services exposed by Syncope core; obtain instances via
@@ -214,7 +214,8 @@ public static EntityTag getLatestEntityTag(final T service) {
protected static final String HEADER_SPLIT_PROPERTY = "org.apache.cxf.http.header.split";
- protected static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build();
+ protected static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().
+ enable(MapperFeature.USE_GETTERS_AS_SETTERS).build();
protected final JAXRSClientFactoryBean restClientFactory;
@@ -442,7 +443,7 @@ public Self self() {
MAPPER.readValue(
response.getHeaderString(RESTHeaders.DELEGATIONS), new TypeReference<>() {
}));
- } catch (IOException e) {
+ } catch (Exception e) {
throw new IllegalStateException(e);
}
}
diff --git a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClientFactoryBean.java b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClientFactoryBean.java
index a1b45d92d9e..21ce8214f3d 100644
--- a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClientFactoryBean.java
+++ b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClientFactoryBean.java
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.client.lib;
-import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
@@ -31,6 +30,7 @@
import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.apache.syncope.common.rest.api.DateParamConverterProvider;
import org.apache.syncope.common.rest.api.RESTHeaders;
+import tools.jackson.jakarta.rs.json.JacksonJsonProvider;
/**
* Factory bean for creating instances of {@link SyncopeClient}.
diff --git a/client/idrepo/pom.xml b/client/idrepo/pom.xml
index fb6ecc8daca..68ec9dcdf0e 100644
--- a/client/idrepo/pom.xml
+++ b/client/idrepo/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope
syncope-client
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Client IdRepo
diff --git a/client/pom.xml b/client/pom.xml
index 97ed61e3517..23a878963ff 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope
syncope
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Client
diff --git a/common/am/lib/pom.xml b/common/am/lib/pom.xml
index b446b45d44c..9efe89b6ac0 100644
--- a/common/am/lib/pom.xml
+++ b/common/am/lib/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.common
syncope-common-am
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Common AM Lib
diff --git a/common/am/lib/src/test/java/org/apache/syncope/common/lib/SerializationTest.java b/common/am/lib/src/test/java/org/apache/syncope/common/lib/SerializationTest.java
index b6df7e58494..715447ecf02 100644
--- a/common/am/lib/src/test/java/org/apache/syncope/common/lib/SerializationTest.java
+++ b/common/am/lib/src/test/java/org/apache/syncope/common/lib/SerializationTest.java
@@ -20,7 +20,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import java.io.IOException;
import java.io.StringWriter;
import java.net.URI;
@@ -28,6 +27,7 @@
import org.apache.syncope.common.lib.policy.AccessPolicyTO;
import org.apache.syncope.common.lib.policy.DefaultAccessPolicyConf;
import org.junit.jupiter.api.Test;
+import tools.jackson.databind.json.JsonMapper;
public class SerializationTest {
diff --git a/common/am/pom.xml b/common/am/pom.xml
index 80074191a01..95ec6604e4d 100644
--- a/common/am/pom.xml
+++ b/common/am/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope
syncope-common
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Common AM
diff --git a/common/am/rest-api/pom.xml b/common/am/rest-api/pom.xml
index 9d09c294911..398102e3ba9 100644
--- a/common/am/rest-api/pom.xml
+++ b/common/am/rest-api/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.common
syncope-common-am
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Common AM REST API
diff --git a/common/idm/lib/pom.xml b/common/idm/lib/pom.xml
index 040a51929ec..4953618bc2d 100644
--- a/common/idm/lib/pom.xml
+++ b/common/idm/lib/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.common
syncope-common-idm
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Common IdM Lib
diff --git a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/ConnInstanceTO.java b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/ConnInstanceTO.java
index d1519adc964..a937cf02ca6 100644
--- a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/ConnInstanceTO.java
+++ b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/ConnInstanceTO.java
@@ -121,7 +121,7 @@ public void setVersion(final String version) {
}
public List getConf() {
- return this.conf;
+ return conf;
}
@JsonIgnore
diff --git a/common/idm/pom.xml b/common/idm/pom.xml
index c740e834128..8946a5e6d21 100644
--- a/common/idm/pom.xml
+++ b/common/idm/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope
syncope-common
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Common IdM
diff --git a/common/idm/rest-api/pom.xml b/common/idm/rest-api/pom.xml
index 92645988109..93f62018083 100644
--- a/common/idm/rest-api/pom.xml
+++ b/common/idm/rest-api/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.common
syncope-common-idm
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Common IdM REST API
diff --git a/common/idrepo/lib/pom.xml b/common/idrepo/lib/pom.xml
index a0d6b4ddaf2..43e13f23905 100644
--- a/common/idrepo/lib/pom.xml
+++ b/common/idrepo/lib/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.common
syncope-common-idrepo
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Common IdRepo Lib
@@ -53,12 +53,8 @@ under the License.
- com.fasterxml.jackson.core
- jackson-annotations
-
-
- com.fasterxml.jackson.datatype
- jackson-datatype-jsr310
+ tools.jackson.core
+ jackson-databind
diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/jackson/SyncopeJsonMapper.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/jackson/SyncopeJsonMapper.java
index ef7d5525ec9..e5840503fae 100644
--- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/jackson/SyncopeJsonMapper.java
+++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/jackson/SyncopeJsonMapper.java
@@ -18,15 +18,17 @@
*/
package org.apache.syncope.common.lib.jackson;
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import com.fasterxml.jackson.databind.json.JsonMapper;
+import java.io.DataOutput;
import java.io.File;
-import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
+import java.nio.file.Path;
import java.util.Map;
+import tools.jackson.core.JacksonException;
+import tools.jackson.core.JsonGenerator;
+import tools.jackson.databind.MapperFeature;
+import tools.jackson.databind.json.JsonMapper;
+import tools.jackson.databind.util.TokenBuffer;
/**
* Jackson ObjectMapper that unwraps singleton map values and enable default
@@ -37,11 +39,7 @@ public class SyncopeJsonMapper extends JsonMapper {
private static final long serialVersionUID = -317191546835195103L;
public SyncopeJsonMapper() {
- super();
-
- findAndRegisterModules();
-
- configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
+ super(JsonMapper.builder().findAndAddModules().enable(MapperFeature.USE_GETTERS_AS_SETTERS));
}
/**
@@ -62,32 +60,47 @@ protected Object unwrapMap(final Object value) {
}
@Override
- public void writeValue(final JsonGenerator jgen, final Object value) throws IOException {
+ public void writeValue(final DataOutput out, final Object value) throws JacksonException {
+ super.writeValue(out, unwrapMap(value));
+ }
+
+ @Override
+ public void writeValue(final Path path, final Object value) throws JacksonException {
+ super.writeValue(path, unwrapMap(value));
+ }
+
+ @Override
+ public TokenBuffer writeValueIntoBuffer(final Object value) throws JacksonException {
+ return super.writeValueIntoBuffer(unwrapMap(value));
+ }
+
+ @Override
+ public void writeValue(final JsonGenerator jgen, final Object value) throws JacksonException {
super.writeValue(jgen, unwrapMap(value));
}
@Override
- public void writeValue(final File resultFile, final Object value) throws IOException {
+ public void writeValue(final File resultFile, final Object value) throws JacksonException {
super.writeValue(resultFile, unwrapMap(value));
}
@Override
- public void writeValue(final OutputStream out, final Object value) throws IOException {
+ public void writeValue(final OutputStream out, final Object value) throws JacksonException {
super.writeValue(out, unwrapMap(value));
}
@Override
- public void writeValue(final Writer writer, final Object value) throws IOException {
+ public void writeValue(final Writer writer, final Object value) throws JacksonException {
super.writeValue(writer, unwrapMap(value));
}
@Override
- public byte[] writeValueAsBytes(final Object value) throws JsonProcessingException {
+ public byte[] writeValueAsBytes(final Object value) throws JacksonException {
return super.writeValueAsBytes(unwrapMap(value));
}
@Override
- public String writeValueAsString(final Object value) throws JsonProcessingException {
+ public String writeValueAsString(final Object value) throws JacksonException {
return super.writeValueAsString(unwrapMap(value));
}
}
diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/types/EntityViolationType.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/types/EntityViolationType.java
index 439cca4e817..9a9b6676efd 100644
--- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/types/EntityViolationType.java
+++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/types/EntityViolationType.java
@@ -53,24 +53,27 @@ public enum EntityViolationType {
private Object invalidValue;
- public void setMessage(final String message) {
+ public EntityViolationType message(final String message) {
this.message = message;
+ return this;
}
public String getMessage() {
return message;
}
- public String getPropertyPath() {
- return propertyPath;
+ public EntityViolationType propertyPath(final String propertyPath) {
+ this.propertyPath = propertyPath;
+ return this;
}
- public void setPropertyPath(final String propertyPath) {
- this.propertyPath = propertyPath;
+ public String getPropertyPath() {
+ return propertyPath;
}
- public void setInvalidValue(final Object invalidValue) {
+ public EntityViolationType invalidValue(final Object invalidValue) {
this.invalidValue = invalidValue;
+ return this;
}
public Object getInvalidValue() {
diff --git a/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/SerializationTest.java b/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/SerializationTest.java
index bd82ee2b3ff..d962d22cad6 100644
--- a/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/SerializationTest.java
+++ b/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/SerializationTest.java
@@ -21,8 +21,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import java.io.IOException;
import java.io.StringWriter;
import java.util.ArrayList;
@@ -43,6 +41,8 @@
import org.apache.syncope.common.lib.to.ReportTO;
import org.apache.syncope.common.lib.types.PatchOperation;
import org.junit.jupiter.api.Test;
+import tools.jackson.core.type.TypeReference;
+import tools.jackson.databind.json.JsonMapper;
public class SerializationTest {
diff --git a/common/idrepo/pom.xml b/common/idrepo/pom.xml
index 6e43eadef7e..715ef15da01 100644
--- a/common/idrepo/pom.xml
+++ b/common/idrepo/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope
syncope-common
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Common IdRepo
diff --git a/common/idrepo/rest-api/pom.xml b/common/idrepo/rest-api/pom.xml
index 4058f764a1c..0aadfb5fcd6 100644
--- a/common/idrepo/rest-api/pom.xml
+++ b/common/idrepo/rest-api/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.common
syncope-common-idrepo
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Common IdRepo REST API
diff --git a/common/keymaster/client-api/pom.xml b/common/keymaster/client-api/pom.xml
index 153c17c0a44..4b809c6ecaa 100644
--- a/common/keymaster/client-api/pom.xml
+++ b/common/keymaster/client-api/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.common
syncope-common-keymaster
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Common Keymaster Client API
diff --git a/common/keymaster/client-zookeeper/pom.xml b/common/keymaster/client-zookeeper/pom.xml
index 2214108676a..ae49d603546 100644
--- a/common/keymaster/client-zookeeper/pom.xml
+++ b/common/keymaster/client-zookeeper/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.common
syncope-common-keymaster
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Common Keymaster Client Zookeeper
@@ -61,11 +61,6 @@ under the License.
org.springframework.boot
spring-boot-autoconfigure
-
-
- com.fasterxml.jackson.core
- jackson-databind
-
org.apache.curator
diff --git a/common/keymaster/client-zookeeper/src/main/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperConfParamOps.java b/common/keymaster/client-zookeeper/src/main/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperConfParamOps.java
index aca58140c34..61bd7080e2d 100644
--- a/common/keymaster/client-zookeeper/src/main/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperConfParamOps.java
+++ b/common/keymaster/client-zookeeper/src/main/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperConfParamOps.java
@@ -18,16 +18,17 @@
*/
package org.apache.syncope.common.keymaster.client.zookeeper;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import java.util.Map;
import java.util.Optional;
import java.util.TreeMap;
import org.apache.curator.framework.CuratorFramework;
import org.apache.syncope.common.keymaster.client.api.ConfParamOps;
import org.apache.syncope.common.keymaster.client.api.KeymasterException;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.apache.zookeeper.KeeperException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import tools.jackson.databind.json.JsonMapper;
/**
* Implements {@link ConfParamOps} via Apache Curator / Zookeeper.
@@ -36,7 +37,7 @@ public class ZookeeperConfParamOps implements ConfParamOps {
protected static final Logger LOG = LoggerFactory.getLogger(ConfParamOps.class);
- protected static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build();
+ protected static final JsonMapper MAPPER = new SyncopeJsonMapper();
protected static final String CONF_PATH = "/conf";
diff --git a/common/keymaster/client-zookeeper/src/main/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperDomainOps.java b/common/keymaster/client-zookeeper/src/main/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperDomainOps.java
index f6d212d81ca..79726bc4693 100644
--- a/common/keymaster/client-zookeeper/src/main/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperDomainOps.java
+++ b/common/keymaster/client-zookeeper/src/main/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperDomainOps.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.common.keymaster.client.zookeeper;
-import com.fasterxml.jackson.databind.json.JsonMapper;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@@ -33,11 +31,13 @@
import org.apache.syncope.common.keymaster.client.api.model.JPADomain;
import org.apache.syncope.common.keymaster.client.api.model.Neo4jDomain;
import org.apache.syncope.common.lib.SyncopeConstants;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.apache.syncope.common.lib.types.CipherAlgorithm;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
+import tools.jackson.databind.json.JsonMapper;
/**
* Implements {@link DomainOps} via Apache Curator / Zookeeper.
@@ -46,7 +46,7 @@ public class ZookeeperDomainOps implements DomainOps, InitializingBean {
protected static final Logger LOG = LoggerFactory.getLogger(DomainOps.class);
- protected static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build();
+ protected static final JsonMapper MAPPER = new SyncopeJsonMapper();
protected static final String DOMAIN_PATH = "/domains";
@@ -86,7 +86,7 @@ public void afterPropertiesSet() throws Exception {
LOG.info("Domain {} created", domain.getKey());
watcher.added(domain);
- } catch (IOException e) {
+ } catch (Exception e) {
LOG.debug("Could not parse {}", new String(newData.getData()), e);
}
}
diff --git a/common/keymaster/client-zookeeper/src/main/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperServiceOps.java b/common/keymaster/client-zookeeper/src/main/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperServiceOps.java
index d6b374005ab..4057e8c667b 100644
--- a/common/keymaster/client-zookeeper/src/main/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperServiceOps.java
+++ b/common/keymaster/client-zookeeper/src/main/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperServiceOps.java
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.common.keymaster.client.zookeeper;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
@@ -27,10 +26,12 @@
import org.apache.syncope.common.keymaster.client.api.KeymasterException;
import org.apache.syncope.common.keymaster.client.api.ServiceOps;
import org.apache.syncope.common.keymaster.client.api.model.NetworkService;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.apache.zookeeper.CreateMode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import tools.jackson.databind.json.JsonMapper;
/**
* Implements {@link ServiceOps} via Apache Curator / Zookeeper.
@@ -39,7 +40,7 @@ public class ZookeeperServiceOps implements ServiceOps {
protected static final Logger LOG = LoggerFactory.getLogger(ServiceOps.class);
- protected static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build();
+ protected static final JsonMapper MAPPER = new SyncopeJsonMapper();
protected static final String SERVICE_PATH = "/services";
diff --git a/common/keymaster/client-zookeeper/src/test/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperDomainOpsITCase.java b/common/keymaster/client-zookeeper/src/test/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperDomainOpsITCase.java
index a3e9af1e90a..b52249e8cec 100644
--- a/common/keymaster/client-zookeeper/src/test/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperDomainOpsITCase.java
+++ b/common/keymaster/client-zookeeper/src/test/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperDomainOpsITCase.java
@@ -51,7 +51,7 @@ public void crud() {
jdbcURL("jdbc:h2:mem:syncopetest;DB_CLOSE_DELAY=-1").
dbUsername("sa").
dbPassword("").
- databasePlatform("org.apache.openjpa.jdbc.sql.H2Dictionary").
+ databasePlatform("org.hibernate.dialect.H2Dialect").
transactionIsolation(JPADomain.TransactionIsolation.TRANSACTION_READ_UNCOMMITTED).
adminPassword("password").
adminCipherAlgorithm(CipherAlgorithm.BCRYPT).
diff --git a/common/keymaster/client-zookeeper/src/test/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperTestContentLoader.java b/common/keymaster/client-zookeeper/src/test/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperTestContentLoader.java
index 36ef717682a..4a6cd85215a 100644
--- a/common/keymaster/client-zookeeper/src/test/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperTestContentLoader.java
+++ b/common/keymaster/client-zookeeper/src/test/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperTestContentLoader.java
@@ -18,17 +18,18 @@
*/
package org.apache.syncope.common.keymaster.client.zookeeper;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import java.util.Map;
import java.util.Optional;
import org.apache.syncope.common.keymaster.client.api.ConfParamOps;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
+import tools.jackson.databind.JsonNode;
+import tools.jackson.databind.json.JsonMapper;
public class ZookeeperTestContentLoader implements InitializingBean {
- private static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build();
+ private static final JsonMapper MAPPER = new SyncopeJsonMapper();
@Autowired
private ConfParamOps confParamOps;
diff --git a/common/keymaster/pom.xml b/common/keymaster/pom.xml
index 1d0b22959ea..9e7bf3c910e 100644
--- a/common/keymaster/pom.xml
+++ b/common/keymaster/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope
syncope-common
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Common Keymaster
diff --git a/common/keymaster/self/client-self/pom.xml b/common/keymaster/self/client-self/pom.xml
index ec2590f4391..db517a37d22 100644
--- a/common/keymaster/self/client-self/pom.xml
+++ b/common/keymaster/self/client-self/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.common.keymaster
syncope-common-keymaster-self
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Common Keymaster Client Self
@@ -64,7 +64,7 @@ under the License.
- com.fasterxml.jackson.jakarta.rs
+ tools.jackson.jakarta.rs
jackson-jakarta-rs-json-provider
diff --git a/common/keymaster/self/client-self/src/main/java/org/apache/syncope/common/keymaster/client/self/SelfKeymasterClientContext.java b/common/keymaster/self/client-self/src/main/java/org/apache/syncope/common/keymaster/client/self/SelfKeymasterClientContext.java
index 3f604bedaf5..a0d5b3c71e0 100644
--- a/common/keymaster/self/client-self/src/main/java/org/apache/syncope/common/keymaster/client/self/SelfKeymasterClientContext.java
+++ b/common/keymaster/self/client-self/src/main/java/org/apache/syncope/common/keymaster/client/self/SelfKeymasterClientContext.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.common.keymaster.client.self;
-import com.fasterxml.jackson.databind.json.JsonMapper;
-import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider;
import java.util.List;
import java.util.regex.Pattern;
import org.apache.cxf.ext.logging.LoggingFeature;
@@ -28,6 +26,7 @@
import org.apache.syncope.common.keymaster.client.api.DomainOps;
import org.apache.syncope.common.keymaster.client.api.KeymasterProperties;
import org.apache.syncope.common.keymaster.client.api.ServiceOps;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
@@ -38,6 +37,7 @@
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.type.AnnotatedTypeMetadata;
+import tools.jackson.jakarta.rs.json.JacksonJsonProvider;
@EnableConfigurationProperties(KeymasterProperties.class)
@Configuration(proxyBeanMethods = false)
@@ -68,7 +68,7 @@ public JAXRSClientFactoryBean selfKeymasterRESTClientFactoryBean(final Keymaster
restClientFactoryBean.setInheritHeaders(true);
restClientFactoryBean.getFeatures().add(new LoggingFeature());
restClientFactoryBean.setProviders(List.of(
- new JacksonJsonProvider(JsonMapper.builder().findAndAddModules().build()),
+ new JacksonJsonProvider(new SyncopeJsonMapper()),
new SelfKeymasterClientExceptionMapper()));
return restClientFactoryBean;
}
diff --git a/common/keymaster/self/client-self/src/main/java/org/apache/syncope/common/keymaster/client/self/SelfKeymasterConfParamOps.java b/common/keymaster/self/client-self/src/main/java/org/apache/syncope/common/keymaster/client/self/SelfKeymasterConfParamOps.java
index b3e5d43f308..644fbb53efa 100644
--- a/common/keymaster/self/client-self/src/main/java/org/apache/syncope/common/keymaster/client/self/SelfKeymasterConfParamOps.java
+++ b/common/keymaster/self/client-self/src/main/java/org/apache/syncope/common/keymaster/client/self/SelfKeymasterConfParamOps.java
@@ -18,26 +18,26 @@
*/
package org.apache.syncope.common.keymaster.client.self;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import jakarta.ws.rs.core.Response;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
-import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
import org.apache.syncope.common.keymaster.client.api.ConfParamOps;
import org.apache.syncope.common.keymaster.client.api.KeymasterException;
import org.apache.syncope.common.keymaster.rest.api.service.ConfParamService;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.apache.syncope.common.rest.api.RESTHeaders;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import tools.jackson.databind.json.JsonMapper;
public class SelfKeymasterConfParamOps extends SelfKeymasterOps implements ConfParamOps {
private static final Logger LOG = LoggerFactory.getLogger(ConfParamOps.class);
- private static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build();
+ private static final JsonMapper MAPPER = new SyncopeJsonMapper();
public SelfKeymasterConfParamOps(final JAXRSClientFactoryBean clientFactory) {
super(clientFactory);
@@ -56,7 +56,7 @@ public T get(final String domain, final String key, final T defaultValue, fi
}
try {
return MAPPER.readValue(response.readEntity(InputStream.class), reference);
- } catch (IOException e) {
+ } catch (Exception e) {
LOG.error("Could not deserialize response", e);
return defaultValue;
}
@@ -73,7 +73,7 @@ public void set(final String domain, final String key, final T value) {
client(ConfParamService.class, Map.of(RESTHeaders.DOMAIN, domain)).
set(key, new ByteArrayInputStream(baos.toByteArray()));
- } catch (IOException e) {
+ } catch (Exception e) {
throw new KeymasterException("Could not serialize " + value, e);
}
}
diff --git a/common/keymaster/self/pom.xml b/common/keymaster/self/pom.xml
index c155f1e8f32..baba298eca0 100644
--- a/common/keymaster/self/pom.xml
+++ b/common/keymaster/self/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.common
syncope-common-keymaster
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Common Keymaster Self
diff --git a/common/keymaster/self/rest-api/pom.xml b/common/keymaster/self/rest-api/pom.xml
index 35bb8047620..814b704fef1 100644
--- a/common/keymaster/self/rest-api/pom.xml
+++ b/common/keymaster/self/rest-api/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.common.keymaster
syncope-common-keymaster-self
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Common Keymaster Self REST API
diff --git a/common/pom.xml b/common/pom.xml
index 62f2733dddf..dd9525928bf 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope
syncope
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Common
diff --git a/core/am/logic/pom.xml b/core/am/logic/pom.xml
index 6093bfc9c77..2ade67d2b3b 100644
--- a/core/am/logic/pom.xml
+++ b/core/am/logic/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.core
syncope-core-am
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Core AM Logic
diff --git a/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/GoogleMfaAuthAccountLogic.java b/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/GoogleMfaAuthAccountLogic.java
index 2877126edd8..2d0e621bd22 100644
--- a/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/GoogleMfaAuthAccountLogic.java
+++ b/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/GoogleMfaAuthAccountLogic.java
@@ -56,7 +56,7 @@ public List list() {
@PreAuthorize("hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
public void delete(final String owner) {
authProfileDAO.findByOwner(owner).ifPresent(profile -> {
- profile.setGoogleMfaAuthAccounts(List.of());
+ profile.getGoogleMfaAuthAccounts().clear();
authProfileDAO.save(profile);
});
}
@@ -66,10 +66,7 @@ public void delete(final long id) {
authProfileDAO.findAll(Pageable.unpaged()).
stream().
filter(Objects::nonNull).
- filter(profile -> profile.
- getGoogleMfaAuthAccounts().
- stream().
- allMatch(acct -> acct.getId() == id)).
+ filter(profile -> profile.getGoogleMfaAuthAccounts().stream().allMatch(acct -> acct.getId() == id)).
findFirst().
ifPresentOrElse(
profile -> {
@@ -85,7 +82,7 @@ public void delete(final long id) {
@PreAuthorize("hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
public void deleteAll() {
authProfileDAO.findAll(Pageable.unpaged()).forEach(profile -> {
- profile.setGoogleMfaAuthAccounts(List.of());
+ profile.getGoogleMfaAuthAccounts().clear();
authProfileDAO.save(profile);
});
}
@@ -94,22 +91,21 @@ public void deleteAll() {
public void create(final GoogleMfaAuthAccount account) {
AuthProfile profile = authProfile(account.getUsername());
- List accounts = profile.getGoogleMfaAuthAccounts();
- accounts.add(account);
- profile.setGoogleMfaAuthAccounts(accounts);
+ profile.getGoogleMfaAuthAccounts().add(account);
authProfileDAO.save(profile);
}
@PreAuthorize("hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
public void update(final GoogleMfaAuthAccount account) {
- AuthProfile authProfile = authProfileDAO.findByOwner(account.getUsername()).
+ AuthProfile profile = authProfileDAO.findByOwner(account.getUsername()).
orElseThrow(() -> new NotFoundException("Could not find account for Owner " + account.getUsername()));
- List accounts = authProfile.getGoogleMfaAuthAccounts();
+ List accounts = profile.getGoogleMfaAuthAccounts();
if (accounts.removeIf(acct -> acct.getId() == account.getId())) {
accounts.add(account);
- authProfile.setGoogleMfaAuthAccounts(accounts);
- authProfileDAO.save(authProfile);
+ profile.getGoogleMfaAuthAccounts().clear();
+ accounts.forEach(profile::add);
+ authProfileDAO.save(profile);
}
}
diff --git a/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/GoogleMfaAuthTokenLogic.java b/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/GoogleMfaAuthTokenLogic.java
index b5a984a5c2a..35b6fd70418 100644
--- a/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/GoogleMfaAuthTokenLogic.java
+++ b/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/GoogleMfaAuthTokenLogic.java
@@ -46,7 +46,8 @@ public GoogleMfaAuthTokenLogic(
protected void removeTokenAndSave(final AuthProfile profile, final Predicate criteria) {
List tokens = profile.getGoogleMfaAuthTokens();
if (tokens.removeIf(criteria)) {
- profile.setGoogleMfaAuthTokens(tokens);
+ profile.getGoogleMfaAuthTokens().clear();
+ tokens.forEach(profile::add);
authProfileDAO.save(profile);
}
}
@@ -66,7 +67,7 @@ public void delete(final String owner, final int otp) {
@PreAuthorize("hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
public void delete(final String owner) {
authProfileDAO.findByOwner(owner).ifPresent(profile -> {
- profile.setGoogleMfaAuthTokens(List.of());
+ profile.getGoogleMfaAuthTokens().clear();
authProfileDAO.save(profile);
});
}
@@ -80,7 +81,7 @@ public void delete(final int otp) {
@PreAuthorize("hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
public void deleteAll() {
authProfileDAO.findAll(Pageable.unpaged()).forEach(profile -> {
- profile.setGoogleMfaAuthTokens(List.of());
+ profile.getGoogleMfaAuthTokens().clear();
authProfileDAO.save(profile);
});
}
@@ -92,7 +93,8 @@ public void store(final String owner, final GoogleMfaAuthToken token) {
List tokens = profile.getGoogleMfaAuthTokens();
tokens.removeIf(t -> t.getOtp() == token.getOtp());
tokens.add(token);
- profile.setGoogleMfaAuthTokens(tokens);
+ profile.getGoogleMfaAuthTokens().clear();
+ tokens.forEach(profile::add);
authProfileDAO.save(profile);
}
@@ -122,6 +124,6 @@ public List list() {
public List read(final String owner) {
return authProfileDAO.findByOwner(owner).
map(AuthProfile::getGoogleMfaAuthTokens).
- orElseGet(List::of);
+ orElseGet(List::of);
}
}
diff --git a/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/ImpersonationLogic.java b/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/ImpersonationLogic.java
index 12e034a71d6..6138d9c7342 100644
--- a/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/ImpersonationLogic.java
+++ b/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/ImpersonationLogic.java
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.core.logic.wa;
-import java.util.ArrayList;
import java.util.List;
import org.apache.syncope.common.lib.types.IdRepoEntitlement;
import org.apache.syncope.common.lib.wa.ImpersonationAccount;
@@ -53,9 +52,7 @@ public void create(final String owner, final ImpersonationAccount account) {
if (profile.getImpersonationAccounts().stream().
noneMatch(acct -> acct.getImpersonated().equalsIgnoreCase(account.getImpersonated()))) {
- List accounts = new ArrayList<>(profile.getImpersonationAccounts());
- accounts.add(account);
- profile.setImpersonationAccounts(accounts);
+ profile.add(account);
}
authProfileDAO.save(profile);
@@ -66,7 +63,8 @@ public void delete(final String owner, final String impersonated) {
authProfileDAO.findByOwner(owner).ifPresent(profile -> {
List accounts = profile.getImpersonationAccounts();
if (accounts.removeIf(acct -> acct.getImpersonated().equalsIgnoreCase(impersonated))) {
- profile.setImpersonationAccounts(accounts);
+ profile.getImpersonationAccounts().clear();
+ accounts.forEach(profile::add);
authProfileDAO.save(profile);
}
});
diff --git a/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/MfaTrusStorageLogic.java b/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/MfaTrusStorageLogic.java
index 78a8280d25c..09ad4e4f78c 100644
--- a/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/MfaTrusStorageLogic.java
+++ b/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/MfaTrusStorageLogic.java
@@ -87,7 +87,7 @@ public Page search(
map(AuthProfile::getMfaTrustedDevices).filter(Objects::nonNull).flatMap(List::stream)
: authProfileDAO.findByOwner(principal).
map(AuthProfile::getMfaTrustedDevices).filter(Objects::nonNull).map(List::stream).
- orElseGet(Stream::empty)).
+ orElseGet(Stream::empty)).
filter(device -> {
EqualsBuilder builder = new EqualsBuilder();
builder.appendSuper(device.getExpirationDate().isAfter(ZonedDateTime.now()));
@@ -123,10 +123,7 @@ public Page search(
@PreAuthorize("hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
public void create(final String owner, final MfaTrustedDevice device) {
AuthProfile profile = authProfile(owner);
-
- List devices = profile.getMfaTrustedDevices();
- devices.add(device);
- profile.setMfaTrustedDevices(devices);
+ profile.add(device);
authProfileDAO.save(profile);
}
@@ -142,7 +139,8 @@ public void delete(final OffsetDateTime expirationDate, final String recordKey)
} else {
devices = List.of();
}
- profile.setMfaTrustedDevices(devices);
+ profile.getMfaTrustedDevices().clear();
+ devices.forEach(profile::add);
authProfileDAO.save(profile);
}
});
diff --git a/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/WebAuthnRegistrationLogic.java b/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/WebAuthnRegistrationLogic.java
index fe6863e69fd..df3a3bce570 100644
--- a/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/WebAuthnRegistrationLogic.java
+++ b/core/am/logic/src/main/java/org/apache/syncope/core/logic/wa/WebAuthnRegistrationLogic.java
@@ -64,7 +64,7 @@ public WebAuthnAccount read(final String owner) {
@PreAuthorize("hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
public void delete(final String owner) {
authProfileDAO.findByOwner(owner).ifPresent(profile -> {
- profile.setWebAuthnDeviceCredentials(List.of());
+ profile.getWebAuthnDeviceCredentials().clear();
authProfileDAO.save(profile);
});
}
@@ -75,7 +75,8 @@ public void delete(final String owner, final String credentialId) {
ifPresent(profile -> {
List credentials = profile.getWebAuthnDeviceCredentials();
if (credentials.removeIf(acct -> acct.getIdentifier().equals(credentialId))) {
- profile.setWebAuthnDeviceCredentials(credentials);
+ profile.getWebAuthnDeviceCredentials().clear();
+ credentials.forEach(profile::add);
authProfileDAO.save(profile);
}
});
@@ -85,14 +86,16 @@ public void delete(final String owner, final String credentialId) {
public void create(final String owner, final WebAuthnAccount account) {
AuthProfile profile = authProfile(owner);
- profile.setWebAuthnDeviceCredentials(account.getCredentials());
+ profile.getWebAuthnDeviceCredentials().clear();
+ account.getCredentials().forEach(profile::add);
authProfileDAO.save(profile);
}
@PreAuthorize("hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
public void update(final String owner, final WebAuthnAccount account) {
authProfileDAO.findByOwner(owner).ifPresent(profile -> {
- profile.setWebAuthnDeviceCredentials(account.getCredentials());
+ profile.getWebAuthnDeviceCredentials().clear();
+ account.getCredentials().forEach(profile::add);
authProfileDAO.save(profile);
});
}
diff --git a/core/am/pom.xml b/core/am/pom.xml
index 7c188c941b7..2556edc1cf0 100644
--- a/core/am/pom.xml
+++ b/core/am/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope
syncope-core
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Core AM
diff --git a/core/am/rest-cxf/pom.xml b/core/am/rest-cxf/pom.xml
index bbd68e590b3..06a54fa30d2 100644
--- a/core/am/rest-cxf/pom.xml
+++ b/core/am/rest-cxf/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.core
syncope-core-am
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Core AM REST CXF
diff --git a/core/idm/logic/pom.xml b/core/idm/logic/pom.xml
index 2bfecadc81c..2ee1cdc6673 100644
--- a/core/idm/logic/pom.xml
+++ b/core/idm/logic/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.core
syncope-core-idm
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Core IdM Logic
@@ -39,7 +39,7 @@ under the License.
- com.fasterxml.jackson.dataformat
+ tools.jackson.dataformat
jackson-dataformat-csv
@@ -87,6 +87,11 @@ under the License.
embedded-postgres
test
+
+ org.slf4j
+ jcl-over-slf4j
+ test
+
org.slf4j
slf4j-simple
@@ -142,13 +147,30 @@ under the License.
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+ true
+
+
+ set-bundles
+ process-test-resources
+
+ copy
+
+
+
+
+
org.apache.maven.plugins
maven-surefire-plugin
+ ${project.build.directory}/test-classes
file:${bundles.directory}/
true
+ slf4j
diff --git a/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ConnectorLogic.java b/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ConnectorLogic.java
index b8cad8e358f..1e3ac5f64f4 100644
--- a/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ConnectorLogic.java
+++ b/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ConnectorLogic.java
@@ -88,7 +88,7 @@ protected void securityChecks(final Set effectiveRealms, final String re
protected ConnInstance doSave(final ConnInstance connInstance) {
ConnInstance merged = connInstanceDAO.save(connInstance);
- merged.getResources().forEach(resource -> {
+ resourceDAO.findByConnInstance(merged.getKey()).forEach(resource -> {
try {
connectorManager.registerConnector(resource);
} catch (NotFoundException e) {
@@ -138,10 +138,11 @@ public ConnInstanceTO delete(final String key) {
connInstance.getAdminRealm().getFullPath());
securityChecks(effectiveRealms, connInstance.getAdminRealm().getFullPath(), connInstance.getKey());
- if (!connInstance.getResources().isEmpty()) {
+ List extends ExternalResource> resources = resourceDAO.findByConnInstance(connInstance.getKey());
+ if (!resources.isEmpty()) {
SyncopeClientException associatedResources = SyncopeClientException.build(
ClientExceptionType.AssociatedResources);
- connInstance.getResources().forEach(resource -> associatedResources.getElements().add(resource.getKey()));
+ resources.forEach(resource -> associatedResources.getElements().add(resource.getKey()));
throw associatedResources;
}
diff --git a/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ReconciliationLogic.java b/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ReconciliationLogic.java
index 68de5c981e8..b819dd0fe90 100644
--- a/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ReconciliationLogic.java
+++ b/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ReconciliationLogic.java
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.core.logic;
-import com.fasterxml.jackson.dataformat.csv.CsvSchema;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Method;
@@ -105,6 +104,7 @@
import org.springframework.data.domain.Pageable;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
+import tools.jackson.dataformat.csv.CsvSchema;
public class ReconciliationLogic extends AbstractTransactionalLogic {
diff --git a/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java b/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java
index c2c683b5ef7..d1064510b34 100644
--- a/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java
+++ b/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java
@@ -132,19 +132,20 @@ public ResourceTO create(final ResourceTO resourceTO) {
throw sce;
}
- ConnInstance connInstance = connInstanceDAO.authFind(resourceTO.getConnector());
- if (connInstance == null) {
- SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidExternalResource);
- sce.getElements().add("Connector " + resourceTO.getConnector());
- throw sce;
- }
+ ConnInstance connInstance = Optional.ofNullable(connInstanceDAO.authFind(resourceTO.getConnector())).
+ orElseThrow(() -> {
+ SyncopeClientException sce = SyncopeClientException.build(
+ ClientExceptionType.InvalidExternalResource);
+ sce.getElements().add("Connector " + resourceTO.getConnector());
+ return sce;
+ });
Set effectiveRealms = RealmUtils.getEffective(
AuthContextUtils.getAuthorizations().get(IdMEntitlement.RESOURCE_CREATE),
connInstance.getAdminRealm().getFullPath());
securityChecks(effectiveRealms, connInstance.getAdminRealm().getFullPath(), null);
- if (resourceDAO.authFind(resourceTO.getKey()) != null) {
+ if (resourceDAO.findById(resourceTO.getKey()).isPresent()) {
throw new DuplicateException(resourceTO.getKey());
}
@@ -169,14 +170,7 @@ public void setLatestSyncToken(final String key, final String anyTypeKey) {
ExternalResource resource = Optional.ofNullable(resourceDAO.authFind(key)).
orElseThrow(() -> new NotFoundException("Resource '" + key + '\''));
- Connector connector;
- try {
- connector = connectorManager.getConnector(resource);
- } catch (Exception e) {
- SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidConnInstance);
- sce.getElements().add(e.getMessage());
- throw sce;
- }
+ Connector connector = connectorManager.getConnector(resource);
if (SyncopeConstants.REALM_ANYTYPE.equals(anyTypeKey)) {
if (resource.getOrgUnit() == null) {
diff --git a/core/idm/logic/src/test/java/org/apache/syncope/core/logic/ReconciliationLogicTest.java b/core/idm/logic/src/test/java/org/apache/syncope/core/logic/ReconciliationLogicTest.java
index 6285867dfb2..04bb0acf608 100644
--- a/core/idm/logic/src/test/java/org/apache/syncope/core/logic/ReconciliationLogicTest.java
+++ b/core/idm/logic/src/test/java/org/apache/syncope/core/logic/ReconciliationLogicTest.java
@@ -23,9 +23,6 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
-import com.fasterxml.jackson.databind.MappingIterator;
-import com.fasterxml.jackson.dataformat.csv.CsvMapper;
-import com.fasterxml.jackson.dataformat.csv.CsvSchema;
import java.io.IOException;
import java.io.InputStream;
import java.io.PipedInputStream;
@@ -45,6 +42,9 @@
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.transaction.annotation.Transactional;
+import tools.jackson.databind.MappingIterator;
+import tools.jackson.dataformat.csv.CsvMapper;
+import tools.jackson.dataformat.csv.CsvSchema;
@Transactional
public class ReconciliationLogicTest extends AbstractTest {
diff --git a/core/idm/pom.xml b/core/idm/pom.xml
index a34fb442779..af5738b9742 100644
--- a/core/idm/pom.xml
+++ b/core/idm/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope
syncope-core
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Core IdM
diff --git a/core/idm/rest-cxf/pom.xml b/core/idm/rest-cxf/pom.xml
index 81b8107011a..481e2a299b8 100644
--- a/core/idm/rest-cxf/pom.xml
+++ b/core/idm/rest-cxf/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.core
syncope-core-idm
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Core IdM REST CXF
diff --git a/core/idrepo/logic/pom.xml b/core/idrepo/logic/pom.xml
index d3e5a38b7fb..2591dbb2c78 100644
--- a/core/idrepo/logic/pom.xml
+++ b/core/idrepo/logic/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.core
syncope-core-idrepo
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Core IdRepo Logic
@@ -154,6 +154,7 @@ under the License.
${project.build.directory}/test-classes
file:${bundles.directory}/
true
+ slf4j
diff --git a/core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/AccessTokenLogic.java b/core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/AccessTokenLogic.java
index f2861a0e653..383ba72d2c1 100644
--- a/core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/AccessTokenLogic.java
+++ b/core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/AccessTokenLogic.java
@@ -60,11 +60,11 @@ public AccessTokenLogic(
this.accessTokenDAO = accessTokenDAO;
}
- protected byte[] getAuthorities() {
- byte[] authorities = null;
+ protected String getAuthorities() {
+ String authorities = null;
try {
authorities = encryptorManager.getInstance().
- encode(POJOHelper.serialize(AuthContextUtils.getAuthorities()), CipherAlgorithm.AES).getBytes();
+ encode(POJOHelper.serialize(AuthContextUtils.getAuthorities()), CipherAlgorithm.AES);
} catch (Exception e) {
LOG.error("Could not fetch authorities", e);
}
diff --git a/core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/AnyTypeClassLogic.java b/core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/AnyTypeClassLogic.java
index 03e7f3e3027..b82b481c7e6 100644
--- a/core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/AnyTypeClassLogic.java
+++ b/core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/AnyTypeClassLogic.java
@@ -78,10 +78,7 @@ public AnyTypeClassTO update(final AnyTypeClassTO anyTypeClassTO) {
AnyTypeClass anyTypeClass = anyTypeClassDAO.findById(anyTypeClassTO.getKey()).
orElseThrow(() -> new NotFoundException("AnyTypeClass " + anyTypeClassTO.getKey()));
- binder.update(anyTypeClass, anyTypeClassTO);
- anyTypeClass = anyTypeClassDAO.save(anyTypeClass);
-
- return binder.getAnyTypeClassTO(anyTypeClass);
+ return binder.getAnyTypeClassTO(anyTypeClassDAO.save(binder.update(anyTypeClass, anyTypeClassTO)));
}
@PreAuthorize("hasRole('" + IdRepoEntitlement.ANYTYPECLASS_DELETE + "')")
diff --git a/core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/RelationshipTypeLogic.java b/core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/RelationshipTypeLogic.java
index 9a27fcf6298..aa62395788e 100644
--- a/core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/RelationshipTypeLogic.java
+++ b/core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/RelationshipTypeLogic.java
@@ -83,8 +83,7 @@ public RelationshipTypeTO update(final RelationshipTypeTO relationshipTypeTO) {
RelationshipType relationshipType = relationshipTypeDAO.findById(relationshipTypeTO.getKey()).
orElseThrow(() -> new NotFoundException("RelationshipType " + relationshipTypeTO.getKey()));
- binder.update(relationshipType, relationshipTypeTO);
- relationshipType = relationshipTypeDAO.save(relationshipType);
+ relationshipType = relationshipTypeDAO.save(binder.update(relationshipType, relationshipTypeTO));
publisher.publishEvent(
new EntityLifecycleEvent<>(this, SyncDeltaType.UPDATE, relationshipType, AuthContextUtils.getDomain()));
diff --git a/core/idrepo/pom.xml b/core/idrepo/pom.xml
index ff2e760010c..1da1b5c69bc 100644
--- a/core/idrepo/pom.xml
+++ b/core/idrepo/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope
syncope-core
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Core IdRepo
diff --git a/core/idrepo/rest-cxf/pom.xml b/core/idrepo/rest-cxf/pom.xml
index ceb08e94864..1e2d86e3043 100644
--- a/core/idrepo/rest-cxf/pom.xml
+++ b/core/idrepo/rest-cxf/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope.core
syncope-core-idrepo
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Core IdRepo REST CXF
@@ -50,7 +50,7 @@ under the License.
- com.fasterxml.jackson.jakarta.rs
+ tools.jackson.jakarta.rs
jackson-jakarta-rs-json-provider
diff --git a/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/IdRepoRESTCXFContext.java b/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/IdRepoRESTCXFContext.java
index 594c346ffdd..da424d2bb7b 100644
--- a/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/IdRepoRESTCXFContext.java
+++ b/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/IdRepoRESTCXFContext.java
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.core.rest.cxf;
-import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider;
import io.swagger.v3.oas.models.security.SecurityScheme;
import jakarta.validation.Validator;
import java.util.HashMap;
@@ -134,6 +133,7 @@
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;
import org.springframework.core.task.AsyncTaskExecutor;
+import tools.jackson.jakarta.rs.json.JacksonJsonProvider;
@PropertySource("classpath:errorMessages.properties")
@EnableConfigurationProperties(RESTProperties.class)
diff --git a/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/DynRealmServiceImpl.java b/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/DynRealmServiceImpl.java
index 7a970bddd36..d4fd78b5c3a 100644
--- a/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/DynRealmServiceImpl.java
+++ b/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/DynRealmServiceImpl.java
@@ -62,5 +62,4 @@ public void update(final DynRealmTO roleTO) {
public void delete(final String key) {
logic.delete(key);
}
-
}
diff --git a/core/idrepo/rest-cxf/src/test/java/org/apache/syncope/core/rest/cxf/service/AnyObjectServiceTest.java b/core/idrepo/rest-cxf/src/test/java/org/apache/syncope/core/rest/cxf/service/AnyObjectServiceTest.java
index cdfb89bc04c..eebbc66863c 100644
--- a/core/idrepo/rest-cxf/src/test/java/org/apache/syncope/core/rest/cxf/service/AnyObjectServiceTest.java
+++ b/core/idrepo/rest-cxf/src/test/java/org/apache/syncope/core/rest/cxf/service/AnyObjectServiceTest.java
@@ -28,8 +28,6 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Request;
import jakarta.ws.rs.core.Response;
@@ -80,6 +78,8 @@
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import org.springframework.test.util.ReflectionTestUtils;
+import tools.jackson.core.type.TypeReference;
+import tools.jackson.jakarta.rs.json.JacksonJsonProvider;
@SpringJUnitConfig(classes = { IdRepoRESTCXFTestContext.class })
public class AnyObjectServiceTest {
diff --git a/core/idrepo/rest-cxf/src/test/java/org/apache/syncope/core/rest/cxf/service/IdRepoRESTCXFTestContext.java b/core/idrepo/rest-cxf/src/test/java/org/apache/syncope/core/rest/cxf/service/IdRepoRESTCXFTestContext.java
index 361f0673dd3..14b6d44296d 100644
--- a/core/idrepo/rest-cxf/src/test/java/org/apache/syncope/core/rest/cxf/service/IdRepoRESTCXFTestContext.java
+++ b/core/idrepo/rest-cxf/src/test/java/org/apache/syncope/core/rest/cxf/service/IdRepoRESTCXFTestContext.java
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.core.rest.cxf.service;
-import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider;
import org.apache.cxf.jaxrs.ext.search.SearchContextProvider;
import org.apache.cxf.jaxrs.validation.JAXRSBeanValidationInInterceptor;
import org.apache.cxf.transport.common.gzip.GZIPInInterceptor;
@@ -32,6 +31,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
+import tools.jackson.jakarta.rs.json.JacksonJsonProvider;
@Configuration(proxyBeanMethods = false)
public class IdRepoRESTCXFTestContext {
diff --git a/core/metrics-starter/pom.xml b/core/metrics-starter/pom.xml
index a729f439225..0956b365524 100644
--- a/core/metrics-starter/pom.xml
+++ b/core/metrics-starter/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope
syncope-core
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Core Spring Boot Metrics
diff --git a/core/metrics-starter/src/main/java/org/apache/syncope/core/starter/JPAMetricsContext.java b/core/metrics-starter/src/main/java/org/apache/syncope/core/starter/JPAMetricsContext.java
index 4e455b7e2f5..fc1c218cfdd 100644
--- a/core/metrics-starter/src/main/java/org/apache/syncope/core/starter/JPAMetricsContext.java
+++ b/core/metrics-starter/src/main/java/org/apache/syncope/core/starter/JPAMetricsContext.java
@@ -27,11 +27,11 @@
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.config.BeanPostProcessor;
-import org.springframework.boot.actuate.metrics.data.MetricsRepositoryMethodInvocationListener;
-import org.springframework.boot.actuate.metrics.jdbc.DataSourcePoolMetrics;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvidersConfiguration;
+import org.springframework.boot.data.metrics.MetricsRepositoryMethodInvocationListener;
+import org.springframework.boot.jdbc.autoconfigure.DataSourcePoolMetadataProvidersConfiguration;
import org.springframework.boot.jdbc.metadata.DataSourcePoolMetadataProvider;
+import org.springframework.boot.jdbc.metrics.DataSourcePoolMetrics;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
diff --git a/core/metrics-starter/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsContext.java b/core/metrics-starter/src/main/java/org/springframework/boot/cache/autoconfigure/metrics/CacheMetricsContext.java
similarity index 94%
rename from core/metrics-starter/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsContext.java
rename to core/metrics-starter/src/main/java/org/springframework/boot/cache/autoconfigure/metrics/CacheMetricsContext.java
index da04a795a89..62f82b58736 100644
--- a/core/metrics-starter/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsContext.java
+++ b/core/metrics-starter/src/main/java/org/springframework/boot/cache/autoconfigure/metrics/CacheMetricsContext.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.springframework.boot.actuate.autoconfigure.metrics.cache;
+package org.springframework.boot.cache.autoconfigure.metrics;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
diff --git a/core/metrics-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/core/metrics-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 4ceb3ba1afd..ddaaa4a5ae3 100644
--- a/core/metrics-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/core/metrics-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -16,4 +16,4 @@
# under the License.
org.apache.syncope.core.starter.MetricsContext
org.apache.syncope.core.starter.JPAMetricsContext
-org.springframework.boot.actuate.autoconfigure.metrics.cache.CacheMetricsContext
+org.springframework.boot.cache.autoconfigure.metrics.CacheMetricsContext
diff --git a/core/persistence-api/pom.xml b/core/persistence-api/pom.xml
index 42b23aaf4ab..168766d1fd5 100644
--- a/core/persistence-api/pom.xml
+++ b/core/persistence-api/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope
syncope-core
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Core Persistence API
@@ -43,6 +43,10 @@ under the License.
jakarta.validation-api
+
+ org.springframework
+ spring-tx
+
org.springframework.data
spring-data-commons
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/InvalidEntityException.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/InvalidEntityException.java
index 66822d8b448..e3f76105eaa 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/InvalidEntityException.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/InvalidEntityException.java
@@ -56,7 +56,7 @@ public InvalidEntityException(
this.entityClassSimpleName = entityClass.getSimpleName();
- entityViolationType.setMessage(Optional.ofNullable(message).map(String::trim).orElse(StringUtils.EMPTY));
+ entityViolationType.message(Optional.ofNullable(message).map(String::trim).orElse(StringUtils.EMPTY));
this.violations.put(entityClass, EnumSet.noneOf(EntityViolationType.class));
this.violations.get(entityClass).add(entityViolationType);
@@ -86,9 +86,10 @@ public InvalidEntityException(
} catch (IllegalArgumentException e) {
entityViolationType = EntityViolationType.Standard;
}
- entityViolationType.setMessage(message);
- entityViolationType.setPropertyPath(violation.getPropertyPath().toString());
- entityViolationType.setInvalidValue(violation.getInvalidValue());
+ entityViolationType.
+ message(message).
+ propertyPath(violation.getPropertyPath().toString()).
+ invalidValue(violation.getInvalidValue());
if (!this.violations.containsKey(violation.getLeafBean().getClass())) {
this.violations.put(violation.getLeafBean().getClass(), EnumSet.noneOf(EntityViolationType.class));
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyChecker.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyChecker.java
new file mode 100644
index 00000000000..8403e283c85
--- /dev/null
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyChecker.java
@@ -0,0 +1,196 @@
+/*
+ * 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.apache.syncope.core.persistence.api.dao;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import org.apache.syncope.common.lib.types.EntityViolationType;
+import org.apache.syncope.core.persistence.api.attrvalue.InvalidEntityException;
+import org.apache.syncope.core.persistence.api.entity.Any;
+import org.apache.syncope.core.persistence.api.entity.AnyTypeClass;
+import org.apache.syncope.core.persistence.api.entity.AnyUtils;
+import org.apache.syncope.core.persistence.api.entity.Attributable;
+import org.apache.syncope.core.persistence.api.entity.DerSchema;
+import org.apache.syncope.core.persistence.api.entity.Groupable;
+import org.apache.syncope.core.persistence.api.entity.Membership;
+import org.apache.syncope.core.persistence.api.entity.PlainAttr;
+import org.apache.syncope.core.persistence.api.entity.PlainSchema;
+import org.apache.syncope.core.persistence.api.entity.Relatable;
+import org.apache.syncope.core.persistence.api.entity.Relationship;
+import org.apache.syncope.core.persistence.api.entity.RelationshipType;
+import org.apache.syncope.core.persistence.api.entity.Schema;
+import org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject;
+import org.apache.syncope.core.persistence.api.entity.group.Group;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+public class AnyChecker {
+
+ protected static final Logger LOG = LoggerFactory.getLogger(AnyChecker.class);
+
+ protected final PlainSchemaDAO plainSchemaDAO;
+
+ public AnyChecker(final PlainSchemaDAO plainSchemaDAO) {
+ this.plainSchemaDAO = plainSchemaDAO;
+ }
+
+ @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true)
+ @SuppressWarnings("unchecked")
+ public AllowedSchemas findAllowedSchemas(final Any any, final Class reference) {
+ AllowedSchemas result = new AllowedSchemas<>();
+
+ // schemas given by type and aux classes
+ Set typeOwnClasses = new HashSet<>();
+ typeOwnClasses.addAll(any.getType().getClasses());
+ typeOwnClasses.addAll(any.getAuxClasses());
+
+ typeOwnClasses.forEach(typeClass -> {
+ if (reference.equals(PlainSchema.class)) {
+ result.self().addAll((Collection extends S>) typeClass.getPlainSchemas());
+ } else if (reference.equals(DerSchema.class)) {
+ result.self().addAll((Collection extends S>) typeClass.getDerSchemas());
+ }
+ });
+
+ // schemas given by group type extensions
+ Map> gTypeExtensionClasses = new HashMap<>();
+ switch (any) {
+ case User user ->
+ user.getMemberships().forEach(memb -> memb.getRightEnd().getTypeExtensions().
+ forEach(typeExt -> gTypeExtensionClasses.put(memb.getRightEnd(), typeExt.getAuxClasses())));
+ case AnyObject anyObject ->
+ anyObject.getMemberships().forEach(memb -> memb.getRightEnd().getTypeExtensions().stream().
+ filter(typeExt -> any.getType().equals(typeExt.getAnyType())).
+ forEach(typeExt -> gTypeExtensionClasses.put(memb.getRightEnd(), typeExt.getAuxClasses())));
+ default -> {
+ }
+ }
+ gTypeExtensionClasses.entrySet().stream().peek(
+ entry -> result.memberships().put(entry.getKey(), new HashSet<>())).
+ forEach(entry -> entry.getValue().forEach(typeClass -> {
+ if (reference.equals(PlainSchema.class)) {
+ result.memberships().get(entry.getKey()).
+ addAll((Collection extends S>) typeClass.getPlainSchemas());
+ } else if (reference.equals(DerSchema.class)) {
+ result.memberships().get(entry.getKey()).
+ addAll((Collection extends S>) typeClass.getDerSchemas());
+ }
+ }));
+
+ // schemas given by relationship type extensions
+ Map> rTypeExtensionClasses = new HashMap<>();
+ switch (any) {
+ case User user ->
+ user.getRelationships().stream().map(Relationship::getType).distinct().
+ forEach(rt -> rt.getTypeExtensions().
+ forEach(typeExt -> rTypeExtensionClasses.put(rt, typeExt.getAuxClasses())));
+ case AnyObject anyObject ->
+ anyObject.getRelationships().stream().map(Relationship::getType).distinct().
+ forEach(rt -> rt.getTypeExtensions().
+ forEach(typeExt -> rTypeExtensionClasses.put(rt, typeExt.getAuxClasses())));
+ default -> {
+ }
+ }
+ rTypeExtensionClasses.entrySet().stream().peek(
+ entry -> result.relationshipTypes().put(entry.getKey(), new HashSet<>())).
+ forEach(entry -> entry.getValue().forEach(typeClass -> {
+ if (reference.equals(PlainSchema.class)) {
+ result.relationshipTypes().get(entry.getKey()).
+ addAll((Collection extends S>) typeClass.getPlainSchemas());
+ } else if (reference.equals(DerSchema.class)) {
+ result.relationshipTypes().get(entry.getKey()).
+ addAll((Collection extends S>) typeClass.getDerSchemas());
+ }
+ }));
+
+ return result;
+ }
+
+ @Transactional(readOnly = true)
+ public void checkBeforeSave(final T attributable, final AnyUtils anyUtils) {
+ if (attributable instanceof Any any) {
+ AllowedSchemas allowed = findAllowedSchemas(any, PlainSchema.class);
+
+ for (PlainAttr attr : any.getPlainAttrs()) {
+ String schema = Optional.ofNullable(attr).map(PlainAttr::getSchema).orElse(null);
+ if (schema != null && !allowed.selfContains(schema)) {
+ throw new InvalidEntityException(
+ anyUtils.anyClass(),
+ EntityViolationType.InvalidPlainAttr.propertyPath("plainAttrs"),
+ schema + " not allowed for this instance");
+ }
+ }
+ if (any instanceof Groupable, ?, ?> groupable) {
+ for (Membership> membership : groupable.getMemberships()) {
+ for (PlainAttr attr : groupable.getPlainAttrs(membership)) {
+ String schema = Optional.ofNullable(attr).map(PlainAttr::getSchema).orElse(null);
+ if (schema != null && !allowed.membershipsContains(membership.getRightEnd(), schema)) {
+ throw new InvalidEntityException(
+ anyUtils.anyClass(),
+ EntityViolationType.InvalidPlainAttr.propertyPath("plainAttrs"),
+ schema + " not allowed for membership of group "
+ + membership.getRightEnd().getName());
+ }
+ }
+ }
+ }
+ if (any instanceof Relatable, ?> relatable) {
+ for (Relationship, ?> relationship : relatable.getRelationships()) {
+ for (PlainAttr attr : relatable.getPlainAttrs(relationship)) {
+ String schema = Optional.ofNullable(attr).map(PlainAttr::getSchema).orElse(null);
+ if (schema != null && !allowed.relationshipTypesContains(relationship.getType(), schema)) {
+ throw new InvalidEntityException(
+ anyUtils.anyClass(),
+ EntityViolationType.InvalidPlainAttr.propertyPath("plainAttrs"),
+ schema + " not allowed for relationships of type "
+ + relationship.getType().getKey());
+ }
+ }
+ }
+ }
+ }
+
+ // check UNIQUE constraints
+ attributable.getPlainAttrs().stream().
+ filter(attr -> attr.getUniqueValue() != null).
+ forEach(attr -> {
+ if (plainSchemaDAO.existsPlainAttrUniqueValue(
+ anyUtils,
+ attributable.getKey(),
+ plainSchemaDAO.findById(attr.getSchema()).
+ orElseThrow(() -> new NotFoundException("PlainSchema " + attr.getSchema())),
+ attr.getUniqueValue())) {
+
+ throw new DuplicateException("Duplicate value found for "
+ + attr.getSchema() + "=" + attr.getUniqueValue().getValueAsString());
+ } else {
+ LOG.debug("No duplicate value found for {}={}",
+ attr.getSchema(), attr.getUniqueValue().getValueAsString());
+ }
+ });
+ }
+}
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyDAO.java
index 038c318c7d6..530c42d4b90 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyDAO.java
@@ -28,7 +28,6 @@
import org.apache.syncope.core.persistence.api.entity.Any;
import org.apache.syncope.core.persistence.api.entity.ExternalResource;
import org.apache.syncope.core.persistence.api.entity.Relationship;
-import org.apache.syncope.core.persistence.api.entity.Schema;
import org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
@@ -69,11 +68,11 @@ default SearchCond getAllMatchingCond() {
return SearchCond.of(idCond);
}
- AllowedSchemas findAllowedSchemas(A any, Class reference);
-
List findDynRealms(String key);
Collection findAllResourceKeys(String key);
void deleteRelationship(Relationship extends A, AnyObject> relationship);
+
+ void evict(Class entityClass, String key);
}
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/EntityCacheDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/EntityCacheDAO.java
index d48133171c1..451897ac103 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/EntityCacheDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/EntityCacheDAO.java
@@ -18,19 +18,10 @@
*/
package org.apache.syncope.core.persistence.api.dao;
-import java.util.Map;
import org.apache.syncope.core.persistence.api.entity.Entity;
public interface EntityCacheDAO {
- Map getStatistics();
-
- void enableStatistics();
-
- void disableStatistics();
-
- void resetStatistics();
-
void evict(Class extends Entity> entityClass, String key);
void clearCache();
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RealmDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RealmDAO.java
index 23bbbdc1d0f..26a2e7853b5 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RealmDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RealmDAO.java
@@ -42,4 +42,6 @@ public interface RealmDAO extends DAO {
List findByActionsContaining(Implementation logicActions);
Page extends Realm> findAll(Pageable pageable);
+
+ void evict(String key);
}
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/TaskExecDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/TaskExecDAO.java
index a3f9906f013..88246db30b7 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/TaskExecDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/TaskExecDAO.java
@@ -44,7 +44,5 @@ List> findAll(
OffsetDateTime after,
Pageable pageable);
- > void saveAndAdd(TaskType type, String taskKey, TaskExec execution);
-
- > void delete(TaskType type, String key);
+ void delete(TaskType type, String key);
}
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AccessToken.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AccessToken.java
index 3db11c8462c..e200eda1ef5 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AccessToken.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AccessToken.java
@@ -34,7 +34,7 @@ public interface AccessToken extends ProvidedKeyEntity {
void setOwner(String owner);
- byte[] getAuthorities();
+ String getAuthorities();
- void setAuthorities(byte[] authorities);
+ void setAuthorities(String authorities);
}
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/ConnInstance.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/ConnInstance.java
index f640516337b..2e30c9caa9c 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/ConnInstance.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/ConnInstance.java
@@ -26,6 +26,8 @@
public interface ConnInstance extends Entity {
+ int DEFAULT_TIMEOUT = 10;
+
Realm getAdminRealm();
void setAdminRealm(Realm adminRealm);
@@ -56,16 +58,9 @@ public interface ConnInstance extends Entity {
Set getCapabilities();
- boolean add(ExternalResource resource);
-
- List extends ExternalResource> getResources();
-
- void setConf(List conf);
-
List getConf();
void setConnRequestTimeout(Integer timeout);
Integer getConnRequestTimeout();
-
}
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/am/AuthProfile.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/am/AuthProfile.java
index bd922215110..f79e3ab8ea5 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/am/AuthProfile.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/am/AuthProfile.java
@@ -32,23 +32,23 @@ public interface AuthProfile extends Entity {
void setOwner(String owner);
+ boolean add(GoogleMfaAuthToken googleMfaAuthToken);
+
List getGoogleMfaAuthTokens();
- void setGoogleMfaAuthTokens(List tokens);
+ boolean add(GoogleMfaAuthAccount googleMfaAuthAccount);
List getGoogleMfaAuthAccounts();
- void setGoogleMfaAuthAccounts(List accounts);
+ boolean add(MfaTrustedDevice mfaTrustedDevice);
List getMfaTrustedDevices();
- void setMfaTrustedDevices(List records);
+ boolean add(WebAuthnDeviceCredential webAuthnDeviceCredential);
List getWebAuthnDeviceCredentials();
- void setWebAuthnDeviceCredentials(List credentials);
+ boolean add(ImpersonationAccount impersonationAccount);
List getImpersonationAccounts();
-
- void setImpersonationAccounts(List accounts);
}
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/keymaster/ConfParam.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/keymaster/ConfParam.java
index be15aa063ea..889420c2ec3 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/keymaster/ConfParam.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/keymaster/ConfParam.java
@@ -18,8 +18,8 @@
*/
package org.apache.syncope.core.persistence.api.entity.keymaster;
-import com.fasterxml.jackson.databind.JsonNode;
import org.apache.syncope.core.persistence.api.entity.ProvidedKeyEntity;
+import tools.jackson.databind.JsonNode;
public interface ConfParam extends ProvidedKeyEntity {
diff --git a/core/persistence-common/pom.xml b/core/persistence-common/pom.xml
index d396d628846..e531ae9ed84 100644
--- a/core/persistence-common/pom.xml
+++ b/core/persistence-common/pom.xml
@@ -24,7 +24,7 @@ under the License.
org.apache.syncope
syncope-core
- 4.1.0-SNAPSHOT
+ 5.0.0-SNAPSHOT
Apache Syncope Core Persistence Common
diff --git a/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/attrvalue/BinaryValidator.java b/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/attrvalue/BinaryValidator.java
index 5a1a4414eb9..05bb14193d4 100644
--- a/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/attrvalue/BinaryValidator.java
+++ b/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/attrvalue/BinaryValidator.java
@@ -18,19 +18,20 @@
*/
package org.apache.syncope.core.persistence.common.attrvalue;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import jakarta.ws.rs.core.MediaType;
-import java.io.IOException;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.apache.syncope.core.persistence.api.attrvalue.InvalidPlainAttrValueException;
import org.apache.syncope.core.persistence.api.entity.PlainAttrValue;
import org.apache.syncope.core.persistence.api.entity.PlainSchema;
import org.apache.tika.Tika;
+import tools.jackson.core.JacksonException;
+import tools.jackson.databind.json.JsonMapper;
public class BinaryValidator extends AbstractValidator {
private static final long serialVersionUID = 1344152444666540361L;
- private static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build();
+ private static final JsonMapper MAPPER = new SyncopeJsonMapper();
private static final Tika TIKA = new Tika();
@@ -67,7 +68,7 @@ private static boolean isValidJSON(final String value) {
try {
MAPPER.readTree(value);
return true;
- } catch (IOException e) {
+ } catch (JacksonException e) {
LOG.debug("Invalid JSON string: {}", value, e);
return false;
}
diff --git a/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/content/KeymasterConfParamLoader.java b/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/content/KeymasterConfParamLoader.java
index 3de128e41d0..136f67353bb 100644
--- a/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/content/KeymasterConfParamLoader.java
+++ b/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/content/KeymasterConfParamLoader.java
@@ -18,18 +18,19 @@
*/
package org.apache.syncope.core.persistence.common.content;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.json.JsonMapper;
import java.io.InputStream;
import java.util.Map;
import java.util.Optional;
import org.apache.syncope.common.keymaster.client.api.ConfParamOps;
+import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper;
import org.apache.syncope.core.persistence.api.ApplicationContextProvider;
import org.apache.syncope.core.persistence.api.content.ConfParamLoader;
import org.apache.syncope.core.spring.security.AuthContextUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Transactional;
+import tools.jackson.databind.JsonNode;
+import tools.jackson.databind.json.JsonMapper;
/**
* Initialize Keymaster with default content if no data is present already.
@@ -38,7 +39,7 @@ public class KeymasterConfParamLoader implements ConfParamLoader {
protected static final Logger LOG = LoggerFactory.getLogger(KeymasterConfParamLoader.class);
- protected static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build();
+ protected static final JsonMapper MAPPER = new SyncopeJsonMapper();
protected final ConfParamOps confParamOps;
diff --git a/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/validation/AnyValidator.java b/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/validation/AnyValidator.java
deleted file mode 100644
index 766f6fcca84..00000000000
--- a/core/persistence-common/src/main/java/org/apache/syncope/core/persistence/common/validation/AnyValidator.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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.apache.syncope.core.persistence.common.validation;
-
-import jakarta.validation.ConstraintValidatorContext;
-import java.util.Optional;
-import org.apache.syncope.common.lib.types.EntityViolationType;
-import org.apache.syncope.core.persistence.api.ApplicationContextProvider;
-import org.apache.syncope.core.persistence.api.dao.AllowedSchemas;
-import org.apache.syncope.core.persistence.api.entity.Any;
-import org.apache.syncope.core.persistence.api.entity.AnyUtilsFactory;
-import org.apache.syncope.core.persistence.api.entity.Groupable;
-import org.apache.syncope.core.persistence.api.entity.Membership;
-import org.apache.syncope.core.persistence.api.entity.PlainAttr;
-import org.apache.syncope.core.persistence.api.entity.PlainSchema;
-import org.apache.syncope.core.persistence.api.entity.Relatable;
-import org.apache.syncope.core.persistence.api.entity.Relationship;
-
-public class AnyValidator extends AbstractValidator {
-
- @Override
- public boolean isValid(final Any any, final ConstraintValidatorContext context) {
- context.disableDefaultConstraintViolation();
-
- AllowedSchemas allowedPlainSchemas =
- ApplicationContextProvider.getApplicationContext().getBean(AnyUtilsFactory.class).
- getInstance(any.getType().getKind()).dao().findAllowedSchemas(any, PlainSchema.class);
-
- for (PlainAttr attr : any.getPlainAttrs()) {
- String plainSchema = Optional.ofNullable(attr).map(PlainAttr::getSchema).orElse(null);
- if (plainSchema != null && !allowedPlainSchemas.selfContains(plainSchema)) {
- context.buildConstraintViolationWithTemplate(
- getTemplate(EntityViolationType.InvalidPlainAttr,
- plainSchema + " not allowed for this instance")).
- addPropertyNode("plainAttrs").addConstraintViolation();
- return false;
- }
- }
- if (any instanceof Groupable, ?, ?> groupable) {
- for (Membership> membership : groupable.getMemberships()) {
- for (PlainAttr attr : groupable.getPlainAttrs(membership)) {
- String plainSchema = Optional.ofNullable(attr).map(PlainAttr::getSchema).orElse(null);
- if (plainSchema != null
- && !allowedPlainSchemas.membershipsContains(membership.getRightEnd(), plainSchema)) {
-
- context.buildConstraintViolationWithTemplate(
- getTemplate(EntityViolationType.InvalidPlainAttr,
- plainSchema + " not allowed for membership of group "
- + membership.getRightEnd().getName())).
- addPropertyNode("plainAttrs").addConstraintViolation();
- return false;
- }
- }
- }
- }
- if (any instanceof Relatable, ?> relatable) {
- for (Relationship, ?> relationship : relatable.getRelationships()) {
- for (PlainAttr attr : relatable.getPlainAttrs(relationship)) {
- String plainSchema = Optional.ofNullable(attr).map(PlainAttr::getSchema).orElse(null);
- if (plainSchema != null
- && !allowedPlainSchemas.relationshipTypesContains(relationship.getType(), plainSchema)) {
-
- context.buildConstraintViolationWithTemplate(
- getTemplate(EntityViolationType.InvalidPlainAttr,
- plainSchema + " not allowed for relationships of type "
- + relationship.getType().getKey())).
- addPropertyNode("plainAttrs").addConstraintViolation();
- return false;
- }
- }
- }
- }
-
- return true;
- }
-}
diff --git a/core/persistence-jpa-upgrader/LICENSE b/core/persistence-jpa-upgrader/LICENSE
deleted file mode 100644
index cc09e451c1c..00000000000
--- a/core/persistence-jpa-upgrader/LICENSE
+++ /dev/null
@@ -1,480 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
-
-==
-
-For Jackson (http://wiki.fasterxml.com/JacksonHome):
-This is licensed under the AL 2.0, see above.
-
-==
-
-For LMAX Disruptor (https://lmax-exchange.github.io/disruptor/):
-This is licensed under the AL 2.0, see above.
-
-==
-
-For HikariCP (http://brettwooldridge.github.io/HikariCP/):
-This is licensed under the AL 2.0, see above.
-
-==
-
-For Micrometer Application Metrics (https://micrometer.io/):
-This is licensed under the AL 2.0, see above.
-
-==
-
-For Jakarta Annotations https://projects.eclipse.org/projects/ee4j.ca):
-This is licensed under the EPL 1.0:
-
-Eclipse Public License - v 1.0
-
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
-LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
-CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-1. DEFINITIONS
-
-"Contribution" means:
-
-a) in the case of the initial Contributor, the initial code and documentation
- distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
- i) changes to the Program, and
- ii) additions to the Program;
-
- where such changes and/or additions to the Program originate from and are
- distributed by that particular Contributor. A Contribution 'originates'
- from a Contributor if it was added to the Program by such Contributor
- itself or anyone acting on such Contributor's behalf. Contributions do not
- include additions to the Program which: (i) are separate modules of
- software distributed in conjunction with the Program under their own
- license agreement, and (ii) are not derivative works of the Program.
-
-"Contributor" means any person or entity that distributes the Program.
-
-"Licensed Patents" mean patent claims licensable by a Contributor which are
-necessarily infringed by the use or sale of its Contribution alone or when
-combined with the Program.
-
-"Program" means the Contributions distributed in accordance with this
-Agreement.
-
-"Recipient" means anyone who receives the Program under this Agreement,
-including all Contributors.
-
-2. GRANT OF RIGHTS
- a) Subject to the terms of this Agreement, each Contributor hereby grants
- Recipient a non-exclusive, worldwide, royalty-free copyright license to
- reproduce, prepare derivative works of, publicly display, publicly
- perform, distribute and sublicense the Contribution of such Contributor,
- if any, and such derivative works, in source code and object code form.
- b) Subject to the terms of this Agreement, each Contributor hereby grants
- Recipient a non-exclusive, worldwide, royalty-free patent license under
- Licensed Patents to make, use, sell, offer to sell, import and otherwise
- transfer the Contribution of such Contributor, if any, in source code and
- object code form. This patent license shall apply to the combination of
- the Contribution and the Program if, at the time the Contribution is
- added by the Contributor, such addition of the Contribution causes such
- combination to be covered by the Licensed Patents. The patent license
- shall not apply to any other combinations which include the Contribution.
- No hardware per se is licensed hereunder.
- c) Recipient understands that although each Contributor grants the licenses
- to its Contributions set forth herein, no assurances are provided by any
- Contributor that the Program does not infringe the patent or other
- intellectual property rights of any other entity. Each Contributor
- disclaims any liability to Recipient for claims brought by any other
- entity based on infringement of intellectual property rights or
- otherwise. As a condition to exercising the rights and licenses granted
- hereunder, each Recipient hereby assumes sole responsibility to secure
- any other intellectual property rights needed, if any. For example, if a
- third party patent license is required to allow Recipient to distribute
- the Program, it is Recipient's responsibility to acquire that license
- before distributing the Program.
- d) Each Contributor represents that to its knowledge it has sufficient
- copyright rights in its Contribution, if any, to grant the copyright
- license set forth in this Agreement.
-
-3. REQUIREMENTS
-
-A Contributor may choose to distribute the Program in object code form under
-its own license agreement, provided that:
-
- a) it complies with the terms and conditions of this Agreement; and
- b) its license agreement:
- i) effectively disclaims on behalf of all Contributors all warranties
- and conditions, express and implied, including warranties or
- conditions of title and non-infringement, and implied warranties or
- conditions of merchantability and fitness for a particular purpose;
- ii) effectively excludes on behalf of all Contributors all liability for
- damages, including direct, indirect, special, incidental and
- consequential damages, such as lost profits;
- iii) states that any provisions which differ from this Agreement are
- offered by that Contributor alone and not by any other party; and
- iv) states that source code for the Program is available from such
- Contributor, and informs licensees how to obtain it in a reasonable
- manner on or through a medium customarily used for software exchange.
-
-When the Program is made available in source code form:
-
- a) it must be made available under this Agreement; and
- b) a copy of this Agreement must be included with each copy of the Program.
- Contributors may not remove or alter any copyright notices contained
- within the Program.
-
-Each Contributor must identify itself as the originator of its Contribution,
-if
-any, in a manner that reasonably allows subsequent Recipients to identify the
-originator of the Contribution.
-
-4. COMMERCIAL DISTRIBUTION
-
-Commercial distributors of software may accept certain responsibilities with
-respect to end users, business partners and the like. While this license is
-intended to facilitate the commercial use of the Program, the Contributor who
-includes the Program in a commercial product offering should do so in a manner
-which does not create potential liability for other Contributors. Therefore,
-if a Contributor includes the Program in a commercial product offering, such
-Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
-every other Contributor ("Indemnified Contributor") against any losses,
-damages and costs (collectively "Losses") arising from claims, lawsuits and
-other legal actions brought by a third party against the Indemnified
-Contributor to the extent caused by the acts or omissions of such Commercial
-Contributor in connection with its distribution of the Program in a commercial
-product offering. The obligations in this section do not apply to any claims
-or Losses relating to any actual or alleged intellectual property
-infringement. In order to qualify, an Indemnified Contributor must:
-a) promptly notify the Commercial Contributor in writing of such claim, and
-b) allow the Commercial Contributor to control, and cooperate with the
-Commercial Contributor in, the defense and any related settlement
-negotiations. The Indemnified Contributor may participate in any such claim at
-its own expense.
-
-For example, a Contributor might include the Program in a commercial product
-offering, Product X. That Contributor is then a Commercial Contributor. If
-that Commercial Contributor then makes performance claims, or offers
-warranties related to Product X, those performance claims and warranties are
-such Commercial Contributor's responsibility alone. Under this section, the
-Commercial Contributor would have to defend claims against the other
-Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.
-
-5. NO WARRANTY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
-IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
-Recipient is solely responsible for determining the appropriateness of using
-and distributing the Program and assumes all risks associated with its
-exercise of rights under this Agreement , including but not limited to the
-risks and costs of program errors, compliance with applicable laws, damage to
-or loss of data, programs or equipment, and unavailability or interruption of
-operations.
-
-6. DISCLAIMER OF LIABILITY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
-CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION
-LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
-EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGES.
-
-7. GENERAL
-
-If any provision of this Agreement is invalid or unenforceable under
-applicable law, it shall not affect the validity or enforceability of the
-remainder of the terms of this Agreement, and without further action by the
-parties hereto, such provision shall be reformed to the minimum extent
-necessary to make such provision valid and enforceable.
-
-If Recipient institutes patent litigation against any entity (including a
-cross-claim or counterclaim in a lawsuit) alleging that the Program itself
-(excluding combinations of the Program with other software or hardware)
-infringes such Recipient's patent(s), then such Recipient's rights granted
-under Section 2(b) shall terminate as of the date such litigation is filed.
-
-All Recipient's rights under this Agreement shall terminate if it fails to
-comply with any of the material terms or conditions of this Agreement and does
-not cure such failure in a reasonable period of time after becoming aware of
-such noncompliance. If all Recipient's rights under this Agreement terminate,
-Recipient agrees to cease use and distribution of the Program as soon as
-reasonably practicable. However, Recipient's obligations under this Agreement
-and any licenses granted by Recipient relating to the Program shall continue
-and survive.
-
-Everyone is permitted to copy and distribute copies of this Agreement, but in
-order to avoid inconsistency the Agreement is copyrighted and may only be
-modified in the following manner. The Agreement Steward reserves the right to
-publish new versions (including revisions) of this Agreement from time to
-time. No one other than the Agreement Steward has the right to modify this
-Agreement. The Eclipse Foundation is the initial Agreement Steward. The
-Eclipse Foundation may assign the responsibility to serve as the Agreement
-Steward to a suitable separate entity. Each new version of the Agreement will
-be given a distinguishing version number. The Program (including
-Contributions) may always be distributed subject to the version of the
-Agreement under which it was received. In addition, after a new version of the
-Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly
-stated in Sections 2(a) and 2(b) above, Recipient receives no rights or
-licenses to the intellectual property of any Contributor under this Agreement,
-whether expressly, by implication, estoppel or otherwise. All rights in the
-Program not expressly granted under this Agreement are reserved.
-
-This Agreement is governed by the laws of the State of New York and the
-intellectual property laws of the United States of America. No party to this
-Agreement will bring a legal action under this Agreement more than one year
-after the cause of action arose. Each party waives its rights to a jury trial in
-any resulting litigation.
-
-==
-
-For Jakarta Messaging (https://projects.eclipse.org/projects/ee4j.messaging):
-This is licensed under the EPL 1.0, see above.
-
-==
-
-For Jakarta Persistence project(https://github.com/eclipse-ee4j/jpa-api):
-This is licensed under the EPL 1.0, see above.
-
-==
-
-For Jakarta Transactions (https://projects.eclipse.org/projects/ee4j.jta):
-This is licensed under the EPL 1.0, see above.
-
-==
-
-For Simple Logging Facade for Java - SLF4J (http://www.slf4j.org/):
-This is licensed under the MIT license:
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-==
-
-For Spring (https://spring.io/projects):
-This is licensed under the AL 2.0, see above.
-
-==
-
-For SnakeYAML (http://www.snakeyaml.org/):
-This is licensed under the AL 2.0, see above.
diff --git a/core/persistence-jpa-upgrader/NOTICE b/core/persistence-jpa-upgrader/NOTICE
deleted file mode 100644
index e3e570c55d8..00000000000
--- a/core/persistence-jpa-upgrader/NOTICE
+++ /dev/null
@@ -1,57 +0,0 @@
-Apache Syncope
-Copyright 2012-2025 The Apache Software Foundation
-
-This product includes software developed by:
-The Apache Software Foundation (http://www.apache.org/).
-
-The following copyright notice(s) were affixed to portions of this code
-with which this file is now or was at one time distributed.
-
-==
-
-This product includes software developed by the Jackson project.
-
-==
-
-This product includes software developed by the HikariCP project.
-
-==
-
-This product includes software developed by Micrometer Application Metrics.
-Copyright (c) 2017-Present VMware, Inc. All Rights Reserved.
-
-==
-
-This product includes software produced and maintained by Jakarta Annotations
-All content is the property of the respective authors or their employers.
-
-==
-
-This product includes software developed by the Eclipse Project for Jakarta Messaging.
-Copyright (c) 2017, 2020 Oracle and/or its affiliates. All rights reserved.
-Copyright 2021 Contributors to the Eclipse Foundation
-
-==
-
-This product includes software produced and maintained by Jakarta Persistence project
-All content is the property of the respective authors or their employers.
-
-==
-
-This product includes software developed by the Eclipse Project for Jakarta Transactions.
-Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
-
-==
-
-This products includes software developed by the Simple Logging Facade for Java (SLF4J) project.
-Copyright (c) 2004-2016 QOS.ch.
-
-==
-
-This product includes software developed by SpringSource.
-Copyright (c) 2004-2022 SpringSource
-All rights reserved.
-
-==
-
-This product includes software developed by the SnakeYAML project.
diff --git a/core/persistence-jpa-upgrader/pom.xml b/core/persistence-jpa-upgrader/pom.xml
deleted file mode 100644
index fa51b7bf046..00000000000
--- a/core/persistence-jpa-upgrader/pom.xml
+++ /dev/null
@@ -1,214 +0,0 @@
-
-
-
-
- 4.0.0
-
-
- org.apache.syncope
- syncope-core
- 4.1.0-SNAPSHOT
-
-
- Apache Syncope Core Persistence JPA Upgrader
- Apache Syncope Core Persistence JPA Upgrader
- org.apache.syncope.core
- syncope-core-persistence-jpa-upgrader
- jar
-
-
- file:${bundles.directory}/
-
- org.postgresql
- postgresql
-
- ${basedir}/../..
-
-
-
-
- org.springframework.boot
- spring-boot-starter-jdbc
-
-
-
- org.springframework.boot
- spring-boot-starter-log4j2
-
-
- com.lmax
- disruptor
-
-
-
- org.apache.openjpa
- openjpa
-
-
-
- com.fasterxml.jackson.core
- jackson-databind
-
-
-
-
- com.github.ben-manes.caffeine
- jcache
- test
-
-
- org.springframework.boot
- spring-boot-starter-validation
- test
-
-
- org.apache.syncope.core
- syncope-core-workflow-java
- ${project.version}
- test
-
-
- org.apache.syncope.core
- syncope-core-persistence-jpa
- ${project.version}
- test
-
-
- org.postgresql
- postgresql
- test
-
-
- io.zonky.test
- embedded-postgres
- test
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-dependency-plugin
- true
-
-
- set-bundles
- process-test-resources
-
- copy
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
- ${project.build.directory}/test-classes
- file:${bundles.directory}/
- true
-
-
-
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
- ZIP
-
-
-
-
- repackage
-
-
-
-
-
-
-
-
- src/main/resources
- true
-
-
-
-
- src/test/resources
- true
-
-
- ${basedir}/../persistence-jpa/src/test/resources
- true
-
- core-test.properties
-
-
-
- ${basedir}/../provisioning-java/src/test/resources
- true
-
- core-test.properties
-
-
-
-
-
-
-
- apache-release
-
-
-
-
- org.apache.maven.plugins
- maven-deploy-plugin
-
- true
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- false
-
- true
-
-
-
-
-
-
-
-
diff --git a/core/persistence-jpa-upgrader/src/main/java/org/apache/syncope/core/persistence/jpa/upgrade/GenerateUpgradeSQL.java b/core/persistence-jpa-upgrader/src/main/java/org/apache/syncope/core/persistence/jpa/upgrade/GenerateUpgradeSQL.java
deleted file mode 100644
index 790f8fb4dd4..00000000000
--- a/core/persistence-jpa-upgrader/src/main/java/org/apache/syncope/core/persistence/jpa/upgrade/GenerateUpgradeSQL.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * 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.apache.syncope.core.persistence.jpa.upgrade;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.json.JsonMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import java.io.IOException;
-import java.io.Writer;
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
-import org.apache.openjpa.jdbc.schema.SchemaTool;
-import org.springframework.jdbc.core.JdbcTemplate;
-
-public class GenerateUpgradeSQL {
-
- private static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build();
-
- private static final String INIT_SQL_STATEMENTS =
- """
- INSERT INTO InboundPolicy SELECT * FROM PullPolicy;
- UPDATE ExternalResource SET inboundPolicy_id=pullPolicy_id;
- ALTER TABLE ExternalResource DROP COLUMN pullPolicy_id;
-
- INSERT INTO InboundCorrelationRuleEntity(id, inboundPolicy_id, anyType_id, implementation_id)
- SELECT id, pullPolicy_id, anyType_id, implementation_id FROM PullCorrelationRuleEntity;
-
- DROP TABLE PullCorrelationRuleEntity;
- DROP TABLE PullPolicy;
- """;
-
- private static final String FINAL_SQL_STATEMENTS =
- """
- DROP TABLE IF EXISTS qrtz_blob_triggers CASCADE;
- DROP TABLE IF EXISTS qrtz_calendars CASCADE;
- DROP TABLE IF EXISTS qrtz_cron_triggers CASCADE;
- DROP TABLE IF EXISTS qrtz_fired_triggers CASCADE;
- DROP TABLE IF EXISTS qrtz_job_details CASCADE;
- DROP TABLE IF EXISTS qrtz_locks CASCADE;
- DROP TABLE IF EXISTS qrtz_paused_trigger_grps CASCADE;
- DROP TABLE IF EXISTS qrtz_scheduler_state CASCADE;
- DROP TABLE IF EXISTS qrtz_simple_triggers CASCADE;
- DROP TABLE IF EXISTS qrtz_simprop_triggers CASCADE;
- DROP TABLE IF EXISTS qrtz_triggers CASCADE;
- """;
-
- private final JDBCConfiguration jdbcConf;
-
- private final JdbcTemplate jdbcTemplate;
-
- public GenerateUpgradeSQL(final JDBCConfiguration jdbcConf) {
- this.jdbcConf = jdbcConf;
- this.jdbcTemplate = new JdbcTemplate(jdbcConf.getDataSource2(null));
- }
-
- private String connInstances() throws JsonProcessingException {
- StringBuilder result = new StringBuilder();
-
- List