diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml
index 32749fbaa..943136c3f 100644
--- a/.github/workflows/push-trigger.yml
+++ b/.github/workflows/push-trigger.yml
@@ -18,12 +18,12 @@ on:
- release*
- master
- 1.*
- - develop
+ - develop*
- MOSIP*
jobs:
build-maven-id-repository:
- uses: mosip/kattu/.github/workflows/maven-build.yml@master
+ uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21
with:
SERVICE_LOCATION: ./id-repository
BUILD_ARTIFACT: id-repository
@@ -37,7 +37,7 @@ jobs:
publish_to_nexus:
if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' && github.event_name != 'release' && github.event_name != 'prerelease' && github.event_name != 'publish' }}"
needs: build-maven-id-repository
- uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master
+ uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master-java21
with:
SERVICE_LOCATION: ./id-repository
secrets:
@@ -73,7 +73,7 @@ jobs:
BUILD_ARTIFACT: 'id-repository'
fail-fast: false
name: ${{ matrix.SERVICE_NAME }}
- uses: mosip/kattu/.github/workflows/docker-build.yml@master
+ uses: mosip/kattu/.github/workflows/docker-build.yml@master-java21
with:
SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }}
SERVICE_NAME: ${{ matrix.SERVICE_NAME }}
@@ -87,7 +87,7 @@ jobs:
sonar_analysis:
needs: build-maven-id-repository
if: "${{ github.event_name != 'pull_request' }}"
- uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master
+ uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master-java21
with:
SERVICE_LOCATION: ./id-repository
secrets:
diff --git a/apitest/Dockerfile b/apitest/Dockerfile
index 2af566cab..cbeb1f59a 100644
--- a/apitest/Dockerfile
+++ b/apitest/Dockerfile
@@ -59,4 +59,4 @@ ENV ENV_USER=
ENV ENV_ENDPOINT=
ENV ENV_TESTLEVEL=smokeAndRegression
-ENTRYPOINT ["./entrypoint.sh"]
+ENTRYPOINT ["./entrypoint.sh"]
\ No newline at end of file
diff --git a/apitest/pom.xml b/apitest/pom.xml
index 4496eaa3d..f07f14ce9 100644
--- a/apitest/pom.xml
+++ b/apitest/pom.xml
@@ -1,223 +1,223 @@
- 4.0.0
- io.mosip.idrepo
- apitest-idrepo
- jar
- apitest-idrepo
- Parent project of apitest-idrepo
- https://github.com/mosip/id-repository
- 1.2.1-SNAPSHOT
-
-
-
- MPL 2.0
- https://www.mozilla.org/en-US/MPL/2.0/
-
-
-
-
- scm:git:git://github.com/mosip/id-repository.git
- scm:git:ssh://github.com:mosip/id-repository.git
- https://github.com/mosip/id-repository
- HEAD
-
-
-
-
- Mosip
- mosip.emailnotifier@gmail.com
- io.mosip
- https://github.com/mosip/id-repository
-
-
-
-
-
-
- UTF-8
-
-
- 11
- 11
- 3.7.0
- 3.0.2
- 3.1.0
- 2.9
- 0.8.1
- 3.2
- 3.0.1
- 2.3
- false
- 3.7.0.1746
-
- 2.0.2.RELEASE
- 2.0.7.RELEASE
- 5.0.5.RELEASE
- 2.0.0.RELEASE
-
- 2.0.7
- 1.5.20
- 2.9.2
-
- 3.6.2
- 3.7.0
-
-
-
- 1.2
- 3.0.0
- 1.3
- 2.2
- 2.0.1.Final
- 2.2.6
-
-
- 1.4.197
- 5.1.46
- 42.2.2
- 2.5.0
- 6.0.12.Final
-
-
- 1.10.19
- 1.7.4
- 2.0.0-beta.5
-
-
- 3.6.1
- 3.7
- 2.6
- 1.11
- 4.3
- 1.9.2
- 2.2
- 4.5.6
- 19.0
- 1.18.8
- 0.1.54
- 1.4.0
- 7.1.0
- 2.0.0
- 5.5.13
- 2.3.23
- 1.7
- 2.0
- 1.5.2
- 2.1.1
- 1.60
- 63.1
- 1.0.0
- 3.3.3
- 2.8.1
- 4.1.0-incubating
- 1.11.368
- 0.2.4
- 2.3.0
- 3.0.1
- 1.9.12
- 0.6.0
- 2.0.0.AM2
-
-
-
-
-
-
-
- 0.8.2
- 2.2
- 3.2
- UTF-8
- 3.7.0
- 3.0.1
-
-
- 1.1.6
- 1.7.19
- 1.10.19
-
-
- 1.4.6
-
-
- 5.0.6.RELEASE
-
-
- 5.4.2.Final
-
-
- 2.1.1
-
-
- 10.13.1.1
-
-
- 3.4.0
-
-
- 1.3.5
-
-
- 0.3.12
-
-
- 0.3.0
-
-
- 1.1.2-incubating
- 1.2.0.1-B1
- 0.4.7
- 3.0.0
- 2.41.2
- 2.4.0
- 3.3.9
- 3.0.7
- 6.11
- 1.13
- apitest-idrepo-1.2.0.1-SNAPSHOT-jar-with-dependencies
-
-
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-
-
- attach-javadocs
-
- jar
-
-
-
-
- none
-
-
-
- maven-compiler-plugin
- 3.5.1
-
-
- 11
- -Dfile.encoding=UTF-8
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 3.2.0
-
- none
-
-
-
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
+ io.mosip.idrepo
+ apitest-idrepo
+ jar
+ apitest-idrepo
+ Parent project of apitest-idrepo
+ https://github.com/mosip/id-repository
+ 1.2.1-SNAPSHOT
+
+
+
+ MPL 2.0
+ https://www.mozilla.org/en-US/MPL/2.0/
+
+
+
+
+ scm:git:git://github.com/mosip/id-repository.git
+ scm:git:ssh://github.com:mosip/id-repository.git
+ https://github.com/mosip/id-repository
+ HEAD
+
+
+
+
+ Mosip
+ mosip.emailnotifier@gmail.com
+ io.mosip
+ https://github.com/mosip/id-repository
+
+
+
+
+
+
+ UTF-8
+
+
+ 11
+ 11
+ 3.7.0
+ 3.0.2
+ 3.1.0
+ 2.9
+ 0.8.1
+ 3.2
+ 3.0.1
+ 2.3
+ false
+ 3.7.0.1746
+
+ 2.0.2.RELEASE
+ 2.0.7.RELEASE
+ 5.0.5.RELEASE
+ 2.0.0.RELEASE
+
+ 2.0.7
+ 1.5.20
+ 2.9.2
+
+ 3.6.2
+ 3.7.0
+
+
+
+ 1.2
+ 3.0.0
+ 1.3
+ 2.2
+ 2.0.1.Final
+ 2.2.6
+
+
+ 1.4.197
+ 5.1.46
+ 42.2.2
+ 2.5.0
+ 6.0.12.Final
+
+
+ 1.10.19
+ 1.7.4
+ 2.0.0-beta.5
+
+
+ 3.6.1
+ 3.7
+ 2.6
+ 1.11
+ 4.3
+ 1.9.2
+ 2.2
+ 4.5.6
+ 19.0
+ 1.18.8
+ 0.1.54
+ 1.4.0
+ 7.1.0
+ 2.0.0
+ 5.5.13
+ 2.3.23
+ 1.7
+ 2.0
+ 1.5.2
+ 2.1.1
+ 1.60
+ 63.1
+ 1.0.0
+ 3.3.3
+ 2.8.1
+ 4.1.0-incubating
+ 1.11.368
+ 0.2.4
+ 2.3.0
+ 3.0.1
+ 1.9.12
+ 0.6.0
+ 2.0.0.AM2
+
+
+
+
+
+
+
+ 0.8.2
+ 2.2
+ 3.2
+ UTF-8
+ 3.7.0
+ 3.0.1
+
+
+ 1.1.6
+ 1.7.19
+ 1.10.19
+
+
+ 1.4.6
+
+
+ 5.0.6.RELEASE
+
+
+ 5.4.2.Final
+
+
+ 2.1.1
+
+
+ 10.13.1.1
+
+
+ 3.4.0
+
+
+ 1.3.5
+
+
+ 0.3.12
+
+
+ 0.3.0
+
+
+ 1.1.2-incubating
+ 1.2.0.1-B1
+ 0.4.7
+ 3.0.0
+ 2.41.2
+ 2.4.0
+ 3.3.9
+ 3.0.7
+ 6.11
+ 1.13
+ apitest-idrepo-1.2.0.1-SNAPSHOT-jar-with-dependencies
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+ none
+
+
+
+ maven-compiler-plugin
+ 3.5.1
+
+
+ 11
+ -Dfile.encoding=UTF-8
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.2.0
+
+ none
+
+
+
pl.project13.maven
git-commit-id-plugin
3.0.1
@@ -241,156 +241,156 @@
-
- org.apache.maven.plugins
- maven-gpg-plugin
- 1.5
-
-
- sign-artifacts
- verify
-
- sign
-
-
-
- --pinentry-mode
- loopback
-
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-shade-plugin
- 3.2.4
-
-
-
- shade
-
-
- ${fileName}
-
-
-
-
-
- io.mosip.testrig.apirig.testrunner.MosipTestRunner
-
-
-
-
-
- *:*
-
- META-INF/*.SF
- META-INF/*.DSA
- META-INF/*.RSA
-
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
- ${maven.jar.plugin.version}
-
-
-
- true
- true
-
-
- ${project.name}
- ${project.version}
- ${user.name}
- ${os.name}
- ${maven.build.timestamp}
- ${env.BUILD_NUMBER}
- ${env.BUILD_ID}
- ${env.BUILD_URL}
-
-
-
-
-
- org.apache.maven.plugins
- maven-war-plugin
- ${maven.war.plugin.version}
-
-
-
- true
- true
-
-
- ${project.name}
- ${project.version}
- ${user.name}
- ${os.name}
- ${maven.build.timestamp}
- ${env.BUILD_NUMBER}
- ${env.BUILD_ID}
- ${env.BUILD_URL}
-
-
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 2.2.1
-
-
- attach-sources
-
- jar-no-fork
-
-
-
-
-
- org.apache.maven.plugins
- maven-antrun-plugin
- 3.0.0
-
-
- make-jar-executable
- package
-
- run
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- io.mosip.testrig.apirig.apitest.commons
- apitest-commons
- 1.2.1-SNAPSHOT
-
-
-
-
-
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 1.5
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+ --pinentry-mode
+ loopback
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+ 3.2.4
+
+
+
+ shade
+
+
+ ${fileName}
+
+
+
+
+
+ io.mosip.testrig.apirig.testrunner.MosipTestRunner
+
+
+
+
+
+ *:*
+
+ META-INF/*.SF
+ META-INF/*.DSA
+ META-INF/*.RSA
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ ${maven.jar.plugin.version}
+
+
+
+ true
+ true
+
+
+ ${project.name}
+ ${project.version}
+ ${user.name}
+ ${os.name}
+ ${maven.build.timestamp}
+ ${env.BUILD_NUMBER}
+ ${env.BUILD_ID}
+ ${env.BUILD_URL}
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+ ${maven.war.plugin.version}
+
+
+
+ true
+ true
+
+
+ ${project.name}
+ ${project.version}
+ ${user.name}
+ ${os.name}
+ ${maven.build.timestamp}
+ ${env.BUILD_NUMBER}
+ ${env.BUILD_ID}
+ ${env.BUILD_URL}
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 2.2.1
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin
+ 3.0.0
+
+
+ make-jar-executable
+ package
+
+ run
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ io.mosip.testrig.apirig.apitest.commons
+ apitest-commons
+ 1.2.1-SNAPSHOT
+
+
+
+
+
\ No newline at end of file
diff --git a/db_scripts/mosip_credential/ddl/credential-batch_job_execution.sql b/db_scripts/mosip_credential/ddl/credential-batch_job_execution.sql
index bc6ada2ba..721f69732 100644
--- a/db_scripts/mosip_credential/ddl/credential-batch_job_execution.sql
+++ b/db_scripts/mosip_credential/ddl/credential-batch_job_execution.sql
@@ -3,17 +3,16 @@
-- DROP TABLE credential.batch_job_execution;
CREATE TABLE credential.batch_job_execution (
- JOB_EXECUTION_ID BIGINT PRIMARY KEY ,
- VERSION BIGINT,
- JOB_INSTANCE_ID BIGINT NOT NULL,
- CREATE_TIME TIMESTAMP NOT NULL,
- START_TIME TIMESTAMP DEFAULT NULL,
- END_TIME TIMESTAMP DEFAULT NULL,
- STATUS VARCHAR(10),
- EXIT_CODE VARCHAR(20),
- EXIT_MESSAGE VARCHAR(2500),
- LAST_UPDATED TIMESTAMP,
- JOB_CONFIGURATION_LOCATION VARCHAR(2500) NULL
+ JOB_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY,
+ VERSION BIGINT,
+ JOB_INSTANCE_ID BIGINT NOT NULL,
+ CREATE_TIME TIMESTAMP NOT NULL,
+ START_TIME TIMESTAMP DEFAULT NULL,
+ END_TIME TIMESTAMP DEFAULT NULL,
+ STATUS VARCHAR(10),
+ EXIT_CODE VARCHAR(2500),
+ EXIT_MESSAGE VARCHAR(2500),
+ LAST_UPDATED TIMESTAMP
)
WITH (
OIDS = FALSE
diff --git a/db_scripts/mosip_credential/ddl/credential-batch_job_execution_context.sql b/db_scripts/mosip_credential/ddl/credential-batch_job_execution_context.sql
index 451e21ec5..8e4d9d947 100644
--- a/db_scripts/mosip_credential/ddl/credential-batch_job_execution_context.sql
+++ b/db_scripts/mosip_credential/ddl/credential-batch_job_execution_context.sql
@@ -4,10 +4,9 @@
CREATE TABLE credential.batch_job_execution_context
(
- job_execution_id bigint NOT NULL,
- short_context character varying(2500) COLLATE pg_catalog."default" NOT NULL,
- serialized_context text COLLATE pg_catalog."default",
- CONSTRAINT batch_job_execution_context_pkey PRIMARY KEY (job_execution_id)
+ JOB_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY,
+ SHORT_CONTEXT VARCHAR(2500) NOT NULL,
+ SERIALIZED_CONTEXT TEXT
)
WITH (
OIDS = FALSE
diff --git a/db_scripts/mosip_credential/ddl/credential-batch_job_execution_params.sql b/db_scripts/mosip_credential/ddl/credential-batch_job_execution_params.sql
index caaf5a908..2c9085074 100644
--- a/db_scripts/mosip_credential/ddl/credential-batch_job_execution_params.sql
+++ b/db_scripts/mosip_credential/ddl/credential-batch_job_execution_params.sql
@@ -3,13 +3,10 @@
-- DROP TABLE credential.batch_job_execution_params;
CREATE TABLE credential.batch_job_execution_params (
- JOB_EXECUTION_ID BIGINT NOT NULL ,
- TYPE_CD VARCHAR(6) NOT NULL ,
- KEY_NAME VARCHAR(100) NOT NULL ,
- STRING_VAL VARCHAR(250) ,
- DATE_VAL TIMESTAMP DEFAULT NULL ,
- LONG_VAL BIGINT ,
- DOUBLE_VAL DOUBLE PRECISION ,
+ JOB_EXECUTION_ID BIGINT NOT NULL,
+ PARAMETER_NAME VARCHAR(100) NOT NULL,
+ PARAMETER_TYPE VARCHAR(100) NOT NULL,
+ PARAMETER_VALUE VARCHAR(2500),
IDENTIFYING CHAR(1) NOT NULL
)
WITH (
diff --git a/db_scripts/mosip_credential/ddl/credential-batch_job_instance.sql b/db_scripts/mosip_credential/ddl/credential-batch_job_instance.sql
index 6fe2cecc2..705fae4f4 100644
--- a/db_scripts/mosip_credential/ddl/credential-batch_job_instance.sql
+++ b/db_scripts/mosip_credential/ddl/credential-batch_job_instance.sql
@@ -3,10 +3,11 @@
-- DROP TABLE credential.batch_job_instance;
CREATE TABLE credential.batch_job_instance (
- JOB_INSTANCE_ID BIGINT PRIMARY KEY ,
- VERSION BIGINT,
- JOB_NAME VARCHAR(100) NOT NULL ,
- JOB_KEY VARCHAR(2500)
+ JOB_INSTANCE_ID BIGINT NOT NULL PRIMARY KEY,
+ VERSION BIGINT,
+ JOB_NAME VARCHAR(100) NOT NULL,
+ JOB_KEY VARCHAR(32) NOT NULL,
+ constraint JOB_INST_UN unique (JOB_NAME, JOB_KEY)
)
WITH (
OIDS = FALSE
diff --git a/db_scripts/mosip_credential/ddl/credential-batch_step_execution.sql b/db_scripts/mosip_credential/ddl/credential-batch_step_execution.sql
index 6ae64fb5f..a90116107 100644
--- a/db_scripts/mosip_credential/ddl/credential-batch_step_execution.sql
+++ b/db_scripts/mosip_credential/ddl/credential-batch_step_execution.sql
@@ -3,24 +3,25 @@
-- DROP TABLE credential.batch_step_execution;
CREATE TABLE credential.batch_step_execution (
- STEP_EXECUTION_ID BIGINT PRIMARY KEY ,
- VERSION BIGINT NOT NULL,
- STEP_NAME VARCHAR(100) NOT NULL,
- JOB_EXECUTION_ID BIGINT NOT NULL,
- START_TIME TIMESTAMP NOT NULL ,
- END_TIME TIMESTAMP DEFAULT NULL,
- STATUS VARCHAR(10),
- COMMIT_COUNT BIGINT ,
- READ_COUNT BIGINT ,
- FILTER_COUNT BIGINT ,
- WRITE_COUNT BIGINT ,
- READ_SKIP_COUNT BIGINT ,
- WRITE_SKIP_COUNT BIGINT ,
- PROCESS_SKIP_COUNT BIGINT ,
- ROLLBACK_COUNT BIGINT ,
- EXIT_CODE VARCHAR(20) ,
- EXIT_MESSAGE VARCHAR(2500) ,
- LAST_UPDATED TIMESTAMP
+ STEP_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY,
+ VERSION BIGINT NOT NULL,
+ STEP_NAME VARCHAR(100) NOT NULL,
+ JOB_EXECUTION_ID BIGINT NOT NULL,
+ CREATE_TIME TIMESTAMP NOT NULL,
+ START_TIME TIMESTAMP DEFAULT NULL ,
+ END_TIME TIMESTAMP DEFAULT NULL ,
+ STATUS VARCHAR(10),
+ COMMIT_COUNT BIGINT,
+ READ_COUNT BIGINT,
+ FILTER_COUNT BIGINT,
+ WRITE_COUNT BIGINT,
+ READ_SKIP_COUNT BIGINT,
+ WRITE_SKIP_COUNT BIGINT,
+ PROCESS_SKIP_COUNT BIGINT,
+ ROLLBACK_COUNT BIGINT,
+ EXIT_CODE VARCHAR(2500),
+ EXIT_MESSAGE VARCHAR(2500),
+ LAST_UPDATED TIMESTAMP
)
WITH (
OIDS = FALSE
diff --git a/db_scripts/mosip_credential/ddl/credential-batch_step_execution_context.sql b/db_scripts/mosip_credential/ddl/credential-batch_step_execution_context.sql
index b89baab4c..3c4b37c83 100644
--- a/db_scripts/mosip_credential/ddl/credential-batch_step_execution_context.sql
+++ b/db_scripts/mosip_credential/ddl/credential-batch_step_execution_context.sql
@@ -4,11 +4,9 @@
CREATE TABLE credential.batch_step_execution_context
(
- step_execution_id bigint NOT NULL,
- short_context character varying(2500) COLLATE pg_catalog."default" NOT NULL,
- serialized_context text COLLATE pg_catalog."default",
- CONSTRAINT batch_step_execution_context_pkey PRIMARY KEY (step_execution_id)
-
+ STEP_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY,
+ SHORT_CONTEXT VARCHAR(2500) NOT NULL,
+ SERIALIZED_CONTEXT TEXT
)
WITH (
OIDS = FALSE
diff --git a/db_scripts/mosip_credential/ddl/credential-credential_transaction.sql b/db_scripts/mosip_credential/ddl/credential-credential_transaction.sql
index 335d52b91..9485299ca 100644
--- a/db_scripts/mosip_credential/ddl/credential-credential_transaction.sql
+++ b/db_scripts/mosip_credential/ddl/credential-credential_transaction.sql
@@ -31,7 +31,6 @@ CREATE TABLE credential.credential_transaction(
del_dtimes timestamp,
status_comment character varying(512),
CONSTRAINT pk_credtrn_id PRIMARY KEY (id)
-
);
CREATE INDEX cred_tran_NEW_status_cr_dtimes ON credential.credential_transaction USING btree (cr_dtimes) WHERE status_code = 'NEW';
diff --git a/db_scripts/mosip_credential/ddl/credential-fk.sql b/db_scripts/mosip_credential/ddl/credential-fk.sql
index c4ec54b56..786e2c19c 100644
--- a/db_scripts/mosip_credential/ddl/credential-fk.sql
+++ b/db_scripts/mosip_credential/ddl/credential-fk.sql
@@ -15,31 +15,31 @@
-- object: STEP_EXEC_CTX_FK | type: CONSTRAINT --
-- ALTER TABLE credential.batch_step_execution_context DROP CONSTRAINT IF EXISTS STEP_EXEC_CTX_FK CASCADE;
ALTER TABLE credential.batch_step_execution_context ADD CONSTRAINT STEP_EXEC_CTX_FK FOREIGN KEY (STEP_EXECUTION_ID)
-REFERENCES BATCH_STEP_EXECUTION(STEP_EXECUTION_ID);
+REFERENCES credential.BATCH_STEP_EXECUTION(STEP_EXECUTION_ID);
-- ddl-end --
-- object: JOB_EXEC_CTX_FK | type: CONSTRAINT --
-- ALTER TABLE credential.batch_job_execution_context DROP CONSTRAINT IF EXISTS JOB_EXEC_CTX_FK CASCADE;
ALTER TABLE credential.batch_job_execution_context ADD CONSTRAINT JOB_EXEC_CTX_FK FOREIGN KEY (JOB_EXECUTION_ID)
-REFERENCES BATCH_JOB_EXECUTION(JOB_EXECUTION_ID);
+REFERENCES credential.BATCH_JOB_EXECUTION(JOB_EXECUTION_ID);
-- ddl-end --
-- object: JOB_INSTANCE_EXECUTION_FK | type: CONSTRAINT --
-- ALTER TABLE credential.batch_job_execution DROP CONSTRAINT IF EXISTS JOB_INSTANCE_EXECUTION_FK CASCADE;
-ALTER TABLE credential.batch_job_execution ADD CONSTRAINT JOB_INSTANCE_EXECUTION_FK FOREIGN KEY (JOB_INSTANCE_ID)
-REFERENCES BATCH_JOB_INSTANCE(JOB_INSTANCE_ID);
+ALTER TABLE credential.batch_job_execution ADD CONSTRAINT JOB_INST_EXEC_FK FOREIGN KEY (JOB_INSTANCE_ID)
+REFERENCES credential.BATCH_JOB_INSTANCE(JOB_INSTANCE_ID);
-- ddl-end --
-- object: JOB_EXECUTION_STEP_FK | type: CONSTRAINT --
-- ALTER TABLE credential.batch_step_execution DROP CONSTRAINT IF EXISTS JOB_EXECUTION_STEP_FK CASCADE;
ALTER TABLE credential.batch_step_execution ADD CONSTRAINT JOB_EXECUTION_STEP_FK FOREIGN KEY (JOB_EXECUTION_ID)
-REFERENCES BATCH_JOB_EXECUTION(JOB_EXECUTION_ID);
+REFERENCES credential.BATCH_JOB_EXECUTION(JOB_EXECUTION_ID);
-- ddl-end --
-- object: JOB_EXEC_PARAMS_FK | type: CONSTRAINT --
-- ALTER TABLE credential.batch_job_execution_params DROP CONSTRAINT IF EXISTS JOB_EXEC_PARAMS_FK CASCADE;
ALTER TABLE credential.batch_job_execution_params ADD CONSTRAINT JOB_EXEC_PARAMS_FK FOREIGN KEY (JOB_EXECUTION_ID)
-REFERENCES BATCH_JOB_EXECUTION(JOB_EXECUTION_ID);
+REFERENCES credential.BATCH_JOB_EXECUTION(JOB_EXECUTION_ID);
-- ddl-end --
CREATE SEQUENCE credential.batch_job_seq;
diff --git a/db_upgrade_scripts/mosip_credential/sql/1.2.0.1_to_1.3.0_rollback.sql b/db_upgrade_scripts/mosip_credential/sql/1.2.0.1_to_1.3.0_rollback.sql
new file mode 100644
index 000000000..04876d6c6
--- /dev/null
+++ b/db_upgrade_scripts/mosip_credential/sql/1.2.0.1_to_1.3.0_rollback.sql
@@ -0,0 +1,22 @@
+-- ------------------------------------------------------------------------------------------
+-- Revoke script for Migrating Spring batch version to 5.0 as part of Java 21 Migration.
+-- References:
+-- 1. https://github.com/spring-projects/spring-batch/wiki/Spring-Batch-5.0-Migration-Guide#ms-sqlserver
+-- 2. https://github.com/spring-projects/spring-batch/blob/main/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/5.0/migration-postgresql.sql
+-- ------------------------------------------------------------------------------------------
+ALTER TABLE BATCH_STEP_EXECUTION DROP CREATE_TIME TIMESTAMP NOT NULL DEFAULT '1970-01-01 00:00:00';
+ALTER TABLE BATCH_STEP_EXECUTION ALTER COLUMN START_TIME ADD NULL;
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ADD COLUMN DATE_VAL;
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ADD COLUMN LONG_VAL;
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ADD COLUMN DOUBLE_VAL;
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN TYPE_CD TYPE VARCHAR(6);
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME PARAMETER_TYPE TO TYPE_CD;
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN KEY_NAME TYPE VARCHAR(100);
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME PARAMETER_NAME TO KEY_NAME;
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN STRING_VAL TYPE VARCHAR(250);
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME PARAMETER_VALUE TO STRING_VAL;
+ALTER TABLE BATCH_JOB_EXECUTION ADD COLUMN JOB_CONFIGURATION_LOCATION;
+
+DROP SEQUENCE BATCH_STEP_EXECUTION_SEQ;
+DROP SEQUENCE BATCH_JOB_EXECUTION_SEQ;
+DROP SEQUENCE BATCH_JOB_SEQ;
\ No newline at end of file
diff --git a/db_upgrade_scripts/mosip_credential/sql/1.2.0.1_to_1.3.0_upgrade.sql b/db_upgrade_scripts/mosip_credential/sql/1.2.0.1_to_1.3.0_upgrade.sql
new file mode 100644
index 000000000..91ffdc28a
--- /dev/null
+++ b/db_upgrade_scripts/mosip_credential/sql/1.2.0.1_to_1.3.0_upgrade.sql
@@ -0,0 +1,22 @@
+-- ------------------------------------------------------------------------------------------
+-- Upgrade script for Migrating Spring batch version to 5.0 as part of Java 21 Migration.
+-- References:
+-- 1. https://github.com/spring-projects/spring-batch/wiki/Spring-Batch-5.0-Migration-Guide#ms-sqlserver
+-- 2. https://github.com/spring-projects/spring-batch/blob/main/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/5.0/migration-postgresql.sql
+-- ------------------------------------------------------------------------------------------
+ALTER TABLE BATCH_STEP_EXECUTION ADD CREATE_TIME TIMESTAMP NOT NULL DEFAULT '1970-01-01 00:00:00';
+ALTER TABLE BATCH_STEP_EXECUTION ALTER COLUMN START_TIME DROP NOT NULL;
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS DROP COLUMN DATE_VAL;
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS DROP COLUMN LONG_VAL;
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS DROP COLUMN DOUBLE_VAL;
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN TYPE_CD TYPE VARCHAR(100);
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME TYPE_CD TO PARAMETER_TYPE;
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN KEY_NAME TYPE VARCHAR(100);
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME KEY_NAME TO PARAMETER_NAME;
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN STRING_VAL TYPE VARCHAR(2500);
+ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME STRING_VAL TO PARAMETER_VALUE;
+ALTER TABLE BATCH_JOB_EXECUTION DROP COLUMN JOB_CONFIGURATION_LOCATION;
+
+CREATE SEQUENCE BATCH_STEP_EXECUTION_SEQ START WITH 0 MINVALUE 0 MAXVALUE 9223372036854775807 NO CYCLE;
+CREATE SEQUENCE BATCH_JOB_EXECUTION_SEQ START WITH 0 MINVALUE 0 MAXVALUE 9223372036854775807 NO CYCLE;
+CREATE SEQUENCE BATCH_JOB_SEQ START WITH 0 MINVALUE 0 MAXVALUE 9223372036854775807 NO CYCLE;
\ No newline at end of file
diff --git a/id-repository/credential-request-generator/Dockerfile b/id-repository/credential-request-generator/Dockerfile
index 7d37dce2c..2f839e124 100644
--- a/id-repository/credential-request-generator/Dockerfile
+++ b/id-repository/credential-request-generator/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:11
+FROM eclipse-temurin:21-jre-alpine
ARG SOURCE
ARG COMMIT_HASH
@@ -48,16 +48,16 @@ ARG container_user=mosip
ARG container_user_group=mosip
# can be passed during Docker build as build time environment for github branch to pickup configuration from.
-ARG container_user_uid=1001
+ARG container_user_uid=1002
# can be passed during Docker build as build time environment for github branch to pickup configuration from.
ARG container_user_gid=1001
# install packages and create user
-RUN apt-get -y update \
-&& apt-get install -y unzip \
-&& groupadd -g ${container_user_gid} ${container_user_group} \
-&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user}
+RUN apk -q update \
+&& apk add -q unzip \
+&& addgroup -g ${container_user_gid} ${container_user_group} \
+&& adduser -s /bin/sh -u ${container_user_uid} -G ${container_user_group} -h /home/${container_user} --disabled-password ${container_user}
# set working directory for the user
WORKDIR /home/${container_user}
@@ -89,10 +89,10 @@ CMD if [ "$is_glowroot_env" = "present" ]; then \
rm -rf glowroot.zip ; \
sed -i 's//credential-request-generator/g' glowroot/glowroot.properties ; \
wget -q --show-progress "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \
- java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -jar -javaagent:glowroot/glowroot.jar credential-request-generator.jar ; \
+ java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" --add-opens java.base/sun.reflect.annotation=ALL-UNNAMED -jar -javaagent:glowroot/glowroot.jar credential-request-generator.jar ; \
else \
wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \
- java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -jar credential-request-generator.jar ; \
+ java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" --add-opens java.base/sun.reflect.annotation=ALL-UNNAMED -jar credential-request-generator.jar ; \
fi
diff --git a/id-repository/credential-request-generator/pom.xml b/id-repository/credential-request-generator/pom.xml
index b6b578e12..8e4f49b8f 100644
--- a/id-repository/credential-request-generator/pom.xml
+++ b/id-repository/credential-request-generator/pom.xml
@@ -16,14 +16,13 @@
UTF-8
- 11
- 11
+ 21
+ 21
2.0.2.RELEASE
2.0.7.RELEASE
5.0.5.RELEASE
2.0.0.RELEASE
1.4.197
- 2.9.8
2.9.2
1.2.1-SNAPSHOT
1.7.4
@@ -40,26 +39,6 @@
-
- com.fasterxml.jackson.core
- jackson-databind
- 2.12.0
-
-
- com.fasterxml.jackson.core
- jackson-annotations
- 2.12.0
-
-
- com.fasterxml.jackson.core
- jackson-core
- 2.12.0
-
-
- com.fasterxml.jackson.datatype
- jackson-datatype-jsr310
- 2.12.0
-
org.springframework.cloud
spring-cloud-starter-config
@@ -71,12 +50,7 @@
${mockito.version}
test
-
- com.fasterxml.jackson.module
- jackson-module-afterburner
- 2.12.0
-
-
+
com.h2database
h2
${h2.version}
@@ -84,30 +58,10 @@
-
- com.fasterxml.jackson.core
- jackson-databind
- 2.12.0
-
-
- com.fasterxml.jackson.core
- jackson-annotations
- 2.12.0
-
-
- com.fasterxml.jackson.core
- jackson-core
- 2.12.0
-
-
- com.fasterxml.jackson.datatype
- jackson-datatype-jsr310
- 2.12.0
-
+
junit
junit
- 3.8.1
test
@@ -128,17 +82,14 @@
org.springframework.cloud
spring-cloud-starter-config
- ${spring-cloud-config.version}
org.springframework.boot
spring-boot-starter-data-jpa
- ${spring.boot.version}
org.springframework.boot
spring-boot-starter-web
- ${spring.boot.version}
io.springfox
@@ -153,23 +104,19 @@
com.h2database
h2
- ${h2.version}
runtime
org.springframework.boot
spring-boot-starter-batch
- ${spring.boot.version}
javax.xml.bind
jaxb-api
- 2.3.0
org.apache.httpcomponents
httpclient
- ${apache.httpcomponents.version}
io.mosip.kernel
@@ -179,24 +126,20 @@
com.googlecode.json-simple
json-simple
- 1.1.1
com.google.code.gson
gson
- ${gson.version}
junit
junit
- ${junit.version}
test
org.springframework.boot
spring-boot-starter-test
test
- ${spring.boot.version}
org.mockito
@@ -218,17 +161,14 @@
org.postgresql
postgresql
- ${postgresql.version}
io.micrometer
micrometer-core
- ${io.micrometer.prometheus.version}
io.micrometer
micrometer-registry-prometheus
- ${io.micrometer.prometheus.version}
io.mosip.kernel
@@ -238,7 +178,6 @@
org.springframework.batch
spring-batch-integration
- ${spring.batch.integration.version}
org.springframework
@@ -249,29 +188,24 @@
org.springframework
spring-context
- 5.0.6.RELEASE
io.projectreactor
reactor-core
- 3.1.6.RELEASE
org.springframework
spring-jdbc
- 4.3.8.RELEASE
-
-
- org.springdoc
- springdoc-openapi-ui
- ${springdoc.version}
org.springframework.boot
spring-boot-configuration-processor
- ${spring.boot.version}
true
+
+ org.hibernate.validator
+ hibernate-validator
+
diff --git a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/CredentialRequestGeneratorBootApplication.java b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/CredentialRequestGeneratorBootApplication.java
new file mode 100644
index 000000000..3ef22309a
--- /dev/null
+++ b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/CredentialRequestGeneratorBootApplication.java
@@ -0,0 +1,44 @@
+package io.mosip.credential.request.generator;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.domain.EntityScan;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.FilterType;
+import org.springframework.context.annotation.Import;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+import io.mosip.credential.request.generator.api.config.CredentialRequestGeneratorConfig;
+import io.mosip.credential.request.generator.entity.CredentialEntity;
+import io.mosip.idrepository.core.config.IdRepoDataSourceConfig;
+import io.mosip.idrepository.core.helper.RestHelper;
+import io.mosip.idrepository.core.security.IdRepoSecurityManager;
+import io.mosip.idrepository.core.util.DummyPartnerCheckUtil;
+import io.mosip.kernel.dataaccess.hibernate.config.HibernateDaoConfig;
+import io.mosip.kernel.dataaccess.hibernate.repository.impl.HibernateRepositoryImpl;
+
+/**
+ * The Class CredentialRequestGeneratorApp.
+ *
+ */
+@SpringBootApplication
+@Import(value = { java.lang.String.class, DummyPartnerCheckUtil.class, RestHelper.class, IdRepoSecurityManager.class,
+ CredentialRequestGeneratorConfig.class })
+@ComponentScan(basePackages = { "io.mosip.credential.*", "${mosip.auth.adapter.impl.basepackage}" }, excludeFilters = {
+ @ComponentScan.Filter(type = FilterType.ASPECTJ, pattern = { "io.mosip.kernel.dataaccess.hibernate.config.*" }),
+ @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = { HibernateDaoConfig.class,
+ IdRepoDataSourceConfig.class }) })
+
+@EnableScheduling
+public class CredentialRequestGeneratorBootApplication {
+
+ /**
+ * The main method.
+ *
+ * @param args the arguments
+ */
+ public static void main(String[] args) {
+ SpringApplication.run(CredentialRequestGeneratorBootApplication.class, args);
+ }
+}
diff --git a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/api/CredentialRequestGeneratorBootApplication.java b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/api/CredentialRequestGeneratorBootApplication.java
deleted file mode 100644
index 56e037fbd..000000000
--- a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/api/CredentialRequestGeneratorBootApplication.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package io.mosip.credential.request.generator.api;
-
-import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.FilterType;
-import org.springframework.context.annotation.Import;
-import org.springframework.scheduling.annotation.EnableScheduling;
-
-import io.mosip.idrepository.core.helper.RestHelper;
-import io.mosip.idrepository.core.security.IdRepoSecurityManager;
-import io.mosip.idrepository.core.util.DummyPartnerCheckUtil;
-import io.mosip.kernel.dataaccess.hibernate.config.HibernateDaoConfig;
-
-/**
- * The Class CredentialRequestGeneratorApp.
- *
- * @author Sowmya
- */
-@SpringBootApplication(exclude = HibernateDaoConfig.class)
-@Import(value = { java.lang.String.class, DummyPartnerCheckUtil.class, RestHelper.class, IdRepoSecurityManager.class })
-@ComponentScan(basePackages = { "io.mosip.*",
-"${mosip.auth.adapter.impl.basepackage}" }, excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = {
- "io.mosip.idrepository.core.config.IdRepoDataSourceConfig.*", "io.mosip.kernel.dataaccess.hibernate.config.*" }))
-@EnableBatchProcessing
-@EnableScheduling
-public class CredentialRequestGeneratorBootApplication {
-
- /**
- * The main method.
- *
- * @param args the arguments
- */
- public static void main(String[] args) {
- SpringApplication.run(CredentialRequestGeneratorBootApplication.class, args);
- }
-}
diff --git a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/api/config/CredentialRequestGeneratorConfig.java b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/api/config/CredentialRequestGeneratorConfig.java
index 15b0ac6a9..35e65f00c 100644
--- a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/api/config/CredentialRequestGeneratorConfig.java
+++ b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/api/config/CredentialRequestGeneratorConfig.java
@@ -6,17 +6,18 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springdoc.core.GroupedOpenApi;
+import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.FilterType;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import io.mosip.credential.request.generator.entity.CredentialEntity;
import io.mosip.credential.request.generator.interceptor.CredentialTransactionInterceptor;
-import io.mosip.credential.request.generator.repositary.CredentialRepositary;
import io.mosip.credential.request.generator.util.RestUtil;
import io.mosip.idrepository.core.builder.RestRequestBuilder;
import io.mosip.idrepository.core.constant.RestServicesConstants;
@@ -29,8 +30,8 @@
import io.swagger.v3.oas.models.servers.Server;
@Configuration
-@EnableJpaRepositories(entityManagerFactoryRef = "entityManagerFactory", basePackageClasses = {
- CredentialRepositary.class }, basePackages = "io.mosip.credential.request.generator.repositary.*", repositoryBaseClass = HibernateRepositoryImpl.class)
+@EnableJpaRepositories(entityManagerFactoryRef = "entityManagerFactory", basePackages = "io.mosip.credential.request.generator.repositary.*", repositoryBaseClass = HibernateRepositoryImpl.class, excludeFilters = {
+ @ComponentScan.Filter(type = FilterType.ASPECTJ, pattern = { "io.mosip.idrepository.core.repository.*" }) })
@EntityScan(basePackageClasses = { CredentialEntity.class })
public class CredentialRequestGeneratorConfig extends HibernateDaoConfig {
@@ -46,7 +47,7 @@ public class CredentialRequestGeneratorConfig extends HibernateDaoConfig {
@Override
public Map jpaProperties() {
Map jpaProperties = super.jpaProperties();
- jpaProperties.put("hibernate.ejb.interceptor", new CredentialTransactionInterceptor(restUtil));
+ jpaProperties.put("hibernate.session_factory.interceptor", new CredentialTransactionInterceptor(restUtil));
return jpaProperties;
}
diff --git a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/BatchConfiguration.java b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/BatchConfiguration.java
index 95f4860dd..8bf8470b0 100644
--- a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/BatchConfiguration.java
+++ b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/BatchConfiguration.java
@@ -1,128 +1,48 @@
package io.mosip.credential.request.generator.batch.config;
import java.lang.reflect.Field;
+import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
import java.util.Map;
-import javax.persistence.QueryHint;
+import javax.sql.DataSource;
-import io.mosip.idrepository.core.logger.IdRepoLogger;
-import io.mosip.idrepository.core.security.IdRepoSecurityManager;
-import io.mosip.kernel.core.exception.ExceptionUtils;
-import io.mosip.kernel.core.logger.spi.Logger;
import org.springframework.batch.core.Job;
-import org.springframework.batch.core.JobParameters;
-import org.springframework.batch.core.JobParametersBuilder;
import org.springframework.batch.core.Step;
-import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
-import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
-import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
-import org.springframework.batch.core.launch.JobLauncher;
+import org.springframework.batch.core.job.builder.JobBuilder;
import org.springframework.batch.core.launch.support.RunIdIncrementer;
-import org.springframework.batch.integration.async.AsyncItemProcessor;
-import org.springframework.batch.integration.async.AsyncItemWriter;
-import org.springframework.batch.item.ItemProcessor;
-import org.springframework.batch.item.data.RepositoryItemReader;
-import org.springframework.batch.item.data.RepositoryItemWriter;
+import org.springframework.batch.core.repository.JobRepository;
+import org.springframework.batch.core.step.builder.StepBuilder;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;
import org.springframework.data.domain.Pageable;
-import org.springframework.data.domain.Sort;
-import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.jpa.repository.QueryHints;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
+import org.springframework.transaction.PlatformTransactionManager;
import com.fasterxml.jackson.module.afterburner.AfterburnerModule;
-import io.mosip.credential.request.generator.entity.CredentialEntity;
import io.mosip.credential.request.generator.repositary.CredentialRepositary;
import io.mosip.credential.request.generator.util.RestUtil;
-
-
+import jakarta.persistence.QueryHint;
/**
* The Class BatchConfiguration.
*
- * @author Sowmya
*/
@Configuration
-@EnableBatchProcessing
public class BatchConfiguration {
-
+
@Autowired
public CredentialItemTasklet credentialItemTasklet;
@Autowired
public CredentialItemReprocessTasklet credentialItemReprocessTasklet;
- /** The job builder factory. */
- @Autowired
- public JobBuilderFactory jobBuilderFactory;
-
- /** The step builder factory. */
- @Autowired
- public StepBuilderFactory stepBuilderFactory;
-
- /** The job launcher. */
- @Autowired
- private JobLauncher jobLauncher;
-
- /** The crdential repo. */
- @Autowired
- private CredentialRepositary crdentialRepo;
-
- /** The credential process job. */
- @Autowired
- private Job credentialProcessJob;
-
- /** The credential re process job. */
- @Autowired
- private Job credentialReProcessJob;
-
- private static final String BATCH_CONFIGURATION = "BatchConfiguration";
- private static final Logger LOGGER = IdRepoLogger.getLogger(BatchConfiguration.class);
-
- /**
- * Process job.
- */
- @Scheduled(fixedDelayString = "${mosip.credential.request.job.timedelay}")
- public void processJob() {
- try {
- JobParameters jobParameters = new JobParametersBuilder().addLong("time", System.currentTimeMillis())
- .toJobParameters();
- jobLauncher.run(credentialProcessJob, jobParameters);
-
- } catch (Exception e) {
- LOGGER.error(IdRepoSecurityManager.getUser(), BATCH_CONFIGURATION,
- "error in JobLauncher " + ExceptionUtils.getStackTrace(e));
- }
- }
-
- /**
- * Re process job.
- */
- @Scheduled(fixedDelayString = "${mosip.credential.request.reprocess.job.timedelay}")
- public void reProcessJob() {
- try {
- JobParameters jobParameters = new JobParametersBuilder().addLong("time", System.currentTimeMillis())
- .toJobParameters();
- jobLauncher.run(credentialReProcessJob, jobParameters);
-
- } catch (Exception e) {
- LOGGER.error(IdRepoSecurityManager.getUser(), BATCH_CONFIGURATION,
- "error in JobLauncher " + ExceptionUtils.getStackTrace(e));
- }
- }
-
/**
* Credential process job.
*
@@ -130,9 +50,9 @@ public void reProcessJob() {
* @return the job
*/
@Bean
- public Job credentialProcessJob(JobCompletionNotificationListener listener) throws Exception {
- return jobBuilderFactory.get("credentialProcessJob").incrementer(new RunIdIncrementer()).listener(listener)
- .flow(credentialProcessStep()).end().build();
+ public Job credentialProcessJob(JobRepository jobRepository, JobCompletionNotificationListener listener,PlatformTransactionManager transactionManager) {
+ return new JobBuilder("credentialProcessJob", jobRepository).incrementer(new RunIdIncrementer())
+ .listener(listener).flow(credentialProcessStep(jobRepository,transactionManager)).end().build();
}
/**
@@ -140,27 +60,30 @@ public Job credentialProcessJob(JobCompletionNotificationListener listener) thro
*
* @param listener the listener
* @return the job
+ * @throws Exception
*/
+
@Bean
- public Job credentialReProcessJob(JobCompletionNotificationListener listener) throws Exception {
- return jobBuilderFactory.get("credentialReProcessJob").incrementer(new RunIdIncrementer()).listener(listener)
- .flow(credentialReProcessStep()).end().build();
+ public Job credentialReProcessJob(JobRepository jobRepository, JobCompletionNotificationListener listener,PlatformTransactionManager transactionManager)
+ throws Exception {
+ return new JobBuilder("credentialReProcessJob", jobRepository).incrementer(new RunIdIncrementer())
+ .listener(listener).flow(credentialReProcessStep(jobRepository,transactionManager)).end().build();
}
-
+
@Bean
@DependsOn("alterAnnotation")
- public Step credentialProcessStep() {
- return stepBuilderFactory.get("credentialProcessJob").tasklet(credentialItemTasklet).build();
-
+ public Step credentialProcessStep(JobRepository jobRepository,PlatformTransactionManager transactionManager) {
+ return new StepBuilder("credentialProcessJob", jobRepository).tasklet(credentialItemTasklet, null).transactionManager(transactionManager).build();
}
-
+
@Bean
@DependsOn("alterAnnotation")
- public Step credentialReProcessStep() throws Exception {
- return stepBuilderFactory.get("credentialProcessJob").tasklet(credentialItemReprocessTasklet).build();
-
+ public Step credentialReProcessStep(JobRepository jobRepository,PlatformTransactionManager transactionManager) {
+ Step step = new StepBuilder("credentialProcessJob", jobRepository).tasklet(credentialItemReprocessTasklet, null).transactionManager(transactionManager)
+ .build();
+ return step;
}
-
+
/**
* Gets the rest util.
*
@@ -186,15 +109,12 @@ public ThreadPoolTaskScheduler getTaskScheduler() {
*
* @return the step
*/
-
@Bean
public PropertyLoader propertyLoader() {
return new PropertyLoader();
}
-
-
@Bean(name = "alterAnnotation")
public String alterAnnotation() throws Exception {
@@ -203,7 +123,7 @@ public String alterAnnotation() throws Exception {
findCredentialByStatusCode.setAccessible(true);
QueryHints queryHints = findCredentialByStatusCode.getDeclaredAnnotation(QueryHints.class);
QueryHint queryHint = (QueryHint) queryHints.value()[0];
- java.lang.reflect.InvocationHandler invocationHandler = Proxy.getInvocationHandler(queryHint);
+ InvocationHandler invocationHandler = Proxy.getInvocationHandler(queryHint);
Field memberValues = invocationHandler.getClass().getDeclaredField("memberValues");
memberValues.setAccessible(true);
Map values = (Map) memberValues.get(invocationHandler);
@@ -211,11 +131,11 @@ public String alterAnnotation() throws Exception {
findCredentialByStatusCode.setAccessible(false);
Method findCredentialByStatusCodes = CredentialRepositary.class.getDeclaredMethod("findCredentialByStatusCodes",
- String[].class,Pageable.class);
+ String[].class, Pageable.class);
findCredentialByStatusCodes.setAccessible(true);
QueryHints queryHintsReprocess = findCredentialByStatusCodes.getDeclaredAnnotation(QueryHints.class);
QueryHint queryHintReprocess = (QueryHint) queryHintsReprocess.value()[0];
- java.lang.reflect.InvocationHandler invocationHandlerReprocess = Proxy.getInvocationHandler(queryHintReprocess);
+ InvocationHandler invocationHandlerReprocess = Proxy.getInvocationHandler(queryHintReprocess);
Field memberValuesReprocess = invocationHandlerReprocess.getClass().getDeclaredField("memberValues");
memberValuesReprocess.setAccessible(true);
Map valuesReprocess = (Map) memberValuesReprocess
@@ -225,9 +145,8 @@ public String alterAnnotation() throws Exception {
findCredentialByStatusCodes.setAccessible(false);
return "";
-
}
-
+
@Bean
public AfterburnerModule afterburnerModule() {
return new AfterburnerModule();
diff --git a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/CredentialItemReprocessTasklet.java b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/CredentialItemReprocessTasklet.java
index 6794d3919..a0c641d2f 100644
--- a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/CredentialItemReprocessTasklet.java
+++ b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/CredentialItemReprocessTasklet.java
@@ -6,7 +6,7 @@
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool;
-import javax.annotation.PostConstruct;
+import jakarta.annotation.PostConstruct;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
@@ -14,6 +14,7 @@
import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Lazy;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
@@ -48,6 +49,7 @@ public class CredentialItemReprocessTasklet implements Tasklet {
@Value("${credential.batch.thread.count:10}")
private int threadCount;
+ @Lazy
@Autowired
private ObjectMapper mapper;
diff --git a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/CredentialItemTasklet.java b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/CredentialItemTasklet.java
index da8a4dd91..5abdeae65 100644
--- a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/CredentialItemTasklet.java
+++ b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/CredentialItemTasklet.java
@@ -6,14 +6,13 @@
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool;
-import javax.annotation.PostConstruct;
-
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Lazy;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
@@ -39,6 +38,7 @@
import io.mosip.kernel.core.exception.ExceptionUtils;
import io.mosip.kernel.core.logger.spi.Logger;
import io.mosip.kernel.core.util.DateUtils;
+import jakarta.annotation.PostConstruct;
@Component
public class CredentialItemTasklet implements Tasklet {
@@ -46,6 +46,7 @@ public class CredentialItemTasklet implements Tasklet {
@Value("${credential.batch.thread.count:10}")
private int threadCount;
+ @Lazy
@Autowired
private ObjectMapper mapper;
diff --git a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/CredentialScheduleJobConfiguration.java b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/CredentialScheduleJobConfiguration.java
new file mode 100644
index 000000000..e5b871304
--- /dev/null
+++ b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/CredentialScheduleJobConfiguration.java
@@ -0,0 +1,72 @@
+package io.mosip.credential.request.generator.batch.config;
+
+import org.springframework.batch.core.Job;
+import org.springframework.batch.core.JobParameters;
+import org.springframework.batch.core.JobParametersBuilder;
+import org.springframework.batch.core.launch.JobLauncher;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.Scheduled;
+
+import io.mosip.idrepository.core.logger.IdRepoLogger;
+import io.mosip.idrepository.core.security.IdRepoSecurityManager;
+import io.mosip.kernel.core.exception.ExceptionUtils;
+import io.mosip.kernel.core.logger.spi.Logger;
+
+/**
+ * @author Neha Farheen The Class RestUtil.
+ */
+
+@Configuration
+public class CredentialScheduleJobConfiguration {
+
+ /** The job launcher. */
+ @Autowired
+ private JobLauncher jobLauncher;
+
+ /** The credential process job. */
+ @Autowired
+ private Job credentialProcessJob;
+
+ /** The credential re process job. */
+ @Autowired
+ private Job credentialReProcessJob;
+
+ private static final String CREDENTIAL_SCHEDULE_CONFIGURATION = "CredentialJobConfiguration";
+ private static final Logger LOGGER = IdRepoLogger.getLogger(CredentialScheduleJobConfiguration.class);
+
+ /**
+ * Process job.
+ */
+ @Scheduled(fixedDelayString = "${mosip.credential.request.job.timedelay}")
+ public void processJob() {
+ try {
+ JobParameters jobParameters = new JobParametersBuilder().addLong("time", System.currentTimeMillis())
+ .toJobParameters();
+ jobLauncher.run(credentialProcessJob, jobParameters);
+
+ } catch (Exception e) {
+ LOGGER.error(IdRepoSecurityManager.getUser(), CREDENTIAL_SCHEDULE_CONFIGURATION,
+ "error in JobLauncher " + ExceptionUtils.getStackTrace(e));
+ }
+ }
+
+ /**
+ * Re process job.
+ */
+ @Scheduled(fixedDelayString = "${mosip.credential.request.reprocess.job.timedelay}")
+ public void reProcessJob() {
+ try {
+ JobParameters jobParameters = new JobParametersBuilder().addLong("time", System.currentTimeMillis())
+ .toJobParameters();
+ jobLauncher.run(credentialReProcessJob, jobParameters);
+
+ } catch (Exception e) {
+ LOGGER.error(IdRepoSecurityManager.getUser(), CREDENTIAL_SCHEDULE_CONFIGURATION,
+ "error in JobLauncher " + ExceptionUtils.getStackTrace(e));
+ }
+ }
+
+
+
+}
diff --git a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/JobCompletionNotificationListener.java b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/JobCompletionNotificationListener.java
index 8e939a37d..768842595 100644
--- a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/JobCompletionNotificationListener.java
+++ b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/batch/config/JobCompletionNotificationListener.java
@@ -2,7 +2,7 @@
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.listener.JobExecutionListenerSupport;
+import org.springframework.batch.core.JobExecutionListener;
import org.springframework.stereotype.Component;
import io.mosip.credential.request.generator.constants.LoggerFileConstant;
@@ -22,7 +22,7 @@
* @author Sowmya
*/
@Component
-public class JobCompletionNotificationListener extends JobExecutionListenerSupport {
+public class JobCompletionNotificationListener implements JobExecutionListener {
private static final Logger LOGGER = IdRepoLogger
.getLogger(JobCompletionNotificationListener.class);
@@ -30,7 +30,6 @@ public class JobCompletionNotificationListener extends JobExecutionListenerSuppo
/* (non-Javadoc)
* @see org.springframework.batch.core.listener.JobExecutionListenerSupport#afterJob(org.springframework.batch.core.JobExecution)
*/
- @Override
public void afterJob(JobExecution jobExecution) {
if (jobExecution.getStatus() == BatchStatus.COMPLETED) {
LOGGER.debug(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.ID.toString(),
diff --git a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/dao/CredentialDao.java b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/dao/CredentialDao.java
index 758400a63..782afc4ee 100644
--- a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/dao/CredentialDao.java
+++ b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/dao/CredentialDao.java
@@ -35,7 +35,7 @@ public class CredentialDao {
/** The crdential repo. */
@Autowired
- private CredentialRepositary credentialRepo;
+ private CredentialRepositary credentialRepo;
public void update(String batchId, List credentialEntities) {
credentialRepo.saveAll(credentialEntities);
diff --git a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/entity/CredentialEntity.java b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/entity/CredentialEntity.java
index cef4c46ad..8a87a7f22 100644
--- a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/entity/CredentialEntity.java
+++ b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/entity/CredentialEntity.java
@@ -5,10 +5,10 @@
import java.time.LocalDateTime;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import jakarta.persistence.Table;
/**
* The Class CredentialEntity.
diff --git a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/interceptor/CredentialTransactionInterceptor.java b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/interceptor/CredentialTransactionInterceptor.java
index 71265f6e4..02e612afc 100644
--- a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/interceptor/CredentialTransactionInterceptor.java
+++ b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/interceptor/CredentialTransactionInterceptor.java
@@ -5,7 +5,7 @@
import java.util.Map;
import java.util.Objects;
-import org.hibernate.EmptyInterceptor;
+import org.hibernate.Interceptor;
import org.hibernate.type.Type;
import org.springframework.http.MediaType;
@@ -28,7 +28,7 @@
* @author Manoj SP
*
*/
-public class CredentialTransactionInterceptor extends EmptyInterceptor {
+public class CredentialTransactionInterceptor implements Interceptor {
private static final String REQUEST = "request";
@@ -45,7 +45,7 @@ public CredentialTransactionInterceptor(RestUtil restUtil) {
@Override
public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) {
encryptData(entity, state, propertyNames);
- return super.onSave(entity, id, state, propertyNames, types);
+ return Interceptor.super.onSave(entity, id, state, propertyNames, types);
}
@Override
@@ -65,14 +65,14 @@ public boolean onLoad(Object entity, Serializable id, Object[] state, String[] p
}
state[indexOfData] = decryptedData;
}
- return super.onLoad(entity, id, state, propertyNames, types);
+ return Interceptor.super.onLoad(entity, id, state, propertyNames, types);
}
@Override
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState,
String[] propertyNames, Type[] types) {
encryptData(entity, currentState, propertyNames);
- return super.onFlushDirty(entity, id, currentState, previousState, propertyNames, types);
+ return Interceptor.super.onFlushDirty(entity, id, currentState, previousState, propertyNames, types);
}
private void encryptData(Object entity, Object[] state, String[] propertyNames) {
diff --git a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/repositary/CredentialRepositary.java b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/repositary/CredentialRepositary.java
index 40855bb17..5ffa2b3a4 100644
--- a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/repositary/CredentialRepositary.java
+++ b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/repositary/CredentialRepositary.java
@@ -2,8 +2,8 @@
import java.time.LocalDateTime;
-import javax.persistence.LockModeType;
-import javax.persistence.QueryHint;
+import jakarta.persistence.LockModeType;
+import jakarta.persistence.QueryHint;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
@@ -30,7 +30,7 @@
* @param the element type
*/
@Repository
-public interface CredentialRepositary extends BaseRepository {
+public interface CredentialRepositary extends BaseRepository {
@Query("SELECT crdn FROM CredentialEntity crdn WHERE crdn.statusCode= :statusCode")
Page findByStatusCode(@Param("statusCode") String statusCode, Pageable pageable);
@@ -43,7 +43,7 @@ Page findByStatusCodeWithEffectiveDtimes(@Param("statusCode")
@Transactional
@Lock(value = LockModeType.PESSIMISTIC_WRITE)
- @QueryHints({ @QueryHint(name = "javax.persistence.lock.timeout", value = "1") })
+ @QueryHints({ @QueryHint(name = "jakarta.persistence.lock.timeout", value = "1") })
@Query("select c from CredentialEntity c where c.statusCode=:statusCode")
Page findCredentialByStatusCode(@Param("statusCode")String statusCode, Pageable pageable);
@@ -57,7 +57,7 @@ Page findByStatusCodeWithEffectiveDtimes(@Param("statusCode")
*/
@Transactional
@Lock(value = LockModeType.PESSIMISTIC_WRITE)
- @QueryHints({ @QueryHint(name = "javax.persistence.lock.timeout", value = "1") })
+ @QueryHints({ @QueryHint(name = "jakarta.persistence.lock.timeout", value = "1") })
@Query("SELECT crdn FROM CredentialEntity crdn WHERE crdn.statusCode in :statusCodes ")
Page findCredentialByStatusCodes(@Param("statusCodes") String[] statusCodes,Pageable pageable);
}
diff --git a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/util/RestUtil.java b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/util/RestUtil.java
index 9fec0d6fe..28ee8dc61 100644
--- a/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/util/RestUtil.java
+++ b/id-repository/credential-request-generator/src/main/java/io/mosip/credential/request/generator/util/RestUtil.java
@@ -9,14 +9,17 @@
import io.mosip.kernel.core.util.DateUtils;
import io.mosip.kernel.core.util.StringUtils;
import io.mosip.kernel.core.util.TokenHandlerUtil;
-import org.apache.http.Header;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.ParseException;
+import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
+import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
+import org.apache.hc.client5.http.classic.methods.HttpPost;
+import org.apache.hc.core5.http.io.entity.StringEntity;
+
+import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
+import org.apache.hc.client5.http.impl.classic.HttpClients;
+import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder;
+import org.apache.hc.core5.http.io.entity.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
@@ -38,7 +41,6 @@
import java.util.List;
import java.util.Objects;
-
/**
* @author Sowmya The Class RestUtil.
*/
@@ -183,9 +185,16 @@ public T getApi(ApiName apiName, List pathsegments, String queryPara
* @throws KeyStoreException the key store exception
*/
public RestTemplate getRestTemplate() throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException {
- if (restTemplate == null) {
- HttpClientBuilder httpClientBuilder = HttpClients.custom().setMaxConnPerRoute(maxConnectionPerRoute)
- .setMaxConnTotal(totalMaxConnection).disableCookieManagement();
+ if (restTemplate == null) {
+
+ var connnectionManagerBuilder = PoolingHttpClientConnectionManagerBuilder.create()
+ .setMaxConnPerRoute(maxConnectionPerRoute)
+ .setMaxConnTotal(totalMaxConnection);
+ var connectionManager = connnectionManagerBuilder.build();
+ HttpClientBuilder httpClientBuilder = HttpClients.custom()
+ .setConnectionManager(connectionManager)
+ .disableCookieManagement();
+
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();
requestFactory.setHttpClient(httpClientBuilder.build());
@@ -193,6 +202,7 @@ public RestTemplate getRestTemplate() throws KeyManagementException, NoSuchAlgor
}
return restTemplate;
}
+
/**
* Sets the request header.
@@ -255,7 +265,7 @@ public String getToken() throws IOException {
tokenRequestDTO.setVersion(EnvUtil.getCredReqTokenVersion());
Gson gson = new Gson();
- HttpClient httpClient = HttpClientBuilder.create().build();
+ CloseableHttpClient httpClient = HttpClientBuilder.create().build();
// HttpPost post = new
// HttpPost(environment.getProperty("PASSWORDBASEDTOKENAPI"));
HttpPost post = new HttpPost(environment.getProperty("KEYBASEDTOKENAPI"));
@@ -263,8 +273,8 @@ public String getToken() throws IOException {
StringEntity postingString = new StringEntity(gson.toJson(tokenRequestDTO));
post.setEntity(postingString);
post.setHeader("Content-type", "application/json");
- HttpResponse response = httpClient.execute(post);
- org.apache.http.HttpEntity entity = response.getEntity();
+ CloseableHttpResponse response = httpClient.execute(post);
+ org.apache.hc.core5.http.HttpEntity entity = response.getEntity();
String responseBody = EntityUtils.toString(entity, "UTF-8");
Header[] cookie = response.getHeaders("Set-Cookie");
if (cookie.length == 0)
@@ -274,6 +284,8 @@ public String getToken() throws IOException {
return token.substring(0, token.indexOf(';'));
} catch (IOException e) {
throw e;
+ }catch (ParseException e) {
+ throw new RuntimeException(e);
}
}
return AUTHORIZATION + token;
diff --git a/id-repository/credential-request-generator/src/main/resources/bootstrap.properties b/id-repository/credential-request-generator/src/main/resources/bootstrap.properties
index 22f2e7396..e1a6ac331 100644
--- a/id-repository/credential-request-generator/src/main/resources/bootstrap.properties
+++ b/id-repository/credential-request-generator/src/main/resources/bootstrap.properties
@@ -23,6 +23,12 @@ javax.persistence.jdbc.user=${mosip.credential.service.jdbc.user}
javax.persistence.jdbc.password=${mosip.credential.service.jdbc.password}
javax.persistence.jdbc.driver=${mosip.credential.service.jdbc.driver}
+#jakarta.persistence.jdbc.url=${mosip.credential.service.jdbc.url}
+#jakarta.persistence.jdbc.user=${mosip.credential.service.jdbc.user}
+#jakarta.persistence.jdbc.password=${mosip.credential.service.jdbc.password}
+#jakarta.persistence.jdbc.driver=${mosip.credential.service.jdbc.driver}
+spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
+spring.batch.job.enabled=false
#Swagger 3.0 open api
openapi.info.title=Credential Request Generator
openapi.info.description=Credential Request Generator
diff --git a/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/dao/CredentialDaoTest.java b/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/dao/CredentialDaoTest.java
index 36e44b2bb..94d3a6685 100644
--- a/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/dao/CredentialDaoTest.java
+++ b/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/dao/CredentialDaoTest.java
@@ -29,7 +29,7 @@
public class CredentialDaoTest {
@Mock
- private CredentialRepositary credentialRepo;
+ private CredentialRepositary credentialRepo;
@InjectMocks
private CredentialDao credentialDao;
diff --git a/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/init/CredentialInitializerTest.java b/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/init/CredentialInitializerTest.java
index 7537b56a2..8745b0457 100644
--- a/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/init/CredentialInitializerTest.java
+++ b/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/init/CredentialInitializerTest.java
@@ -36,7 +36,7 @@ public class CredentialInitializerTest {
@Test
public void onApplicationEventTest(){
SpringApplication application = new SpringApplication();
- ApplicationReadyEvent event = new ApplicationReadyEvent(application, new String[0], null);
+ ApplicationReadyEvent event = new ApplicationReadyEvent(application, new String[0], null, null);
credentialInstializer.onApplicationEvent(event);
ReflectionTestUtils.setField(credentialInstializer, "reSubscriptionDelaySecs", 2);
diff --git a/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/test/batch/config/BatchConfigurationTest.java b/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/test/batch/config/BatchConfigurationTest.java
index 5845f9ca5..b15ee588d 100644
--- a/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/test/batch/config/BatchConfigurationTest.java
+++ b/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/test/batch/config/BatchConfigurationTest.java
@@ -1,6 +1,7 @@
package io.mosip.credential.request.generator.test.batch.config;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import org.junit.Before;
import org.junit.Test;
@@ -8,16 +9,10 @@
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.springframework.batch.core.Job;
-import org.springframework.batch.core.Step;
-import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
import org.springframework.batch.core.launch.JobLauncher;
-import org.springframework.batch.integration.async.AsyncItemWriter;
-import org.springframework.batch.item.data.RepositoryItemWriter;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
-import org.springframework.context.annotation.Import;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestContext;
@@ -29,9 +24,7 @@
import io.mosip.credential.request.generator.batch.config.BatchConfiguration;
import io.mosip.credential.request.generator.batch.config.CredentialItemReprocessTasklet;
import io.mosip.credential.request.generator.batch.config.CredentialItemTasklet;
-import io.mosip.credential.request.generator.entity.CredentialEntity;
import io.mosip.credential.request.generator.util.RestUtil;
-import io.mosip.idrepository.core.util.EnvUtil;
@RunWith(SpringRunner.class)
@WebMvcTest
@@ -41,14 +34,6 @@ public class BatchConfigurationTest {
@InjectMocks
private BatchConfiguration batchConfiguration;
- /** The job builder factory. */
- @Mock
- public JobBuilderFactory jobBuilderFactory;
-
- /** The step builder factory. */
- @Mock
- public StepBuilderFactory stepBuilderFactory;
-
/** The job launcher. */
@Mock
private JobLauncher jobLauncher;
@@ -73,16 +58,6 @@ public class BatchConfigurationTest {
public void before() {
}
- @Test
- public void processJobTest() {
- batchConfiguration.processJob();
- }
-
- @Test
- public void reProcessJobTest() {
- batchConfiguration.reProcessJob();
- }
-
@Test
public void getRestUtilTest() {
diff --git a/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/test/config/TestSecurityConfig.java b/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/test/config/TestSecurityConfig.java
index b66763b91..b9c3afbdd 100644
--- a/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/test/config/TestSecurityConfig.java
+++ b/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/test/config/TestSecurityConfig.java
@@ -4,15 +4,12 @@
import java.util.Arrays;
import java.util.List;
-import javax.servlet.http.HttpServletResponse;
-
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
@@ -20,24 +17,24 @@
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
import org.springframework.security.web.AuthenticationEntryPoint;
+import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.firewall.DefaultHttpFirewall;
import org.springframework.security.web.firewall.HttpFirewall;
+import jakarta.servlet.http.HttpServletResponse;
+
@Configuration
@EnableWebSecurity
-@EnableGlobalMethodSecurity(prePostEnabled = true)
-public class TestSecurityConfig extends WebSecurityConfigurerAdapter {
+public class TestSecurityConfig {
@Bean
public HttpFirewall defaultHttpFirewall() {
return new DefaultHttpFirewall();
}
- @Override
- public void configure(WebSecurity webSecurity) throws Exception {
- webSecurity.ignoring().antMatchers(allowedEndPoints());
- super.configure(webSecurity);
- webSecurity.httpFirewall(defaultHttpFirewall());
+ @Bean
+ public WebSecurityCustomizer webSecurityCustomizer() {
+ return (web) -> web.ignoring().requestMatchers(allowedEndPoints()).and().httpFirewall(defaultHttpFirewall());
}
private String[] allowedEndPoints() {
@@ -46,12 +43,15 @@ private String[] allowedEndPoints() {
"/*/configuration/security", "/*/swagger-resources/**", "/*/swagger-ui.html" };
}
- @Override
- protected void configure(final HttpSecurity httpSecurity) throws Exception {
- httpSecurity.csrf().disable();
- httpSecurity.httpBasic().and().authorizeRequests().anyRequest().authenticated().and().sessionManagement()
- .sessionCreationPolicy(SessionCreationPolicy.STATELESS).and().exceptionHandling()
- .authenticationEntryPoint(unauthorizedEntryPoint());
+ @Bean
+ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
+ http.csrf(csrf -> csrf.disable())
+ .exceptionHandling(exception -> exception.authenticationEntryPoint(unauthorizedEntryPoint()))
+ .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
+ .authorizeHttpRequests((authz) -> authz.anyRequest().authenticated())
+ .userDetailsService(userDetailsService());
+
+ return http.build();
}
@Bean
@@ -60,7 +60,7 @@ public AuthenticationEntryPoint unauthorizedEntryPoint() {
}
@Bean
- public UserDetailsService userDetailsService() {
+ public InMemoryUserDetailsManager userDetailsService() {
List users = new ArrayList<>();
users.add(new User("reg-officer", "mosip",
Arrays.asList(new SimpleGrantedAuthority("ROLE_REGISTRATION_OFFICER"))));
diff --git a/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/test/controller/CredentialRequestGeneratorControllerTest.java b/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/test/controller/CredentialRequestGeneratorControllerTest.java
index 439f7dd2f..ceb223408 100644
--- a/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/test/controller/CredentialRequestGeneratorControllerTest.java
+++ b/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/test/controller/CredentialRequestGeneratorControllerTest.java
@@ -39,7 +39,6 @@
@RunWith(SpringRunner.class)
@ContextConfiguration(classes = TestConfig.class)
-@TestPropertySource(locations = "classpath:application.properties")
@SpringBootTest(classes = TestBootApplication.class)
@AutoConfigureMockMvc
public class CredentialRequestGeneratorControllerTest {
diff --git a/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/test/init/SubscribeEventTest.java b/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/test/init/SubscribeEventTest.java
index 980e1d827..0c7768859 100644
--- a/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/test/init/SubscribeEventTest.java
+++ b/id-repository/credential-request-generator/src/test/java/io/mosip/credential/request/generator/test/init/SubscribeEventTest.java
@@ -68,7 +68,7 @@ public void testScheduleSubscription() {
@Test
public void testOnApplicationEvent() {
- ApplicationReadyEvent event = new ApplicationReadyEvent(new SpringApplication(), null, null);
+ ApplicationReadyEvent event = new ApplicationReadyEvent(new SpringApplication(), null, null, null);
int delayMilliseconds = 60000;
ArgumentMatcher dateMatcher = argument -> {
long expectedTime = System.currentTimeMillis() + delayMilliseconds;
diff --git a/id-repository/credential-service/Dockerfile b/id-repository/credential-service/Dockerfile
index 8a60e40c3..38b2596bb 100644
--- a/id-repository/credential-service/Dockerfile
+++ b/id-repository/credential-service/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:11
+FROM eclipse-temurin:21-jre-alpine
ARG SOURCE
ARG COMMIT_HASH
@@ -48,16 +48,16 @@ ARG container_user=mosip
ARG container_user_group=mosip
# can be passed during Docker build as build time environment for github branch to pickup configuration from.
-ARG container_user_uid=1001
+ARG container_user_uid=1002
# can be passed during Docker build as build time environment for github branch to pickup configuration from.
ARG container_user_gid=1001
# install packages and create user
-RUN apt-get -y update \
-&& apt-get install -y unzip \
-&& groupadd -g ${container_user_gid} ${container_user_group} \
-&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user}
+RUN apk -q update \
+&& apk add -q unzip \
+&& addgroup -g ${container_user_gid} ${container_user_group} \
+&& adduser -s /bin/sh -u ${container_user_uid} -G ${container_user_group} -h /home/${container_user} --disabled-password ${container_user}
# set working directory for the user
WORKDIR /home/${container_user}
@@ -89,10 +89,10 @@ CMD if [ "$is_glowroot_env" = "present" ]; then \
rm -rf glowroot.zip ; \
sed -i 's//credential-service/g' glowroot/glowroot.properties ; \
wget -q "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \
- java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -jar -javaagent:glowroot/glowroot.jar credential-service.jar ; \
+ java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" --add-opens java.base/sun.reflect.annotation=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED -jar -javaagent:glowroot/glowroot.jar credential-service.jar ; \
else \
wget -q "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \
- java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -jar credential-service.jar ; \
+ java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" --add-opens java.base/sun.reflect.annotation=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED -jar credential-service.jar ; \
fi
diff --git a/id-repository/credential-service/pom.xml b/id-repository/credential-service/pom.xml
index 79611d9ef..93da58e23 100644
--- a/id-repository/credential-service/pom.xml
+++ b/id-repository/credential-service/pom.xml
@@ -16,14 +16,13 @@
http://maven.apache.org
UTF-8
- 1.8
- 1.8
+ 21
+ 21
2.0.2.RELEASE
2.0.7.RELEASE
5.0.5.RELEASE
2.0.0.RELEASE
1.4.197
- 2.9.8
2.9.2
1.2.1-SNAPSHOT
2.0.7
@@ -33,6 +32,7 @@
1.2.1-SNAPSHOT
1.4.2
1.5.10
+ 3.11.2
@@ -41,12 +41,7 @@
spring-cloud-starter-config
${spring-cloud-config.version}
-
- org.mockito
- mockito-core
- ${mockito.version}
- test
-
+
com.h2database
h2
@@ -55,41 +50,28 @@
-
- junit
- junit
- 3.8.1
- test
-
+
io.mosip.kernel
kernel-core
${kernel.core.version}
-
- com.fasterxml.jackson.module
- jackson-module-afterburner
- 2.12.0
-
+
org.springframework.cloud
spring-cloud-starter-config
- ${spring-cloud-config.version}
org.springframework.boot
spring-boot-starter-data-jpa
- ${spring.boot.version}
org.springframework.boot
spring-boot-starter-web
- ${spring.boot.version}
org.springframework.boot
spring-boot-starter-cache
- ${spring.boot.version}
io.springfox
@@ -104,33 +86,27 @@
com.h2database
h2
- ${h2.version}
runtime
org.springframework.boot
spring-boot-starter-batch
- ${spring.boot.version}
com.googlecode.json-simple
json-simple
- 1.1.1
com.google.code.gson
gson
- ${gson.version}
javax.xml.bind
jaxb-api
- 2.3.0
junit
junit
- ${junit.version}
test
@@ -157,39 +133,29 @@
io.micrometer
micrometer-core
- ${io.micrometer.prometheus.version}
io.micrometer
micrometer-registry-prometheus
- ${io.micrometer.prometheus.version}
org.mvel
mvel2
- 2.4.7.Final
+ 2.5.2.Final
org.powermock
powermock-module-junit4
- ${powermock.beta.version}
test
org.powermock
powermock-api-mockito2
- ${powermock.beta.version}
test
-
- org.springdoc
- springdoc-openapi-ui
- ${springdoc.version}
-
org.springframework.boot
spring-boot-configuration-processor
- ${spring.boot.version}
true
@@ -202,17 +168,9 @@
biometrics-util
${kernel.core.version}
-
- com.fasterxml.jackson.dataformat
- jackson-dataformat-xml
- 2.12.0
-
-
- com.fasterxml.jackson.module
- jackson-module-jaxb-annotations
- 2.12.0
-
-
+
+
+
danubetech-maven-public
diff --git a/id-repository/credential-service/src/main/java/io/mosip/credentialstore/api/config/CredentialStoreConfig.java b/id-repository/credential-service/src/main/java/io/mosip/credentialstore/api/config/CredentialStoreConfig.java
index 8c1e2c62f..dbf77c11b 100644
--- a/id-repository/credential-service/src/main/java/io/mosip/credentialstore/api/config/CredentialStoreConfig.java
+++ b/id-repository/credential-service/src/main/java/io/mosip/credentialstore/api/config/CredentialStoreConfig.java
@@ -13,7 +13,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springdoc.core.GroupedOpenApi;
+import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
diff --git a/id-repository/credential-service/src/main/java/io/mosip/credentialstore/config/CredentialStoreBeanConfig.java b/id-repository/credential-service/src/main/java/io/mosip/credentialstore/config/CredentialStoreBeanConfig.java
index c2cf2d45c..9daa4c1a7 100644
--- a/id-repository/credential-service/src/main/java/io/mosip/credentialstore/config/CredentialStoreBeanConfig.java
+++ b/id-repository/credential-service/src/main/java/io/mosip/credentialstore/config/CredentialStoreBeanConfig.java
@@ -1,16 +1,9 @@
package io.mosip.credentialstore.config;
-import org.mvel2.MVEL;
-import org.mvel2.integration.VariableResolverFactory;
-import org.mvel2.integration.impl.MapVariableResolverFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.retry.annotation.EnableRetry;
-import org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.module.afterburner.AfterburnerModule;
@@ -104,23 +97,7 @@ public RestHelper restHelper() {
return new RestHelper();
}
- @Value("${config.server.file.storage.uri}")
- private String configServerFileStorageURL;
- @Value("${credential.service.mvel.file}")
- private String mvelFile;
-
- @Autowired
- @Qualifier("plainRestTemplate")
- private RestTemplate restTemplate;
-
- @Bean("varres")
- public VariableResolverFactory getVariableResolverFactory() {
- String mvelExpression = restTemplate.getForObject(configServerFileStorageURL + mvelFile, String.class);
- VariableResolverFactory functionFactory = new MapVariableResolverFactory();
- MVEL.eval(mvelExpression, functionFactory);
- return functionFactory;
- }
@Bean
public AfterburnerModule afterburnerModule() {
diff --git a/id-repository/credential-service/src/main/java/io/mosip/credentialstore/config/MvelConfig.java b/id-repository/credential-service/src/main/java/io/mosip/credentialstore/config/MvelConfig.java
new file mode 100644
index 000000000..2a88eaff9
--- /dev/null
+++ b/id-repository/credential-service/src/main/java/io/mosip/credentialstore/config/MvelConfig.java
@@ -0,0 +1,38 @@
+package io.mosip.credentialstore.config;
+
+import org.mvel2.MVEL;
+import org.mvel2.integration.VariableResolverFactory;
+import org.mvel2.integration.impl.MapVariableResolverFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * @author Neha Farheen.
+ */
+
+@Configuration
+public class MvelConfig {
+
+ @Value("${config.server.file.storage.uri}")
+ private String configServerFileStorageURL;
+
+ @Value("${credential.service.mvel.file}")
+ private String mvelFile;
+
+ @Autowired
+ @Qualifier("plainRestTemplate")
+ private RestTemplate restTemplate;
+
+ @Bean("varres")
+ public VariableResolverFactory getVariableResolverFactory() {
+ String mvelExpression = restTemplate.getForObject(configServerFileStorageURL + mvelFile, String.class);
+ VariableResolverFactory functionFactory = new MapVariableResolverFactory();
+ MVEL.eval(mvelExpression, functionFactory);
+ return functionFactory;
+ }
+
+}
diff --git a/id-repository/credential-service/src/main/java/io/mosip/credentialstore/provider/CredentialProvider.java b/id-repository/credential-service/src/main/java/io/mosip/credentialstore/provider/CredentialProvider.java
index 4ee6c84e1..cfb6ddd89 100644
--- a/id-repository/credential-service/src/main/java/io/mosip/credentialstore/provider/CredentialProvider.java
+++ b/id-repository/credential-service/src/main/java/io/mosip/credentialstore/provider/CredentialProvider.java
@@ -7,7 +7,7 @@
import static io.mosip.credentialstore.constants.CredentialConstants.FULLNAME;
import static io.mosip.credentialstore.constants.CredentialConstants.IDENTITY_ATTRIBUTES;
import static io.mosip.credentialstore.constants.CredentialConstants.NAME_FORMAT_FUNCTION;
-import io.mosip.biometrics.util.face.FaceDecoder;
+
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
@@ -29,9 +29,6 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import javax.annotation.PostConstruct;
-
-import io.mosip.biometrics.util.ConvertRequestDto;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.binary.StringUtils;
import org.apache.commons.io.IOUtils;
@@ -43,12 +40,15 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Lazy;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
+import io.mosip.biometrics.util.ConvertRequestDto;
+import io.mosip.biometrics.util.face.FaceDecoder;
import io.mosip.credentialstore.constants.CredentialConstants;
import io.mosip.credentialstore.constants.JsonConstants;
import io.mosip.credentialstore.constants.LoggerFileConstant;
@@ -85,6 +85,7 @@
import io.mosip.kernel.core.logger.spi.Logger;
import io.mosip.kernel.core.util.CryptoUtil;
import io.mosip.kernel.core.util.DateUtils;
+import jakarta.annotation.PostConstruct;
/**
* The Interface CredentialProvider.
@@ -110,6 +111,7 @@ public class CredentialProvider {
@Autowired
private Environment env;
+ @Lazy
@Autowired
private ObjectMapper mapper;
diff --git a/id-repository/credential-service/src/main/java/io/mosip/credentialstore/provider/impl/IdAuthProvider.java b/id-repository/credential-service/src/main/java/io/mosip/credentialstore/provider/impl/IdAuthProvider.java
index 948b59089..c1afaabcf 100644
--- a/id-repository/credential-service/src/main/java/io/mosip/credentialstore/provider/impl/IdAuthProvider.java
+++ b/id-repository/credential-service/src/main/java/io/mosip/credentialstore/provider/impl/IdAuthProvider.java
@@ -11,6 +11,7 @@
import org.json.simple.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -79,6 +80,7 @@ public class IdAuthProvider extends CredentialProvider {
private static final Logger LOGGER = IdRepoLogger.getLogger(IdAuthProvider.class);
+ @Lazy
@Autowired
private ObjectMapper mapper;
diff --git a/id-repository/credential-service/src/main/java/io/mosip/credentialstore/provider/impl/QrCodeProvider.java b/id-repository/credential-service/src/main/java/io/mosip/credentialstore/provider/impl/QrCodeProvider.java
index d263d3b18..96c5f9e23 100644
--- a/id-repository/credential-service/src/main/java/io/mosip/credentialstore/provider/impl/QrCodeProvider.java
+++ b/id-repository/credential-service/src/main/java/io/mosip/credentialstore/provider/impl/QrCodeProvider.java
@@ -9,6 +9,7 @@
import org.json.simple.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -43,7 +44,8 @@ public class QrCodeProvider extends CredentialProvider {
/** The Constant DATETIME_PATTERN. */
public static final String DATETIME_PATTERN = "mosip.credential.service.datetime.pattern";
-
+
+ @Lazy
@Autowired
private ObjectMapper mapper;
diff --git a/id-repository/credential-service/src/main/java/io/mosip/credentialstore/provider/impl/VerCredProvider.java b/id-repository/credential-service/src/main/java/io/mosip/credentialstore/provider/impl/VerCredProvider.java
index a4ccaa71e..11f2c2089 100644
--- a/id-repository/credential-service/src/main/java/io/mosip/credentialstore/provider/impl/VerCredProvider.java
+++ b/id-repository/credential-service/src/main/java/io/mosip/credentialstore/provider/impl/VerCredProvider.java
@@ -12,32 +12,27 @@
import java.util.Map;
import java.util.Objects;
-import javax.annotation.PostConstruct;
-
-import com.apicatalog.jsonld.document.JsonDocument;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import io.mosip.credentialstore.constants.CredentialConstants;
-import io.mosip.credentialstore.dto.BestFingerDto;
import org.json.simple.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
+import com.apicatalog.jsonld.document.JsonDocument;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
import foundation.identity.jsonld.ConfigurableDocumentLoader;
import foundation.identity.jsonld.JsonLDObject;
import info.weboftrust.ldsignatures.LdProof;
import info.weboftrust.ldsignatures.canonicalizer.URDNA2015Canonicalizer;
-import io.mosip.credentialstore.constants.CredentialServiceErrorCodes;
+import io.mosip.credentialstore.constants.CredentialConstants;
import io.mosip.credentialstore.constants.JsonConstants;
import io.mosip.credentialstore.constants.LoggerFileConstant;
import io.mosip.credentialstore.dto.AllowedKycDto;
+import io.mosip.credentialstore.dto.BestFingerDto;
import io.mosip.credentialstore.dto.DataProviderResponse;
import io.mosip.credentialstore.exception.ApiNotAccessibleException;
import io.mosip.credentialstore.exception.CredentialFormatterException;
-import io.mosip.credentialstore.exception.DataEncryptionFailureException;
-import io.mosip.credentialstore.exception.VerCredException;
import io.mosip.credentialstore.provider.CredentialProvider;
import io.mosip.credentialstore.util.DigitalSignatureUtil;
import io.mosip.credentialstore.util.EncryptionUtil;
@@ -50,6 +45,7 @@
import io.mosip.kernel.core.logger.spi.Logger;
import io.mosip.kernel.core.util.CryptoUtil;
import io.mosip.kernel.core.util.DateUtils;
+import jakarta.annotation.PostConstruct;
@Component
public class VerCredProvider extends CredentialProvider {
@@ -69,9 +65,6 @@ public class VerCredProvider extends CredentialProvider {
/** The Constant DATETIME_PATTERN. */
public static final String DATETIME_PATTERN = "mosip.credential.service.datetime.pattern";
- @Autowired
- private ObjectMapper mapper;
-
@Value("${config.server.file.storage.uri:}")
private String configServerFileStorageURL;
diff --git a/id-repository/credential-service/src/main/java/io/mosip/credentialstore/service/impl/CredentialStoreServiceImpl.java b/id-repository/credential-service/src/main/java/io/mosip/credentialstore/service/impl/CredentialStoreServiceImpl.java
index e8bf1f0f1..4a74c2365 100644
--- a/id-repository/credential-service/src/main/java/io/mosip/credentialstore/service/impl/CredentialStoreServiceImpl.java
+++ b/id-repository/credential-service/src/main/java/io/mosip/credentialstore/service/impl/CredentialStoreServiceImpl.java
@@ -13,6 +13,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -26,7 +27,6 @@
import io.mosip.credentialstore.dto.CredentialTypeResponse;
import io.mosip.credentialstore.dto.DataProviderResponse;
import io.mosip.credentialstore.dto.DataShare;
-import io.mosip.credentialstore.dto.DataShareDto;
import io.mosip.credentialstore.dto.PartnerCredentialTypePolicyDto;
import io.mosip.credentialstore.dto.PartnerExtractor;
import io.mosip.credentialstore.dto.PartnerExtractorResponse;
@@ -129,6 +129,7 @@ public class CredentialStoreServiceImpl implements CredentialStoreService {
@Autowired
private EnvUtil env;
+ @Lazy
@Autowired
private ObjectMapper objectMapper;
diff --git a/id-repository/credential-service/src/main/resources/bootstrap.properties b/id-repository/credential-service/src/main/resources/bootstrap.properties
index c79df681f..c52cfcd5b 100644
--- a/id-repository/credential-service/src/main/resources/bootstrap.properties
+++ b/id-repository/credential-service/src/main/resources/bootstrap.properties
@@ -31,3 +31,4 @@ openapi.group.name=${openapi.info.title}
openapi.group.paths[0]=/**
springdoc.swagger-ui.disable-swagger-default-url=true
spring.mvc.servlet.path=${server.servlet.path}
+spring.main.allow-circular-references=true
diff --git a/id-repository/credential-service/src/test/java/io/mosip/credentialstore/test/config/TestSecurityConfig.java b/id-repository/credential-service/src/test/java/io/mosip/credentialstore/test/config/TestSecurityConfig.java
index 2fd8fd8f4..5913cd2b3 100644
--- a/id-repository/credential-service/src/test/java/io/mosip/credentialstore/test/config/TestSecurityConfig.java
+++ b/id-repository/credential-service/src/test/java/io/mosip/credentialstore/test/config/TestSecurityConfig.java
@@ -4,15 +4,11 @@
import java.util.Arrays;
import java.util.List;
-import javax.servlet.http.HttpServletResponse;
-
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
@@ -20,24 +16,24 @@
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
import org.springframework.security.web.AuthenticationEntryPoint;
+import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.firewall.DefaultHttpFirewall;
import org.springframework.security.web.firewall.HttpFirewall;
+import jakarta.servlet.http.HttpServletResponse;
+
@Configuration
@EnableWebSecurity
-@EnableGlobalMethodSecurity(prePostEnabled = true)
-public class TestSecurityConfig extends WebSecurityConfigurerAdapter {
+public class TestSecurityConfig {
@Bean
public HttpFirewall defaultHttpFirewall() {
return new DefaultHttpFirewall();
}
- @Override
- public void configure(WebSecurity webSecurity) throws Exception {
- webSecurity.ignoring().antMatchers(allowedEndPoints());
- super.configure(webSecurity);
- webSecurity.httpFirewall(defaultHttpFirewall());
+ @Bean
+ public WebSecurityCustomizer webSecurityCustomizer() {
+ return (web) -> web.ignoring().requestMatchers(allowedEndPoints()).and().httpFirewall(defaultHttpFirewall());
}
private String[] allowedEndPoints() {
@@ -46,12 +42,15 @@ private String[] allowedEndPoints() {
"/*/configuration/security", "/*/swagger-resources/**", "/*/swagger-ui.html" };
}
- @Override
- protected void configure(final HttpSecurity httpSecurity) throws Exception {
- httpSecurity.csrf().disable();
- httpSecurity.httpBasic().and().authorizeRequests().anyRequest().authenticated().and().sessionManagement()
- .sessionCreationPolicy(SessionCreationPolicy.STATELESS).and().exceptionHandling()
- .authenticationEntryPoint(unauthorizedEntryPoint());
+ @Bean
+ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
+ http.csrf(csrf -> csrf.disable())
+ .exceptionHandling(exception -> exception.authenticationEntryPoint(unauthorizedEntryPoint()))
+ .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
+ .authorizeHttpRequests((authz) -> authz.anyRequest().authenticated())
+ .userDetailsService(userDetailsService());
+
+ return http.build();
}
@Bean
diff --git a/id-repository/credential-service/src/test/java/io/mosip/credentialstore/test/util/UtilitiesTest.java b/id-repository/credential-service/src/test/java/io/mosip/credentialstore/test/util/UtilitiesTest.java
index 33265aa93..15c8f34ba 100644
--- a/id-repository/credential-service/src/test/java/io/mosip/credentialstore/test/util/UtilitiesTest.java
+++ b/id-repository/credential-service/src/test/java/io/mosip/credentialstore/test/util/UtilitiesTest.java
@@ -1,6 +1,5 @@
package io.mosip.credentialstore.test.util;
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.io.File;
@@ -19,6 +18,7 @@
import org.springframework.context.annotation.Import;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestContext;
+import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.context.WebApplicationContext;
@@ -32,6 +32,7 @@
@WebMvcTest
@Import(EnvUtil.class)
@ContextConfiguration(classes = { TestContext.class, WebApplicationContext.class })
+@TestPropertySource(locations="classpath:CredentialType.json")
public class UtilitiesTest {
String credentialTypeJson;
diff --git a/id-repository/id-repository-core/pom.xml b/id-repository/id-repository-core/pom.xml
index ec94df385..07a2590af 100644
--- a/id-repository/id-repository-core/pom.xml
+++ b/id-repository/id-repository-core/pom.xml
@@ -9,58 +9,50 @@
id-repository-core
- 1.2.1-SNAPSHOT
idrepo-core
ID-Repository core
+ 1.2.1-SNAPSHOT
1.2.1-SNAPSHOT
1.2.1-SNAPSHOT
UTF-8
- 11
- 11
- 2.0.2.RELEASE
+ 21
+ 21
2.0.0.RELEASE
2.9.2
- 1.18.2
+ 1.18.32
42.2.2
- 2.0.0
+ 2.0.9
org.springframework.boot
spring-boot-starter-web
- ${spring.boot.version}
org.springframework.cloud
spring-cloud-starter-config
- ${spring-cloud-config.version}
org.springframework.boot
spring-boot-starter-data-jpa
- ${spring.boot.version}
org.springframework.boot
spring-boot-starter-actuator
- ${spring.boot.version}
com.fasterxml.jackson.module
jackson-module-afterburner
- 2.12.0
org.springframework.boot
spring-boot-starter-webflux
- ${spring.boot.version}
org.springframework.boot
spring-boot-starter-test
- ${spring.boot.version}
io.springfox
@@ -75,41 +67,31 @@
org.projectlombok
lombok
- ${lombok.version}
org.postgresql
postgresql
- ${postgresql.version}
org.powermock
powermock-api-mockito2
- ${powermock.version}
test
org.powermock
powermock-module-junit4
- ${powermock.version}
test
org.springframework.boot
spring-boot-starter-security
- ${spring.boot.version}
org.springframework.security
spring-security-test
- ${spring.security.test.version}
-
- org.springframework.cloud
- spring-cloud-starter-config
- ${spring-cloud-config.version}
-
-
+
+
io.mosip.kernel
kernel-websubclient-api
@@ -128,7 +110,6 @@
org.apache.commons
commons-lang3
- 3.12.0
@@ -136,37 +117,42 @@
com.fasterxml.jackson.core
jackson-databind
- 2.12.0
com.fasterxml.jackson.core
jackson-annotations
- 2.12.0
com.fasterxml.jackson.core
jackson-core
- 2.12.0
com.fasterxml.jackson.datatype
jackson-datatype-jsr310
- 2.12.0
org.mvel
mvel2
2.4.7.Final
-
- org.mvel
- mvel2
- 2.4.7.Final
+
org.mvel
mvel2
- 2.4.7.Final
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+ -parameters
+
+
+
+
+
\ No newline at end of file
diff --git a/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/builder/RestRequestBuilder.java b/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/builder/RestRequestBuilder.java
index 2eec708a3..2f1270321 100644
--- a/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/builder/RestRequestBuilder.java
+++ b/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/builder/RestRequestBuilder.java
@@ -7,7 +7,7 @@
import java.util.Map;
import java.util.Objects;
-import javax.annotation.PostConstruct;
+import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
diff --git a/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/config/IdRepoDataSourceConfig.java b/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/config/IdRepoDataSourceConfig.java
index 98a55302f..488e8db45 100644
--- a/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/config/IdRepoDataSourceConfig.java
+++ b/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/config/IdRepoDataSourceConfig.java
@@ -7,12 +7,9 @@
import javax.sql.DataSource;
-import io.mosip.idrepository.core.entity.Handle;
-import io.mosip.idrepository.core.repository.HandleRepo;
import org.hibernate.Interceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy;
-import org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
@@ -30,9 +27,11 @@
import io.mosip.idrepository.core.builder.RestRequestBuilder;
import io.mosip.idrepository.core.constant.RestServicesConstants;
import io.mosip.idrepository.core.entity.CredentialRequestStatus;
+import io.mosip.idrepository.core.entity.Handle;
import io.mosip.idrepository.core.entity.UinEncryptSalt;
import io.mosip.idrepository.core.entity.UinHashSalt;
import io.mosip.idrepository.core.repository.CredentialRequestStatusRepo;
+import io.mosip.idrepository.core.repository.HandleRepo;
import io.mosip.idrepository.core.repository.UinEncryptSaltRepo;
import io.mosip.idrepository.core.repository.UinHashSaltRepo;
import io.mosip.idrepository.core.util.EnvUtil;
@@ -91,11 +90,11 @@ public JpaTransactionManager transactionManager() {
*/
private Map additionalProperties() {
Map jpaProperties = new HashMap<>();
- jpaProperties.put("hibernate.dialect", "org.hibernate.dialect.PostgreSQL92Dialect");
+ jpaProperties.put("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect");
jpaProperties.put("hibernate.temp.use_jdbc_metadata_defaults", Boolean.FALSE);
jpaProperties.put("hibernate.implicit_naming_strategy", SpringImplicitNamingStrategy.class.getName());
- jpaProperties.put("hibernate.physical_naming_strategy", SpringPhysicalNamingStrategy.class.getName());
- jpaProperties.put("hibernate.ejb.interceptor", interceptor);
+ jpaProperties.put("hibernate.physical_naming_strategy", org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl.class.getName());
+ jpaProperties.put("hibernate.session_factory.interceptor", interceptor);
return jpaProperties;
}
diff --git a/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/entity/CredentialRequestStatus.java b/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/entity/CredentialRequestStatus.java
index ecaa3f483..7c0ce0a36 100644
--- a/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/entity/CredentialRequestStatus.java
+++ b/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/entity/CredentialRequestStatus.java
@@ -3,12 +3,12 @@
import java.io.Serializable;
import java.time.LocalDateTime;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.IdClass;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import jakarta.persistence.IdClass;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.NotNull;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
@@ -23,22 +23,30 @@
@ConditionalOnBean(name = { "idRepoDataSource" })
public class CredentialRequestStatus {
+ @Column(name = "individual_id")
private String individualId;
@Id
+ @Column(name = "individual_id_hash")
private String individualIdHash;
@Id
+ @Column(name = "partner_id")
private String partnerId;
+ @Column(name = "request_id")
private String requestId;
+ @Column(name = "token_id")
private String tokenId;
+ @Column(name = "status")
private String status;
+ @Column(name = "id_transaction_limit")
private Integer idTransactionLimit;
+ @Column(name = "id_expiry_timestamp")
private LocalDateTime idExpiryTimestamp;
@NotNull
diff --git a/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/entity/Handle.java b/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/entity/Handle.java
index 530c8f330..0dace867e 100644
--- a/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/entity/Handle.java
+++ b/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/entity/Handle.java
@@ -1,14 +1,15 @@
package io.mosip.idrepository.core.entity;
-import lombok.Data;
-import lombok.NoArgsConstructor;
+import java.time.LocalDateTime;
+
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import java.time.LocalDateTime;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import jakarta.persistence.Table;
+import lombok.Data;
+import lombok.NoArgsConstructor;
@Data
@Entity
@@ -18,11 +19,13 @@
public class Handle implements HandleInfo {
@Id
+ @Column(name = "id")
private String id; //UUID
@Column(name = "uin_hash")
private String uinHash;
+ @Column(name = "handle")
private String handle;
@Column(name = "handle_hash")
diff --git a/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/entity/UinEncryptSalt.java b/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/entity/UinEncryptSalt.java
index 8044501b0..ac90a8125 100644
--- a/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/entity/UinEncryptSalt.java
+++ b/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/entity/UinEncryptSalt.java
@@ -2,10 +2,10 @@
import java.time.LocalDateTime;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import jakarta.persistence.Table;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -19,11 +19,12 @@
@Data
@Entity
@NoArgsConstructor
-@Table
+@Table(name = "uin_encrypt_salt")
public class UinEncryptSalt {
/** The Id value. */
@Id
+ @Column(name = "id")
private int id;
/** The salt value. */
diff --git a/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/entity/UinHashSalt.java b/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/entity/UinHashSalt.java
index 257a0cb4d..dda47f6d1 100644
--- a/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/entity/UinHashSalt.java
+++ b/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/entity/UinHashSalt.java
@@ -2,10 +2,10 @@
import java.time.LocalDateTime;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import jakarta.persistence.Table;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -18,11 +18,12 @@
@Data
@Entity
@NoArgsConstructor
-@Table
+@Table(name = "uin_hash_salt")
public class UinHashSalt {
/** The Id value. */
@Id
+ @Column(name = "id")
private int id;
/** The salt value. */
diff --git a/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/exception/IdRepoExceptionHandler.java b/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/exception/IdRepoExceptionHandler.java
index 6858dc68e..9b1da9099 100644
--- a/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/exception/IdRepoExceptionHandler.java
+++ b/id-repository/id-repository-core/src/main/java/io/mosip/idrepository/core/exception/IdRepoExceptionHandler.java
@@ -13,8 +13,8 @@
import java.util.stream.Collectors;
import javax.annotation.Nullable;
-import javax.annotation.Resource;
-import javax.servlet.ServletException;
+import jakarta.annotation.Resource;
+import jakarta.servlet.ServletException;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.BeansException;
@@ -24,6 +24,7 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.HttpMessageNotReadableException;
+import org.springframework.http.HttpStatusCode;
import org.springframework.lang.NonNull;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@@ -40,6 +41,7 @@
import io.mosip.kernel.core.exception.BaseUncheckedException;
import io.mosip.kernel.core.exception.ServiceError;
import io.mosip.kernel.core.logger.spi.Logger;
+import org.springframework.web.servlet.resource.NoResourceFoundException;
/**
* The Class IdRepoExceptionHandler - Handler class for all exceptions thrown in
@@ -79,6 +81,33 @@ public class IdRepoExceptionHandler extends ResponseEntityExceptionHandler {
@Resource
private Map id;
+ private static final String DATE_TIME_PARSE_EXCEPTION = "DateTimeParseException";
+
+ @Override
+ protected ResponseEntity
-
+
id-repository-core
id-repository-vid-service
id-repository-identity-service
- credential-request-generator
- credential-service
- id-repository-salt-generator
- id-repository-credentials-feeder
+ credential-request-generator
+ credential-service
+ id-repository-salt-generator
+ id-repository-credentials-feeder
-
+
${parent.version}
3.0.2
3.1.0
2.22.0
- 0.8.5
+ 0.8.11
3.7.0.1746
3.2.0
- **/constant/**,**/config/**,**/httpfilter/**,**/cache/**,**/dto/**,**/entity/**,**/model/**,**/exception/**,**/repository/**,**/security/**,**/*Config.java,**/*BootApplication.java,**/*VertxApplication.java,**/cbeffutil/**
+
+ **/constant/**,**/config/**,**/httpfilter/**,**/cache/**,**/dto/**,**/entity/**,**/model/**,**/exception/**,**/repository/**,**/security/**,**/*Config.java,**/*BootApplication.java,**/*VertxApplication.java,**/cbeffutil/**
**/dto/**,**/entity/**,**/config/**,**/api/**
- 11
- 11
+ 21
+ 21
3.8.0
-
+
2.0.2.RELEASE
2.0.7.RELEASE
5.0.5.RELEASE
2.0.0.RELEASE
-
+
4.5.6
1.18.8
0.6.0
2.9.2
1.4.197
-
+
4.12
- 2.22.0
-
+ 3.4.3
1.2.1-SNAPSHOT
+ 1.2.1-SNAPSHOT
+ 0.8.11
-
-
+
+
+
+ io.mosip.kernel
+ kernel-bom
+ 1.2.1-SNAPSHOT
+ pom
+ import
+
+
+
+
+
+
+
+
+ org.junit.vintage
+ junit-vintage-engine
+
junit
junit
- ${junit.version}
test
-
-
+
+
+ io.mosip.kernel
+ kernel-biometrics-api
+ 1.2.1-SNAPSHOT
+
+
+
javax.xml.bind
jaxb-api
- 2.3.1
- javax.activation
- activation
- 1.1
+ javax.activation
+ activation
org.glassfish.jaxb
jaxb-runtime
- 2.3.1
- org.mockito
- mockito-core
- ${mockito.version}
- test
+ org.mockito
+ mockito-core
+ test
+ 3.11.2
- org.javassist
- javassist
- 3.27.0-GA
+ org.javassist
+ javassist
@@ -151,8 +173,13 @@
kernel-logger-logback
${kernel.logger.logback.version}
+
+ org.springdoc
+ springdoc-openapi-starter-webmvc-ui
+ 2.5.0
+
-
+
@@ -160,10 +187,17 @@
maven-surefire-plugin
${maven.surefire.plugin.version}
- ${skipTests}
+ false
false
- ${argLine} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --illegal-access=permit
+ ${argLine}
+ --add-opens java.base/java.lang=ALL-UNNAMED
+ --add-opens java.base/sun.reflect.annotation=ALL-UNNAMED
+ --add-opens java.base/sun.security.jca=ALL-UNNAMED
+ --add-opens java.base/sun.security.util=ALL-UNNAMED
+ --add-opens java.base/jdk.internal.util=ALL-UNNAMED
+ --add-opens java.base/java.util=ALL-UNNAMED
+ --illegal-access=debug
@@ -236,119 +270,126 @@
maven-javadoc-plugin
${maven.javadoc.version}
- true
none
- maven-deploy-plugin
- 2.8.1
-
-
- default-deploy
- deploy
-
- deploy
-
-
-
-
-
- org.sonatype.plugins
- nexus-staging-maven-plugin
- 1.6.7
- true
-
-
- default-deploy
- deploy
-
- deploy
-
-
-
-
- ossrh
- https://oss.sonatype.org/
- false
-
-
+ maven-deploy-plugin
+ 2.8.1
+
+
+ default-deploy
+ deploy
+
+ deploy
+
+
+
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+ 1.6.7
+ true
+
+
+ default-deploy
+ deploy
+
+ deploy
+
+
+
+
+ ossrh
+ https://oss.sonatype.org/
+ false
+
+
-
- org.apache.maven.plugins
- maven-source-plugin
- 2.2.1
-
-
- attach-sources
-
- jar-no-fork
-
-
-
-
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 2.2.1
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 3.2.0
-
-
- attach-javadocs
-
- jar
-
-
-
-
- none
-
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
- 1.5
-
-
- sign-artifacts
- verify
-
- sign
-
-
-
- --pinentry-mode
- loopback
-
-
-
-
-
-
- pl.project13.maven
- git-commit-id-plugin
- 3.0.1
-
-
- get-the-git-infos
-
- revision
-
- validate
-
-
-
- true
- ${project.build.outputDirectory}/git.properties
-
- ^git.build.(time|version)$
- ^git.commit.id.(abbrev|full)$
-
- full
- ${project.basedir}/.git
-
-
-
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.2.0
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+ none
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 1.5
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+ --pinentry-mode
+ loopback
+
+
+
+
+
+
+ pl.project13.maven
+ git-commit-id-plugin
+ 3.0.1
+
+
+ get-the-git-infos
+
+ revision
+
+ validate
+
+
+
+ true
+
+ ${project.build.outputDirectory}/git.properties
+
+ ^git.build.(time|version)$
+ ^git.commit.id.(abbrev|full)$
+
+ full
+ ${project.basedir}/.git
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+ true
+
+
@@ -415,7 +456,8 @@
--server.port=8090
- --server.servlet.path=/app/generic
+
+ --server.servlet.path=/app/generic
@@ -447,10 +489,10 @@
- http://localhost:8090/app/generic/v3/api-docs
+
+ http://localhost:8090/app/generic/v3/api-docs
${name}-openapi.json
${project.build.directory}
- false