From 4f4ad3fc511f572281ae941cb444299fe652b0cc Mon Sep 17 00:00:00 2001 From: Mohanachandran S Date: Wed, 26 Mar 2025 14:01:38 +0530 Subject: [PATCH 1/5] MOSIP-40951 - Removed auth demo service from release branch as its not part of apites commons release Signed-off-by: Mohanachandran S --- apitest-commons/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apitest-commons/README.md b/apitest-commons/README.md index a5e7a2a098..d6c1e48ca3 100644 --- a/apitest-commons/README.md +++ b/apitest-commons/README.md @@ -14,6 +14,7 @@ The API Test Commons is a shared codebase used for executing module-wise automat - ESignet-signup - Mimoto - Inji-Certify +- Inji-Verify --- @@ -84,7 +85,7 @@ Ensure the following software is installed on the machine from where the automat io.mosip.testrig.apirig.apitest.commons apitest-commons - 1.3.2-SNAPSHOT + 1.3.2 --- From 33bb596d968c7fe24262993d8db6e18a77d01a54 Mon Sep 17 00:00:00 2001 From: Mohanachandran S Date: Wed, 26 Mar 2025 14:02:03 +0530 Subject: [PATCH 2/5] MOSIP-40951 - Removed auth demo service from release branch as its not part of apites commons release Signed-off-by: Mohanachandran S --- .github/workflows/apitest-push-trigger.yml | 27 - README.md | 2 +- authentication-demo-service/.gitignore | 4 - authentication-demo-service/Dockerfile | 86 -- authentication-demo-service/README.md | 26 - authentication-demo-service/entrypoint.sh | 13 - .../lib/Keystore/ExportPrivateKey.java | 53 - .../lib/Keystore/MosipTestCert.cer | 21 - .../lib/Keystore/MosipTestCert.pem | 21 - .../lib/Keystore/PrivateKey.p12 | Bin 2579 -> 0 bytes .../lib/Keystore/PrivateKey.pem | 3 - .../lib/Keystore/PublicKey.pem | Bin 873 -> 0 bytes .../lib/Keystore/README.txt | 72 - .../lib/Keystore/keystore.jks | Bin 2579 -> 0 bytes .../lib/Keystore/keystore.jks.old | Bin 2579 -> 0 bytes authentication-demo-service/pom.xml | 391 ------ .../demo/service/PartnerDemoApplication.java | 35 - .../demo/service/config/BIRDeserializer.java | 45 - .../service/config/BioProviderConfig.java | 52 - .../service/config/OpenApiProperties.java | 45 - .../demo/service/config/SwaggerConfig.java | 57 - .../controller/AuthRequestController.java | 1230 ----------------- .../controller/BiometricValidation.java | 299 ---- .../demo/service/controller/Decode.java | 77 -- .../demo/service/controller/Decrypt.java | 518 ------- .../demo/service/controller/Encode.java | 59 - .../demo/service/controller/Encrypt.java | 609 -------- .../JWSSignAndVerifyController.java | 355 ----- .../controller/SQLPerformanceController.java | 82 -- .../controller/SignatureController.java | 85 -- .../demo/service/controller/Test.java | 12 - .../demo/service/controller/WebSub.java | 127 -- .../dto/CertificateChainResponseDto.java | 9 - .../service/dto/CryptomanagerRequestDto.java | 14 - .../service/dto/CryptomanagerResponseDto.java | 9 - .../demo/service/dto/EncryptedRequest.java | 9 - .../service/dto/EncryptionRequestDto.java | 12 - .../service/dto/EncryptionResponseDto.java | 10 - .../demo/service/dto/Event.java | 23 - .../demo/service/dto/EventModel.java | 12 - .../service/dto/PublicKeyResponseDTO.java | 49 - .../authentication/demo/service/dto/Type.java | 11 - .../service/dto/ValidateSignRequestDto.java | 24 - .../demo/service/helper/CertificateTypes.java | 18 - .../demo/service/helper/CryptoCoreUtil.java | 365 ----- .../demo/service/helper/CryptoUtility.java | 143 -- .../demo/service/helper/DBUtil.java | 46 - .../demo/service/helper/KeyMgrUtil.java | 503 ------- .../demo/service/helper/PartnerTypes.java | 20 - .../main/resources/application-dev.properties | 580 -------- .../src/main/resources/application.properties | 586 -------- .../src/main/resources/bootstrap.properties | 42 - .../resources/mosip-identity-json-schema.json | 161 --- .../test/AuthRequestControllerTest.java | 311 ----- .../demo/service/test/DecryptTest.java | 76 - .../service/test/DigitalSignatureTest.java | 56 - .../demo/service/test/EncryptTest.java | 152 -- .../demo/service/test/SignatureTest.java | 44 - .../src/test/resources/application.properties | 552 -------- .../src/test/resources/bootstrap.properties | 5 - .../test/resources/errormessages.properties | 47 - .../src/test/resources/ida-mapping.json | 101 -- .../src/test/resources/idaLogger.xml | 11 - 63 files changed, 1 insertion(+), 8406 deletions(-) delete mode 100644 authentication-demo-service/.gitignore delete mode 100644 authentication-demo-service/Dockerfile delete mode 100644 authentication-demo-service/README.md delete mode 100644 authentication-demo-service/entrypoint.sh delete mode 100644 authentication-demo-service/lib/Keystore/ExportPrivateKey.java delete mode 100644 authentication-demo-service/lib/Keystore/MosipTestCert.cer delete mode 100644 authentication-demo-service/lib/Keystore/MosipTestCert.pem delete mode 100644 authentication-demo-service/lib/Keystore/PrivateKey.p12 delete mode 100644 authentication-demo-service/lib/Keystore/PrivateKey.pem delete mode 100644 authentication-demo-service/lib/Keystore/PublicKey.pem delete mode 100644 authentication-demo-service/lib/Keystore/README.txt delete mode 100644 authentication-demo-service/lib/Keystore/keystore.jks delete mode 100644 authentication-demo-service/lib/Keystore/keystore.jks.old delete mode 100644 authentication-demo-service/pom.xml delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/PartnerDemoApplication.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/config/BIRDeserializer.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/config/BioProviderConfig.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/config/OpenApiProperties.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/config/SwaggerConfig.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/AuthRequestController.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/BiometricValidation.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Decode.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Decrypt.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Encode.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Encrypt.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/JWSSignAndVerifyController.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/SQLPerformanceController.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/SignatureController.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Test.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/WebSub.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/CertificateChainResponseDto.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/CryptomanagerRequestDto.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/CryptomanagerResponseDto.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/EncryptedRequest.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/EncryptionRequestDto.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/EncryptionResponseDto.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/Event.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/EventModel.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/PublicKeyResponseDTO.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/Type.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/ValidateSignRequestDto.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/CertificateTypes.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/CryptoCoreUtil.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/CryptoUtility.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/DBUtil.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/KeyMgrUtil.java delete mode 100644 authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/PartnerTypes.java delete mode 100644 authentication-demo-service/src/main/resources/application-dev.properties delete mode 100644 authentication-demo-service/src/main/resources/application.properties delete mode 100644 authentication-demo-service/src/main/resources/bootstrap.properties delete mode 100644 authentication-demo-service/src/main/resources/mosip-identity-json-schema.json delete mode 100644 authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/AuthRequestControllerTest.java delete mode 100644 authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/DecryptTest.java delete mode 100644 authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/DigitalSignatureTest.java delete mode 100644 authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/EncryptTest.java delete mode 100644 authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/SignatureTest.java delete mode 100644 authentication-demo-service/src/test/resources/application.properties delete mode 100644 authentication-demo-service/src/test/resources/bootstrap.properties delete mode 100644 authentication-demo-service/src/test/resources/errormessages.properties delete mode 100644 authentication-demo-service/src/test/resources/ida-mapping.json delete mode 100644 authentication-demo-service/src/test/resources/idaLogger.xml diff --git a/.github/workflows/apitest-push-trigger.yml b/.github/workflows/apitest-push-trigger.yml index d705909de1..c3f27d1a17 100644 --- a/.github/workflows/apitest-push-trigger.yml +++ b/.github/workflows/apitest-push-trigger.yml @@ -56,33 +56,6 @@ jobs: uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master-java21 with: SERVICE_LOCATION: ./apitest-commons - secrets: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - ORG_KEY: ${{ secrets.ORG_KEY }} - OSSRH_USER: ${{ secrets.OSSRH_USER }} - OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }} - OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} - GPG_SECRET: ${{ secrets.GPG_SECRET }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - - build-maven-authentication-demo-service: - uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21 - with: - SERVICE_LOCATION: ./authentication-demo-service - BUILD_ARTIFACT: authentication-demo-service - secrets: - OSSRH_USER: ${{ secrets.OSSRH_USER }} - OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }} - OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} - GPG_SECRET: ${{ secrets.GPG_SECRET }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - - sonar_analysis-authentication-demo-service: - needs: build-maven-authentication-demo-service - if: "${{ github.event_name != 'pull_request' }}" - uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master-java21 - with: - SERVICE_LOCATION: ./authentication-demo-service secrets: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} ORG_KEY: ${{ secrets.ORG_KEY }} diff --git a/README.md b/README.md index 665a06d754..a993615029 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ To use this repository, ensure you have: io.mosip.testrig.apirig.apitest.commons apitest-commons - 1.3.2-SNAPSHOT + 1.3.2 --- diff --git a/authentication-demo-service/.gitignore b/authentication-demo-service/.gitignore deleted file mode 100644 index 9f3662f45d..0000000000 --- a/authentication-demo-service/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -logs/ -target/ -.project -.settings \ No newline at end of file diff --git a/authentication-demo-service/Dockerfile b/authentication-demo-service/Dockerfile deleted file mode 100644 index 178cadc86a..0000000000 --- a/authentication-demo-service/Dockerfile +++ /dev/null @@ -1,86 +0,0 @@ -FROM eclipse-temurin:21-jre-alpine - -ARG SOURCE -ARG COMMIT_HASH -ARG COMMIT_ID -ARG BUILD_TIME -LABEL source=${SOURCE} -LABEL commit_hash=${COMMIT_HASH} -LABEL commit_id=${COMMIT_ID} -LABEL build_time=${BUILD_TIME} - -# can be passed during Docker build as build time environment for github branch to pickup configuration from. -ARG spring_config_label - -# can be passed during Docker build as build time environment for spring profiles active -ARG active_profile - -# can be passed during Docker build as build time environment for config server URL -ARG spring_config_url - -# can be passed during Docker build as build time environment for glowroot -ARG is_glowroot - -# can be passed during Docker build as build time environment for artifactory URL -ARG artifactory_url - -# environment variable to pass active profile such as DEV, QA etc at docker runtime -ENV active_profile_env=${active_profile} - -# environment variable to pass github branch to pickup configuration from, at docker runtime -ENV spring_config_label_env=${spring_config_label} - -# environment variable to pass spring configuration url, at docker runtime -ENV spring_config_url_env=${spring_config_url} - -# environment variable to pass glowroot, at docker runtime -ENV is_glowroot_env=${is_glowroot} - -# environment variable to pass artifactory url, at docker runtime -ENV artifactory_url_env=${artifactory_url} - -# can be passed during Docker build as build time environment for github branch to pickup configuration from. -ARG container_user=mosip - -# can be passed during Docker build as build time environment for github branch to pickup configuration from. -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=1002 - -# can be passed during Docker build as build time environment for github branch to pickup configuration from. -ARG container_user_gid=1001 - -# set working directory for the user -WORKDIR /home/${container_user} - -ENV work_dir=/home/${container_user} - -ARG loader_path=${work_dir}/additional_jars/ - -ENV loader_path_env=${loader_path} - -COPY ./target/authentication-demo-service-*.jar authentication-demo-service.jar - -ADD entrypoint.sh $work_dir/entrypoint.sh - -# install packages and create user -RUN apk -q update \ - && apk add -q unzip wget bash \ - && 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} \ - && mkdir -p ${loader_path} \ - && chmod +x $work_dir/entrypoint.sh \ - && mkdir -p /usr/local/openjdk-21/lib/security && touch /usr/local/openjdk-21/lib/security/cacerts \ - && chown ${container_user}:${container_user} /usr/local/openjdk-21/lib/security/cacerts \ - && chmod 644 /usr/local/openjdk-21/lib/security/cacerts \ - && chown -R ${container_user}:${container_user} /home/${container_user} - -# select container user for all tasks -USER ${container_user_uid}:${container_user_gid} - -EXPOSE 8384 - -ENV authCertsPath=/home/${container_user}/authcerts - -ENTRYPOINT ["/bin/bash", "-c", "./entrypoint.sh"] diff --git a/authentication-demo-service/README.md b/authentication-demo-service/README.md deleted file mode 100644 index 0dba382d4f..0000000000 --- a/authentication-demo-service/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# Authentication Demo Service - -## Overview -Demo authentication service used by automation tests. - -## Build & run (for developers) -Prerequisites: -[Config Server](https://docs.mosip.io/1.2.0/modules/module-configuration#config-server) - -The project requires JDK 1.21. -1. Build and install: - ``` - $ cd authentication-demo-service - $ mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dgpg.skip=true - ``` - -2. Build Docker for a service: - ``` - $ cd - $ docker build -f Dockerfile - ``` - -### Configuration -[application-default.properties](https://github.com/mosip/mosip-config/blob/dev-integration/application-default.properties) - -defined here. \ No newline at end of file diff --git a/authentication-demo-service/entrypoint.sh b/authentication-demo-service/entrypoint.sh deleted file mode 100644 index 57e8c72cc6..0000000000 --- a/authentication-demo-service/entrypoint.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - - -## Run authentication demo service -if [ "$is_glowroot_env" = "present" ]; then - wget -q --show-progress "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; - unzip glowroot.zip ; - rm -rf glowroot.zip ; - sed -i 's//authentication-demo-service/g' glowroot/glowroot.properties ; - java -jar -javaagent:glowroot/glowroot.jar -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}" authentication-demo-service.jar ; -else - java -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" authentication-demo-service.jar ; -fi diff --git a/authentication-demo-service/lib/Keystore/ExportPrivateKey.java b/authentication-demo-service/lib/Keystore/ExportPrivateKey.java deleted file mode 100644 index ecb02d20be..0000000000 --- a/authentication-demo-service/lib/Keystore/ExportPrivateKey.java +++ /dev/null @@ -1,53 +0,0 @@ -import java.io.File; -import java.io.FileInputStream; -import java.io.FileWriter; -import java.security.Key; -import java.security.KeyStore; -import java.util.Base64; -/** - * Class to export private key from key store in PEM format. - * This is used since keytool cannot be used for this purpose. - * Referenced from https://security.stackexchange.com/a/114776/221987 - * - * Command Line: java ExportPrivateKey JCEKS - * - * Example: java ExportPrivateKey keystore.jks PKCS12 somepassword mosip.io somepassword PrivateKey.pem - - * @author Loganathan.Sekar - * - */ - - -public class ExportPrivateKey -{ - private File keystoreFile; - private String keyStoreType; - private char[] keyStorePassword; - private char[] keyPassword; - private String alias; - private File exportedFile; - - public void export() throws Exception { - KeyStore keystore = KeyStore.getInstance(keyStoreType); - keystore.load(new FileInputStream(keystoreFile), keyStorePassword); - Key key = keystore.getKey(alias, keyPassword); - String encoded = Base64.getEncoder().encodeToString(key.getEncoded()); - FileWriter fw = new FileWriter(exportedFile); - fw.write("---BEGIN PRIVATE KEY---\n"); - fw.write(encoded); - fw.write("\n"); - fw.write("---END PRIVATE KEY---"); - fw.close(); - } - - public static void main(String args[]) throws Exception { - ExportPrivateKey export = new ExportPrivateKey(); - export.keystoreFile = new File(args[0]); - export.keyStoreType = args[1]; - export.keyStorePassword = args[2].toCharArray(); - export.alias = args[3]; - export.keyPassword = args[4].toCharArray(); - export.exportedFile = new File(args[5]); - export.export(); - } -} \ No newline at end of file diff --git a/authentication-demo-service/lib/Keystore/MosipTestCert.cer b/authentication-demo-service/lib/Keystore/MosipTestCert.cer deleted file mode 100644 index d744630a98..0000000000 --- a/authentication-demo-service/lib/Keystore/MosipTestCert.cer +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDZTCCAk2gAwIBAgIEXVjtVDANBgkqhkiG9w0BAQsFADBjMQswCQYDVQQGEwJJ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XDItc1i8ZpV2AUZTwAQdb -yAK6/5b3BqYQ ------END CERTIFICATE----- diff --git a/authentication-demo-service/lib/Keystore/MosipTestCert.pem b/authentication-demo-service/lib/Keystore/MosipTestCert.pem deleted file mode 100644 index a1dc2ef50d..0000000000 --- a/authentication-demo-service/lib/Keystore/MosipTestCert.pem +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDZTCCAk2gAwIBAgIEXVjtVDANBgkqhkiG9w0BAQsFADBjMQswCQYDVQQGEwJJ -TjELMAkGA1UECBMCS0ExEjAQBgNVBAcTCUJhbmdhbG9yZTEOMAwGA1UEChMFSUlJ -VEIxDjAMBgNVBAsTBU1PU0lQMRMwEQYDVQQDDApNT1NJUF9UZXN0MB4XDTIwMTAx -MzA1MzkzNloXDTIzMTAxMzA1MzkzNlowYzELMAkGA1UEBhMCSU4xCzAJBgNVBAgT -AktBMRIwEAYDVQQHEwlCYW5nYWxvcmUxDjAMBgNVBAoTBUlJSVRCMQ4wDAYDVQQL -EwVNT1NJUDETMBEGA1UEAwwKTU9TSVBfVGVzdDCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAPK97wngjl7WF7EDdpCgq8WIP9gRaUFzTU8TIagWwjUfFQiQ -5tCK6U7dgXl2fSGUeTHxSZyYcafM03xFqBFC+l359X1DULteoJEfLdCTbDqIGX1a -iA9MnEGm0wSZEWwn1EqaXPazL65O/KP7oiiQgflLLhLImGOIw31zP7yQQTx+HsFf -SUlmx+sR+dkdBJivGH6x7oFQN/tTbWhlpTAiV0EUIVjbFKglKcYxohYUg8JXo87K -YGFwHxyXnzey59lm8wBgYFbEHhxxumkxh9kvzteED8gd1glyEWq4xQMP5v6ppgvV -xUNOog49tINY2lQnlBdjSEogtzSvZtfVezBjyPMCAwEAAaMhMB8wHQYDVR0OBBYE -FFNoJX0tSFoVyDYkgrDPY/RzvKYnMA0GCSqGSIb3DQEBCwUAA4IBAQBSB3VKv3oD -tueFosT6TBaW+ZIIRhC0lwHyOtA8oqP7sjtCkKQO71MDHYGmpwZZKRuwAvelBltd -Mkah5a/ne+b0o+A9BNoDFiH08pX4CL9drE9VNHNWrt63DaTa54Eodou9vTwOeq2e -RePZdlfYpJ/LtOsNGXm9hJFac3YvZV9812lDIgV/bCsN18MF+pfjE7QnZ02hp2IM -kysSjAyTNKUCnNFW/ccXoklw834COpu+weZivfS7XgUcrXSoZ4flZNVtE9CivNUH -nIyQAG0oBrnVekkKl1vDdEGa2OmljXkD9Nzq0EwUVYTXDItc1i8ZpV2AUZTwAQdb -yAK6/5b3BqYQ ------END CERTIFICATE----- diff --git a/authentication-demo-service/lib/Keystore/PrivateKey.p12 b/authentication-demo-service/lib/Keystore/PrivateKey.p12 deleted file mode 100644 index 6a9adb390dfbf3ae0e962c5f486e3ee7957a07de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2579 zcmY+EcRU*i8^D*&pv+JrR4p+pwT1M zUM=4mCfSz~^?^ld$~*RII-i|-#LNMUG-Q-_W_@|>QS2|F5(^X2=*o7UPk)NJ>3;I7 z0$vb^UTyCb*{=RFm0Ehm&N-Esiwb8Z8#O7EPjVZq>J6r)+=& zsv5BJM^WVzo+|MSG?UKo=PRU&y9;tBb+Z~fh|-#y^%`;nb>RKsCw!gS^Hx7(lClf> zN+K>jN#bp}Cg?em*zc8A^X$bdlLRJ4Z=zhIyG-C&WOVhn z-4+$Pz1h1D;ba+LqHHNfA4}&>SNnnpS%^Bdvqr|Sn+5%GDBrVWqY9~R+NfzzsCXJa z^n)-uxmMu&f)@CLOIm0q0;PK=M=ZxS>bA8)!No*Mzy3?j6-s7YuJW6X@1sNycZIOk zA?)Kc9BAJ}{^_>W2GzCNK+K^1bymIsp>YR1d+&x7!;t~~=FEodDSB*Vrn(S!?4SWLv~cDG zhIDbdmvplaGeZ=;$Iv3=HbMqmhox&RA0_*89#W~N7ve{s8YT0YP?p)^eeK3W4{@S zjM~n%;(VQpI006Qrn5S=Ir4SbE@Y-k&SQvH{_D@>vZdX|md`8=ous#>F@HyFc5#u9bRFfVyzI0F+}i>QOuU^)+%)l_}ggVY8V3=j@f1 zy%MD9<@6AfE@D=xK(#9MFKoEyh$jIsf zWGSSaR(9EpYWtLZNF;4M&N|sb@(%5n&q)(Ta+-ds=zV_<*fC+KB@Xn{3Z|t$0s0_V z{ecNw%`SeNwFS&8^=R>qe!c58PwMQpg{^63Wob8S##&9A)*eaE!!GyOW^PFamjv{* zB3oro+Ui~vgkCsXE9xFJQU-ObZYI7hes$VAa!`whb7PQ6u=heFlOMqa1atG6&M+27 z%S$~8k>RoM9Obdpqa1a687BVF7@`KDge9n?Q?pn*bJJW-A4+J<5swRMfh0#4Zvi#c z2@(U*%B`axj zFyDq6t$g0Ume#g9np(0!XuuK6PkMosZN@nZZ@7k1F8v&4O!Y~bLcVtpuD_IQEH&~r z-dqep+?ETQm@|2h{TE&MK z4@-6wv!Li%<@dR={b>dGaM$lNZQg2<<-GS|aosqN9e84fmgJzs%|Z5U6?r_~p)d7y zrVRHGbH_eWjt!SyaBAii!j9)(h;>~~)xo4d$aG}tg_YH!Ezb11t9*U zq6tGO*_(~58oNkMq$rYw5hBYD0`fxuV4gv<5A?0Z*bis~GK(&kC3OTX!h(7FR@llJ ZYJHZ!lq|B{^`1bQ_IOGHK@3UczW{Kqyea?y diff --git a/authentication-demo-service/lib/Keystore/PrivateKey.pem b/authentication-demo-service/lib/Keystore/PrivateKey.pem deleted file mode 100644 index 4c6d4dfc7f..0000000000 --- a/authentication-demo-service/lib/Keystore/PrivateKey.pem +++ /dev/null @@ -1,3 +0,0 @@ ----BEGIN PRIVATE KEY--- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDyve8J4I5e1hexA3aQoKvFiD/YEWlBc01PEyGoFsI1HxUIkObQiulO3YF5dn0hlHkx8UmcmHGnzNN8RagRQvpd+fV9Q1C7XqCRHy3Qk2w6iBl9WogPTJxBptMEmRFsJ9RKmlz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34xAoGAFJ/jmuTQmctilWtr42V2TffSNgnTzUF9QhJh5px+COXAZLY+T+gezMpC8FQ7+zxfYwfZm1pvxPDrKb3/1cbtxcrt50sg8M0ilUehseStMfxtA0kPuvHWc+JquUcJD/EV7S3tqtB6NzhifuSvbUZiFilIkPb5iIjdoKgQ1Z0D7D8CgYEAq2GAfN0vUS0Ws2nA5v2r/FbVQgveI6KpoUrGAd/KJg6JnglV5fLQQT/RuncTbaAm5niOo+PAu+kJNoZiS/NaCqb6Oj5XU6zDLApEohP+MKIUiYyg+XtLDLw5J8tmqx5s55amGM79JZ7O6wYWVTErdSc1fS2LA6B2Mb1bC7Bwsag= ----END PRIVATE KEY--- \ No newline at end of file diff --git a/authentication-demo-service/lib/Keystore/PublicKey.pem b/authentication-demo-service/lib/Keystore/PublicKey.pem deleted file mode 100644 index 1a372f50dffa7b1994f066fefb55092d2f4e1aa1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 873 zcmXqLVoo(^V)9+U%*4pV#1b3vHpGCJjZ>@5qwPB{BO^B}gF&((w*e;`b0`a&Fq5Yr zjKd+!NVHf6fO3X`7%*iiGHRLnk0f})5vwC`ZhB(3a+`_EB{=uFBhQbDd zAbDmUE-*hnB(=E2Ku(<3$iUFR(AdD#*wWZ63dl7^;?lzPM}R8=1={ELeTC!~TX~rem?Mzp&y8u|uZvq8t;RUFdr0cek;! ztX6SKrQt`8&SpVn%Yu;o4&RJrf*l>f{c_dwQlFe=Yd)rYy^h z^%8X(-!%r9{|?U0NL^~66z(XZ7;#%sPA{l23eQVrFDuT&!pyZy*bdL0LW)F&2^F4Aoj)k0{X-W-3h^&L@8< z-m^>{IS_#<2pEWr3_@uNbmW(h*tDOMINSubOlSOLb-`xQ;@_LBohB^d zdmqd!+qi5wTcoD+2Bz;z*`i~O+!j7v|GfIym&FfkS#B|lDSr7h^#{lP*fsv4CdFav z?rrB?a_f1cMp^gXy*7MRYv;K>zF8K2W6Au}TVC@@R_<+?7*$-RpBi6tJ=0lM~+H;kCPR|5}Tn)CJSF1d^rbizxah!GI< not used -keytool -certreq -alias mosip.io -keystore keystore.jks -file MosipTestCert.csr - -Export cert as PEM: -keytool -exportcert -alias mosip.io -keystore keystore.jks -rfc -file MosipTestCert.pem - -Export Public Key: -keytool -export -alias mosip.io -keystore keystore.jks -file PublicKey.pem - -Export Private Key: -keytool -importkeystore -srckeystore keystore.jks -srcstorepass somepassword -srckeypass somepassword -srcalias mosip.io -destalias mosip.io -destkeystore PrivateKey.p12 -deststoretype PKCS12 -deststorepass somepassword -destkeypass somepassword - -//Linux -- Not used -//openssl pkcs12 -in PrivateKey.p12 -nodes -nocerts -out PrivateKey.pem - - -//Any OS - USED -ExportPrivateKey.java --- -import sun.misc.BASE64Encoder; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileWriter; -import java.security.*; - -public class ExportPrivateKey -{ - private File keystoreFile; - private String keyStoreType; - private char[] keyStorePassword; - private char[] keyPassword; - private String alias; - private File exportedFile; - - public void export() throws Exception { - KeyStore keystore = KeyStore.getInstance(keyStoreType); - BASE64Encoder encoder = new BASE64Encoder(); - keystore.load(new FileInputStream(keystoreFile), keyStorePassword); - Key key = keystore.getKey(alias, keyPassword); - String encoded = encoder.encode(key.getEncoded()); - FileWriter fw = new FileWriter(exportedFile); - fw.write("---BEGIN PRIVATE KEY---\n"); - fw.write(encoded); - fw.write("\n"); - fw.write("---END PRIVATE KEY---"); - fw.close(); - } - - public static void main(String args[]) throws Exception { - ExportPrivateKey export = new ExportPrivateKey(); - export.keystoreFile = new File(args[0]); - export.keyStoreType = args[1]; - export.keyStorePassword = args[2].toCharArray(); - export.alias = args[3]; - export.keyPassword = args[4].toCharArray(); - export.exportedFile = new File(args[5]); - export.export(); - } -} --- -javac ExportPrivateKey.java -java ExportPrivateKey JCEKS - -Example: -java ExportPrivateKey keystore.jks PKCS12 somepassword mosip.io somepassword PrivateKey.pem diff --git a/authentication-demo-service/lib/Keystore/keystore.jks b/authentication-demo-service/lib/Keystore/keystore.jks deleted file mode 100644 index e5fc2931729b0849d04e8d9c80b8c81149407753..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2579 zcmY+EWmFW17RRR;WI$p_=|+0U0US|4IwU2AR#IS4x?u#QWt2u@X#q#NB?Skhgq7|_ zxVcIO#)i2Ro%6CiwnD%zP2iUt{bYcNEqrLEXE?M)NciTER zxPBL#D(<;|(z6SD9Qsa(X|9MvgMW4=fo&?9O3t|DL~Sb(!Y))EuAD@4*4m*_LB^wf zfC_@;G^YJz11FN0`n(lgGSgKaM{eV$Jl(!fG#&2s`l;{;N%q3$E7x3yS@7sdZ-I=g zFbuZc+U-=#eYYUpJlz31=@QLx>Owg$_;|A)jHXTE;Es4-UtHQYCO+f$GjHJ*mt;+1 z#+%sLsqIhZcxuzBfUf81&6UAg5@9cuB|$5^HP(jKH{1q5Q@`u4(3kaJmdHr7sq={m zyPApc!(SEQn}o7n#!0?F?d(eWBvqNGOm6_ghIa#6zsoSBJ9|coDIR|6q$GF^toOL;a2kS@n=?Z)Ln#Yo-nhW0QTFmX9D~s$`;d(>& z$BZr?J(?B<8;q8lOeXM*t#KFQLuInhY%wQO*!|%%O^8BjlwsTXumw=)sQ9a<{L{F zGVkLX*Gq00A$}hqF?g0geGwS(oUmoK?=@>uFk=;?sDT%Mwn;l<6g8i#<_wLp&~-waJXS`Q#VJmYdvPI(YqV1oE{8J>P|C9SvbEIQr=Qv4J`PBK%8;4e zM5nf>VelYBYFKGvZ2Y{}B+3R>vYqx3piXRc;P09jap5tORkABPsp>)xCodF2i#CKP zjlA5RBB@l4HF7^G$Y+_`s&K)>y4p9Alh4RA8+uu%pn-&EYeASpNjQ4bU|+9}(GYdE z;BafoCrQQh!5#%Nc~!d*o-?#$#`;lmLSV$d8p{eP6^=MZV(Zsk^x48jeMXz{mLcw; z`rM{bGR;lAmi4_EWxJYq!OYh-40Wq-^zkr#`XHQlKt^K4p_B1E1*Cq@fd1@P5Zj+s z12z}|Cl*D~{ma72UCuR2NxP!3NN0>Y=@@84&cQB0oJ9aT?gt(M6Qd(SGN)~Y~P}JW`#L#P} z3ST3B5D;)ZIR8n2|FSIfKbBpS@Qm*P%!SE7KSR#qnw0OxePaEuWka#x4dx9QmY-JW z58ORE{34{7Y0Ku7m9}i&(JJ+9T9CELZ1uJSuTz%z8bK3vJB*y|k0!m%*=`~vQt`9O-5h92@6l z;`l!Y+FZsB*jgt=*je-cwmn_<2X#G~(uQr$?!&m39|qeOO)dPOI!!Qq_ud`)DNo-b zW#OUngdI^!yV7}tkY)h$CowqanA)D{(ZBYwf@~+@#AF9=DWpmJdg<_Q|{uZch z3iWoIua{+qGyKnvcbJ*QHB8ztx`H3uMwVWf z4w%Ph-bG#wCzn~9gvXKsyIW6nI2ii8+@2n5=gOzzBes~1JOwTJT&3C+%W{v5RRYd%ZcnAMXDf_p3q8wKIkzMqBqB z@yjvA568Cb$F~Tis~hre>N)wmlT}l?bx&6%BJ&&G3939~pVWO}K4thcDM^CC9 z1Y{ZG#*#R{-jZM9l1;daw7sq1>%a6}X=R>2qgG}a!x^4wOF~}OnG~DzGrH!nQ;PnT z;tJJ|%(FnA;Ug{fpKOZtOfg{`~tm8raM4vKaj2d{aUcga+}-)y=4Q XJ|<83Gfvq7DnEZX(gXqnBXj=(0HC}I diff --git a/authentication-demo-service/lib/Keystore/keystore.jks.old b/authentication-demo-service/lib/Keystore/keystore.jks.old deleted file mode 100644 index 3ad70e6fa8a0a94c9a64fc5418c1b0a27d8d21aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2579 zcmY+EX*d)L7st)Y5N2dc_I=F7*tbw9YZx>p3?Z@>m$5`d$QDwPealX=j%_SuH>k)y zc9MjUJ+AkC-uK?;emLhm&+mWE`S?SJ(lP=8Aap3K2MQC5(23Zm2T%jDLtzczP+09b zu0)4I-2W9ptihoWi*t-UFB2%;|E@030)W|};A3tSdtS`rGOs!f|c zsHc0;$l_NBNsHl8dpWt)FyVcBG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ujP-V(z`EZ4 z71k!u)AfsETfA)R%??^Rz)hk#r2MuHz3HN?>w~46RpCzQbT!G6(Hx$oQd(%9zf}oi zmSWDsGc z``5FComX%>!#@>lggOj13~n30CEdMIbX;n7^krM1N5a~I`Z_B)7? z_8FP)qmc-}DPv@t z5$!B(QK6|W+C~60r==EJP5BQW(L;9#kePWzVH&zWwr)I&zKYQNvU>AL0B6NA^JMzl zQlz@!3v;)*XIa}9WgweYS-ku4DtkSd7jVe#Lql`6w5XaD@W2K5^8UjCX1;3LUAGe6 z1(jMB3DN}?&s2m^c=)p3#Ue4_FZ+hWMeS9=`%BgoKiggTcAxga!IVZ%Jd#;6v{h9= z;C1T=1d(3_ds49TeNrKIqd-gRkML+3sqKuO>H*P3u$rckEgz{?B`dQqFVQN9IgsmY zvVHe^>#E;bnAb7gt(EoVN`9>=gR0}%T#D&$_6gh%k!3|NJ4S~UfpH%&FmJ!y0hM4? z53t0ylS`VvGmYOc8klb}N}V?XEk zbM+DLKlx%(tnOxD5ne|^jzb4GYE|Gyc-iJ7tq)4Aa4YTxXk-R>|YPI zIsH`V$QU9Rt%X)Y^Pyo-2#Ns&6Xbqf{m^H;fbz1c=D~3yE~XdjJ3c diff --git a/authentication-demo-service/pom.xml b/authentication-demo-service/pom.xml deleted file mode 100644 index f323215349..0000000000 --- a/authentication-demo-service/pom.xml +++ /dev/null @@ -1,391 +0,0 @@ - - 4.0.0 - - - io.mosip.testrig.authentication.demo - 1.2.1-SNAPSHOT - authentication-demo-service - authentication-demo-service - Parent project of MOSIP functional tests - https://github.com/mosip/mosip-functional-tests - jar - - - - MPL 2.0 - https://www.mozilla.org/en-US/MPL/2.0/ - - - - - scm:git:git://github.com/mosip/mosip-functional-tests.git - scm:git:ssh://github.com:mosip/mosip-functional-tests.git - https://github.com/mosip/mosip-functional-tests - HEAD - - - - - Mosip - mosip.emailnotifier@gmail.com - io.mosip - https://github.com/mosip/mosip-functional-tests - - - - - - local-maven-repo - file:///${basedir}/lib - - - - snapshots-repo - https://oss.sonatype.org/content/repositories/snapshots - false - true - - - - releases-repo - https://oss.sonatype.org/service/local/staging/deploy/maven2 - false - false - - - - danubetech-maven-public - https://repo.danubetech.com/repository/maven-public/ - - - - - - 3.2.3 - 2.0.0.RELEASE - - 21 - 21 - 3.8.0 - 3.0.1 - 2.9.2 - 0.8.2 - - 1.2.1-SNAPSHOT - - - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-test - - - commons-io - commons-io - - - javax.ws.rs - javax.ws.rs-api - 2.0 - - - org.glassfish.jersey.core - jersey-common - test - - - io.mosip.authentication - authentication-core - 1.2.1-SNAPSHOT - - - commons-codec - commons-codec - - - org.springdoc - springdoc-openapi-ui - - - - - commons-fileupload - commons-fileupload - - - - org.mockito - mockito-core - - - - io.mosip.kernel - kernel-core - 1.2.1-SNAPSHOT - - - org.springframework.boot - - spring-boot-starter-security - - - - commons-codec - commons-codec - - - - - io.mosip.kernel - kernel-websubclient-api - ${kernel-websubclient-api.version} - - - - org.springframework.boot - spring-boot-starter-actuator - - - - org.apache.httpcomponents - httpclient - - - commons-codec - commons-codec - - - - - - - org.apache.httpcomponents - httpmime - 4.5.7 - - - org.json - json - 20231013 - - - org.apache.commons - commons-lang3 - - - org.tensorflow - tensorflow - 1.12.0 - - - - org.apache.commons - commons-io - 1.3.2 - - - - - commons-lang - commons-lang - 2.4 - - - org.apache.commons - commons-text - 1.10.0 - - - commons-codec - commons-codec - - - io.mosip.kernel - kernel-templatemanager-velocity - 1.2.1-SNAPSHOT - - - org.springframework.cloud - spring-cloud-starter-config - - - org.postgresql - postgresql - - - com.github.jai-imageio - jai-imageio-jpeg2000 - 1.3.0 - - - org.json - json - 20231013 - - - io.mosip.kernel - kernel-keymanager-service - 1.2.1-SNAPSHOT - lib - - - org.springframework.boot - - spring-boot-starter-security - - - - - - dom4j - dom4j - 1.6.1 - - - org.junit.vintage - junit-vintage-engine - - - org.springdoc - springdoc-openapi-starter-webmvc-ui - 2.6.0 - - - - - - io.mosip.kernel - kernel-bom - 1.2.1-SNAPSHOT - pom - import - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - attach-javadocs - - jar - - - - - none - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring.boot.version} - - true - ZIP - - - - - build-info - repackage - - - - - - - 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}/service-git.properties - - ^git.build.(time|version)$ - ^git.commit.id.(abbrev|full)$ - - full - ${project.basedir}/.git - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven.compiler.version} - - ${maven.compiler.source} - ${maven.compiler.target} - - - - org.jacoco - jacoco-maven-plugin - - - **/constant/** - **/config/** - **/dto/** - io/mosip/authentication/service/*.class - io/mosip/authentication/service/filter/** - io/mosip/demo/authentication/service/IdAuthenticationDemoApplication.class - - - - - - prepare-agent - - - - report - prepare-package - - report - - - - - - - \ No newline at end of file diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/PartnerDemoApplication.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/PartnerDemoApplication.java deleted file mode 100644 index 7cc2558cad..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/PartnerDemoApplication.java +++ /dev/null @@ -1,35 +0,0 @@ -package io.mosip.testrig.authentication.demo.service; - -import io.mosip.kernel.templatemanager.velocity.builder.TemplateManagerBuilderImpl; -import io.mosip.kernel.websub.api.client.PublisherClientImpl; -import io.mosip.kernel.websub.api.client.SubscriberClientImpl; -import io.mosip.kernel.websub.api.config.publisher.RestTemplateHelper; -import org.apache.velocity.app.VelocityEngine; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Import; - -import io.mosip.kernel.crypto.jce.core.CryptoCore; -import io.mosip.kernel.templatemanager.velocity.impl.TemplateManagerImpl; -import io.mosip.testrig.authentication.demo.service.config.SwaggerConfig; - -/** - * Spring-boot class for ID Authentication Application. - * - * @author Dinesh Karuppiah - */ -@SpringBootApplication -@Import(value = { TemplateManagerImpl.class, VelocityEngine.class, SwaggerConfig.class, CryptoCore.class, TemplateManagerBuilderImpl.class, - PublisherClientImpl.class, RestTemplateHelper.class, SubscriberClientImpl.class}) -public class PartnerDemoApplication { - - /** - * The main method. - * - * @param args the arguments - */ - public static void main(String[] args) { - SpringApplication.run(PartnerDemoApplication.class, args); - } - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/config/BIRDeserializer.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/config/BIRDeserializer.java deleted file mode 100644 index c39c54d232..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/config/BIRDeserializer.java +++ /dev/null @@ -1,45 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.config; - -import java.io.IOException; -import java.util.List; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; - -import io.mosip.kernel.biometrics.constant.BiometricType; -import io.mosip.kernel.biometrics.entities.BDBInfo; -import io.mosip.kernel.biometrics.entities.BIR; -import io.mosip.kernel.biometrics.entities.RegistryIDType; -import io.mosip.kernel.core.util.CryptoUtil; - -public class BIRDeserializer extends StdDeserializer { - - ObjectMapper mapper = new ObjectMapper(); - - public BIRDeserializer() { - this(null); - } - - protected BIRDeserializer(Class vc) { - super(vc); - } - - @Override - public BIR deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException { - JsonNode node = p.getCodec().readTree(p); - - RegistryIDType format = new RegistryIDType(); - format.setOrganization(node.get("bdbInfo").get("format").get("organization").asText()); - format.setType(node.get("bdbInfo").get("format").get("type").asText()); - return new BIR.BIRBuilder().withBdb(CryptoUtil.decodeBase64(node.get("bdb").asText())) - .withBdbInfo(new BDBInfo.BDBInfoBuilder() - .withType((List) mapper.readValue(node.get("bdbInfo").get("type").toString(), List.class)) - .withSubtype(mapper.readValue(node.get("bdbInfo").get("subtype").toString(), List.class)) - .withFormat(format).build()).build(); - } - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/config/BioProviderConfig.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/config/BioProviderConfig.java deleted file mode 100644 index a6aa41e154..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/config/BioProviderConfig.java +++ /dev/null @@ -1,52 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.config; - -import jakarta.annotation.PostConstruct; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.env.Environment; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.module.SimpleModule; - -import io.mosip.kernel.biometrics.entities.BIR; -import io.mosip.kernel.core.bioapi.exception.BiometricException; -import io.mosip.kernel.core.bioapi.spi.IBioApi; -import io.mosip.kernel.core.util.StringUtils; - -/** - * @author Manoj SP - * - */ -@Configuration -public class BioProviderConfig { - - @Autowired - private Environment env; - - @Autowired - private ObjectMapper mapper; - - @PostConstruct - public void init() { - SimpleModule module = new SimpleModule(); - module.addDeserializer(BIR.class, new BIRDeserializer()); - mapper.registerModule(module); - mapper.configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, false); - } - - @Bean - public IBioApi providerApi() throws BiometricException { - try { - if (StringUtils.isNotEmpty(env.getProperty("bio.test.server.provider"))) { - System.err.println(env.getProperty("bio.test.server.provider")); - return (IBioApi) Class.forName(env.getProperty("bio.test.server.provider")).newInstance(); - } - } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { - throw new BiometricException("", "Unable to load provider", e); - } - return null; - } -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/config/OpenApiProperties.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/config/OpenApiProperties.java deleted file mode 100644 index ef2b2b9552..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/config/OpenApiProperties.java +++ /dev/null @@ -1,45 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.config; - -import java.util.List; - -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.context.annotation.Configuration; - -import lombok.Data; - -/** - * @author Kamesh Shekhar prasad - */ - -@Configuration -@ConfigurationProperties(prefix = "openapi") -@Data -public class OpenApiProperties { - private InfoProperty info; - private AuthDemoServiceServer authDemoServiceServer; -} - -@Data -class InfoProperty { - private String title; - private String description; - private String version; - private LicenseProperty license; -} - -@Data -class LicenseProperty { - private String name; - private String url; -} - -@Data -class AuthDemoServiceServer { - private List servers; -} - -@Data -class Server { - private String description; - private String url; -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/config/SwaggerConfig.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/config/SwaggerConfig.java deleted file mode 100644 index 46e39ef817..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/config/SwaggerConfig.java +++ /dev/null @@ -1,57 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.config; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.servers.Server; - -@Configuration -public class SwaggerConfig { - - private static final Logger logger = LoggerFactory.getLogger(SwaggerConfig.class); - - @Autowired - private OpenApiProperties openApiProperties; - - @Bean - public OpenAPI openApi() { - String msg = "Swagger open api, "; - OpenAPI api = new OpenAPI() - .components(new Components()); - if (null != openApiProperties.getInfo()) { - api.info(new Info() - .title(openApiProperties.getInfo().getTitle()) - .version(openApiProperties.getInfo().getVersion()) - .description(openApiProperties.getInfo().getDescription())); - if (null != openApiProperties.getInfo().getLicense()) { - api.getInfo().license(new License() - .name(openApiProperties.getInfo().getLicense().getName()) - .url(openApiProperties.getInfo().getLicense().getUrl())); - logger.info(msg + "info license property is added"); - } else { - logger.error(msg + "info license property is empty"); - } - logger.info(msg + "info property is added"); - } else { - logger.error(msg + "info property is empty"); - } - - if (null != openApiProperties.getAuthDemoServiceServer().getServers()) { - openApiProperties.getAuthDemoServiceServer().getServers().forEach(server -> { - api.addServersItem(new Server().description(server.getDescription()).url(server.getUrl())); - }); - logger.info(msg + "server property is added"); - } else { - logger.error(msg + "server property is empty"); - } - return api; - } - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/AuthRequestController.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/AuthRequestController.java deleted file mode 100644 index dfbd0720a6..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/AuthRequestController.java +++ /dev/null @@ -1,1230 +0,0 @@ -/* - * - */ -package io.mosip.testrig.authentication.demo.service.controller; - -import static io.mosip.authentication.core.constant.IdAuthCommonConstants.UTF_8; - -import java.io.BufferedWriter; -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.InputStream; -import java.io.StringWriter; -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.security.InvalidAlgorithmParameterException; -import java.security.InvalidKeyException; -import java.security.KeyManagementException; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.UnrecoverableEntryException; -import java.security.cert.Certificate; -import java.security.cert.CertificateEncodingException; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; -import java.security.spec.InvalidKeySpecException; -import java.util.ArrayList; -import java.util.Base64; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.function.BiFunction; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import jakarta.annotation.PostConstruct; -import javax.crypto.BadPaddingException; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.NoSuchPaddingException; -import javax.xml.bind.DatatypeConverter; - -import io.mosip.testrig.authentication.demo.service.dto.*; -import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.io.IOUtils; -import org.bouncycastle.operator.OperatorCreationException; -import org.jose4j.lang.JoseException; -import org.json.JSONException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.env.Environment; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.lang.NonNull; -import org.springframework.lang.Nullable; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.client.HttpServerErrorException; -import org.springframework.web.client.RestClientException; -import org.springframework.web.client.RestTemplate; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; - -import io.mosip.authentication.core.constant.IdAuthCommonConstants; -import io.mosip.authentication.core.constant.IdAuthenticationErrorConstants; -import io.mosip.authentication.core.exception.IdAuthenticationAppException; -import io.mosip.authentication.core.exception.IdAuthenticationBusinessException; -import io.mosip.authentication.core.indauth.dto.IdType; -import io.mosip.authentication.core.spi.indauth.match.MatchType; -import io.mosip.kernel.core.exception.ExceptionUtils; -import io.mosip.kernel.core.exception.ServiceError; -import io.mosip.kernel.core.templatemanager.spi.TemplateManager; -import io.mosip.kernel.core.templatemanager.spi.TemplateManagerBuilder; -import io.mosip.kernel.core.util.CryptoUtil; -import io.mosip.kernel.core.util.DateUtils; -import io.mosip.kernel.core.util.HMACUtils2; -import io.mosip.testrig.authentication.demo.service.controller.Encrypt.SplittedEncryptedData; -import io.mosip.testrig.authentication.demo.service.helper.CertificateTypes; -import io.mosip.testrig.authentication.demo.service.helper.KeyMgrUtil; -import io.mosip.testrig.authentication.demo.service.helper.PartnerTypes; -import io.swagger.annotations.Api; - -/** - * The Class AuthRequestController is used to automate the creation of Auth - * Request. - * - * @author Arun Bose S - */ -@RestController -@Api(tags = { "Authentication Request Creation" }) -public class AuthRequestController { - - private static final String PHONE = "PHONE"; - - private static final String EMAIL = "EMAIL"; - - private static final String CHANNELS = "channels"; - - private static final String DATE_TIME = "dateTime"; - - private static final String MOSIP_ENV = "mosip.env"; - - private static final String MOSIP_DOMAINURI= "mosip.domainUri"; - - private static final String REQ_ID = "reqId"; - - private static final String PROP_PARTNER_URL_SUFFIX = "partnerUrlSuffix"; - - private static final String SPEC_VERSION = "specVersion"; - - private static final String MOSIP_BASE_URL = "mosip.base.url"; - - private static final String ENV = "env"; - - private static final String DOMAIN_URI = "domainUri"; - - private static final String TRANSACTION_ID = "transactionId"; - - private static final String DIGITAL_ID = "digitalId"; - - private static final String SESSION_KEY = "sessionKey"; - - private static final String BIO_VALUE = "bioValue"; - - private static final String DATA = "data"; - - private static final String BIOMETRICS = "biometrics"; - - private static final String IDENTITY = "Identity"; - - private static final String SECONDARY_LANG_CODE = "secondaryLangCode"; - - /** The Constant TEMPLATE. */ - private static final String TEMPLATE = "Template"; - - private static final String PIN = "pin"; - - private static final String BIO = "bio"; - - private static final String DEMO = "demo"; - - private static final String OTP = "otp"; - - private static final String TIMESTAMP = "timestamp"; - - private static final String TXN = "txn"; - - private static final String VER = "ver"; - - private static final String IDA_API_VERSION = "ida.api.version"; - - private static final String AUTH_TYPE = "authType"; - - private static final String UIN = "UIN"; - - private static final String ID_TYPE = "idType"; - - private static final String IDA_AUTH_REQUEST_TEMPLATE = "ida.authRequest.template"; - - private static final String IDA_KYC_EXCHANGE_REQUEST_TEMPLATE = "ida.kycExchangeRequest.template"; - - private static final String IDA_VCI_EXCHANGE_REQUEST_TEMPLATE = "ida.vciExchangeRequest.template"; - - private static final String ID = "id"; - - private static final String CLASSPATH = "classpath"; - - private static final String ENCODE_TYPE = "UTF-8"; - - private static final String DEFAULT_OTP_REQ_TEMPLATE = "{\r\n" - + " \"id\": \"${reqId}\",\r\n" - + " \"individualId\": \"${id}\",\r\n" - + " \"otpChannel\": [\r\n" - + " \"email\",\r\n" - + " \"phone\"\r\n" - + " ],\r\n" - + " \"requestTime\": \"${timestamp}\",\r\n" - + " \"transactionID\": \"${txn}\",\r\n" - + " \"version\": \"${ver}\"\r\n" - + "}"; - - private static final String BEGIN_CERTIFICATE = "-----BEGIN CERTIFICATE-----"; - private static final String END_CERTIFICATE = "-----END CERTIFICATE-----"; - private static final String LINE_SEPARATOR = System.getProperty("line.separator"); - - @Autowired - private Encrypt encrypt; - - @Autowired - private Environment environment; - - @Autowired - private TemplateManagerBuilder templateManagerBuilder; - - @Autowired - private TemplateManager templateManager; - - @Autowired - private ObjectMapper mapper; - - @Autowired - JWSSignAndVerifyController jWSSignAndVerifyController; - - @Autowired - KeyMgrUtil keyMgrUtil; - - @PostConstruct - public void idTemplateManagerPostConstruct() { - templateManager = templateManagerBuilder.encodingType(ENCODE_TYPE).enableCache(false).resourceLoader(CLASSPATH) - .build(); - } - - /** - * this method is used to create the auth request. - * - * @param id the id - * @param idType the id type - * @param isKyc the is kyc - * @param isInternal the is internal - * @param reqAuth the req auth - * @param transactionId the transaction id - * @param request the request - * @return the string - * @throws Exception - */ - @SuppressWarnings("unchecked") - @PostMapping(path = "/createAuthRequest", consumes = MediaType.APPLICATION_JSON_VALUE, produces = { - MediaType.TEXT_PLAIN_VALUE }) - public ResponseEntity createAuthRequest(@RequestParam(name = ID, required = true) @Nullable String id, - @RequestParam(name = ID_TYPE, required = false) @Nullable String idType, - @RequestParam(name = "isKyc", required = false) @Nullable boolean isKyc, - @RequestParam(name = "isInternal", required = false) @Nullable boolean isInternal, - @RequestParam(name = "Authtype", required = false) @Nullable String reqAuth, - @RequestParam(name = TRANSACTION_ID, required = false) @Nullable String transactionId, - @RequestParam(name = "requestTime", required = false) @Nullable String requestTime, - @RequestParam(name = "isNewInternalAuth", required = false) @Nullable boolean isNewInternalAuth, - @RequestParam(name = "isPreLTS", required = false) @Nullable boolean isPreLTS, - @RequestParam(name = "signWithMisp", required = false) @Nullable boolean signWithMisp, - @RequestParam(name = "partnerName", required = false) String partnerName, - @RequestParam(name = "keyFileNameByPartnerName", required = false) boolean keyFileNameByPartnerName, - @RequestBody Map request, - @RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName) throws Exception { - String authRequestTemplate = environment.getProperty(IDA_AUTH_REQUEST_TEMPLATE); - Map reqValues = new HashMap<>(); - - if(isPreLTS) { - reqValues.put(OTP, false); - reqValues.put(DEMO, false); - reqValues.put(BIO, false); - reqValues.put(PIN, false); - } - - if(isNewInternalAuth) { - isInternal = true; - } - - boolean needsEncryption = !isInternal || !isNewInternalAuth; - String keysDirPath = keyMgrUtil.getKeysDirPath(certsDir, moduleName); - - if(needsEncryption) { - reqValues.put("thumbprint", - digest(getCertificateThumbprint(encrypt.getCertificate(isInternal, keysDirPath)))); - } - - if (requestTime == null) { - requestTime = DateUtils.getUTCCurrentDateTimeString(environment.getProperty("datetime.pattern")); - - } - - if(!request.containsKey(TIMESTAMP)) { - request.put(TIMESTAMP, "");//Initializing. Setting value is done in further steps. - } - - idValuesMap(id, isKyc, isInternal, reqValues, transactionId, requestTime); - getAuthTypeMap(reqAuth, reqValues, request); - applyRecursively(request, TIMESTAMP, requestTime); - applyRecursively(request, DATE_TIME, requestTime); - applyRecursively(request, TRANSACTION_ID, transactionId); - - if(isKyc && signWithMisp) { - reqValues.put(AUTH_TYPE, "kycauth"); - } - - if(needsEncryption) { - if (reqValues.get(BIO) != null && Boolean.valueOf(reqValues.get(BIO).toString())) { - Object bioObj = request.get(BIOMETRICS); - if (bioObj instanceof List) { - List> encipheredBiometrics = encipherBiometrics(isInternal, requestTime, - transactionId, partnerName, keyFileNameByPartnerName, (List>) bioObj, certsDir, moduleName); - request.put(BIOMETRICS, encipheredBiometrics); - } - } - encryptValuesMap(request, reqValues, isInternal, certsDir, moduleName); - } - - StringWriter writer = new StringWriter(); - InputStream templateValue; - if (request != null && request.size() > 0) { - templateValue = templateManager - .merge(new ByteArrayInputStream(authRequestTemplate.getBytes(StandardCharsets.UTF_8)), reqValues); - - if (templateValue != null) { - IOUtils.copy(templateValue, writer, StandardCharsets.UTF_8); - String requestString = writer.toString(); - if(!needsEncryption) { - Map resMap = mapper.readValue(requestString.getBytes(StandardCharsets.UTF_8), Map.class); - resMap.put("request", request); - resMap.put("requestHMAC", null); - resMap.put("requestSessionKey", null); - resMap.put("thumbprint", null); - - requestString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(resMap); - } - if (reqValues.containsKey(SECONDARY_LANG_CODE)) { - Map resMap = mapper.readValue(requestString.getBytes(StandardCharsets.UTF_8), Map.class); - resMap.put(SECONDARY_LANG_CODE, reqValues.get(SECONDARY_LANG_CODE)); - requestString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(resMap); - } - if(isPreLTS) { - Map requestMap = mapper.readValue(requestString.getBytes(StandardCharsets.UTF_8), Map.class); - Map requestedAuth = new HashMap<>(); - requestMap.put("individualIdType", idType == null || idType.trim().length() == 0 ? IdType.UIN.toString() : idType); - requestMap.put("requestedAuth", requestedAuth); - if(Boolean.valueOf(String.valueOf(reqValues.get(OTP)))) { - requestedAuth.put("otp", true); - } - if(Boolean.valueOf(String.valueOf(reqValues.get(DEMO)))) { - requestedAuth.put("demo", true); - } - if(Boolean.valueOf(String.valueOf(reqValues.get(BIO)))) { - requestedAuth.put("bio", true); - } - if(Boolean.valueOf(String.valueOf(reqValues.get(PIN)))) { - requestedAuth.put("pin", true); - } - requestString = mapper.writeValueAsString(requestMap); - } - HttpHeaders httpHeaders = new HttpHeaders(); - PartnerTypes partnerTypes = isKyc ? PartnerTypes.EKYC : PartnerTypes.RELYING_PARTY; - - String rpSignature = signRequest(signWithMisp ? PartnerTypes.MISP : partnerTypes, partnerName, keyFileNameByPartnerName, requestString, certsDir, moduleName); - httpHeaders.add("signature", rpSignature); - return new ResponseEntity<>(requestString, httpHeaders, HttpStatus.OK); - } else { - throw new IdAuthenticationBusinessException( - IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorCode(), String.format( - IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorMessage(), TEMPLATE)); - } - - } else { - throw new IdAuthenticationBusinessException( - IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorCode(), - String.format(IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorMessage(), IDENTITY)); - } - } - - /** - * this method is used to create the auth request. - * - * @param id the id - * @param idType the id type - * @param isKyc the is kyc - * @param isInternal the is internal - * @param reqAuth the req auth - * @param transactionId the transaction id - * @param request the request - * @return the string - * @throws Exception - */ - @SuppressWarnings({ "unchecked", "rawtypes" }) - @PostMapping(path = "/authenticate", consumes = MediaType.APPLICATION_JSON_VALUE, produces = { - MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> authenticate(@RequestParam(name = ID, required = true) @Nullable String id, - @RequestParam(name = ID_TYPE, required = false) @Nullable String idType, - @RequestParam(name = "isLocal", required = false ) @Nullable boolean isLocal, - @RequestParam(name = "isKyc", required = false) @Nullable boolean isKyc, - @RequestParam(name = "isInternal", required = false) @Nullable boolean isInternal, - @RequestParam(name = "Authtype", required = false) @Nullable String reqAuth, - @RequestParam(name = TRANSACTION_ID, required = false) @Nullable String transactionId, - @RequestParam(name = PROP_PARTNER_URL_SUFFIX, required = false) @Nullable String partnerUrlSuffix, - @RequestParam(name = "requestTime", required = false) @Nullable String requestTime, - @RequestParam(name = "isNewInternalAuth", required = false) @Nullable boolean isNewInternalAuth, - @RequestParam(name = "isPreLTS", required = false) @Nullable boolean isPreLTS, - @RequestParam(name = "signWithMisp", required = false) @Nullable boolean signWithMisp, - @RequestParam(name = "partnerName", required = false) String partnerName, - @RequestParam(name = "keyFileNameByPartnerName", required = false) boolean keyFileNameByPartnerName, - @RequestBody Map request, - @RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName) throws Exception { - ResponseEntity authRequest = this.createAuthRequest(id, idType, isKyc, isInternal, reqAuth, transactionId, requestTime, isNewInternalAuth, isPreLTS, signWithMisp, partnerName, keyFileNameByPartnerName, request, certsDir, moduleName); - String reqBody = authRequest.getBody(); - String reqSignature = authRequest.getHeaders().get("signature").get(0); - - RestTemplate restTemplate = encrypt.createRestTemplate(); - - HttpHeaders httpHeaders = new HttpHeaders(); - httpHeaders.add("signature", reqSignature); - httpHeaders.add("Authorization", reqSignature); - httpHeaders.add("Content-Type", "application/json"); - HttpEntity httpEntity = new HttpEntity<>(reqBody, httpHeaders); - Map reqBodyMap = mapper.readValue(reqBody, Map.class); - URI authRequestUrl = getAuthRequestUrl((String)reqBodyMap.get("id"), isLocal, partnerUrlSuffix, isNewInternalAuth); - - Map respMap = new LinkedHashMap<>(); - - respMap.put("URL", authRequestUrl); - - Map authReqMap = new LinkedHashMap<>(); - authReqMap.put("body", reqBody); - authReqMap.put("signature", reqSignature); - respMap.put("authRequest", authReqMap); - - Map authRespBody = new LinkedHashMap<>(); - Object respBody; - String respSignature; - try { - ResponseEntity authResponse = restTemplate.exchange(authRequestUrl, HttpMethod.POST, httpEntity, Map.class); - respBody = authResponse.getBody(); - List serviceErrorList = ExceptionUtils.getServiceErrorList(mapper.writeValueAsString(respBody)); - if(serviceErrorList.isEmpty()) { - List signatureHeaders = authResponse.getHeaders().get("response-signature"); - respSignature = signatureHeaders != null ? authResponse.getHeaders().get("response-signature").get(0) : null; - authRespBody.put("signature", respSignature); - } - } catch (RestClientException e) { - respBody = e instanceof HttpServerErrorException ? ((HttpServerErrorException)e).getResponseBodyAsString() : ExceptionUtils.getStackTrace(e); - } - - authRespBody.put("body", respBody); - respMap.put("authResponse", authRespBody); - - ResponseEntity> responseEntity = new ResponseEntity(respMap, HttpStatus.OK); - return responseEntity; - - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @PostMapping(path = "/kyc-exchange", consumes = MediaType.APPLICATION_JSON_VALUE, produces = { - MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> doKycExchange(@RequestParam(name = ID, required = true) @Nullable String id, - @RequestParam(name = ID_TYPE, required = false) @Nullable String idType, - @RequestParam(name = "isLocal", required = false ) @Nullable boolean isLocal, - @RequestParam(name = "Authtype", required = false) @Nullable String reqAuth, - @RequestParam(name = "kycToken", required = false) @Nullable String kycToken, - @RequestParam(name = "respType", required = false) @Nullable String respType, - @RequestParam(name = TRANSACTION_ID, required = false) @Nullable String transactionId, - @RequestParam(name = PROP_PARTNER_URL_SUFFIX, required = false) @Nullable String partnerUrlSuffix, - @RequestParam(name = "requestTime", required = false) @Nullable String requestTime, - @RequestParam(name = "partnerName", required = false) String partnerName, - @RequestParam(name = "keyFileNameByPartnerName", required = false) boolean keyFileNameByPartnerName, - @RequestBody Map request, - @RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName) throws Exception { - ResponseEntity authRequest = this.createKycExchangeRequest(id, idType, reqAuth, kycToken, respType, transactionId, requestTime, partnerName, keyFileNameByPartnerName, request, certsDir, moduleName); - String reqBody = authRequest.getBody(); - String reqSignature = authRequest.getHeaders().get("signature").get(0); - - RestTemplate restTemplate = encrypt.createRestTemplate(); - - HttpHeaders httpHeaders = new HttpHeaders(); - httpHeaders.add("signature", reqSignature); - httpHeaders.add("Authorization", reqSignature); - httpHeaders.add("Content-Type", "application/json"); - HttpEntity httpEntity = new HttpEntity<>(reqBody, httpHeaders); - Map reqBodyMap = mapper.readValue(reqBody, Map.class); - URI authRequestUrl = getAuthRequestUrl((String)reqBodyMap.get("id"), isLocal, partnerUrlSuffix, false); - - Map respMap = new LinkedHashMap<>(); - - respMap.put("URL", authRequestUrl); - - Map authReqMap = new LinkedHashMap<>(); - authReqMap.put("body", reqBody); - authReqMap.put("signature", reqSignature); - respMap.put("authRequest", authReqMap); - - Map authRespBody = new LinkedHashMap<>(); - Object respBody; - String respSignature; - try { - ResponseEntity authResponse = restTemplate.exchange(authRequestUrl, HttpMethod.POST, httpEntity, Map.class); - respBody = authResponse.getBody(); - List serviceErrorList = ExceptionUtils.getServiceErrorList(mapper.writeValueAsString(respBody)); - if(serviceErrorList.isEmpty()) { - List signatureHeaders = authResponse.getHeaders().get("response-signature"); - respSignature = signatureHeaders != null ? authResponse.getHeaders().get("response-signature").get(0) : null; - authRespBody.put("signature", respSignature); - } - } catch (RestClientException e) { - respBody = e instanceof HttpServerErrorException ? ((HttpServerErrorException)e).getResponseBodyAsString() : ExceptionUtils.getStackTrace(e); - } - - authRespBody.put("body", respBody); - respMap.put("authResponse", authRespBody); - - ResponseEntity> responseEntity = new ResponseEntity(respMap, HttpStatus.OK); - return responseEntity; - } - - @PostMapping(path = "/create-kyc-exchange-request", consumes = MediaType.APPLICATION_JSON_VALUE, produces = { - MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity createKycExchangeRequest(@RequestParam(name = ID, required = true) @Nullable String id, - @RequestParam(name = ID_TYPE, required = false) @Nullable String idType, - @RequestParam(name = "Authtype", required = false) @Nullable String reqAuth, - @RequestParam(name = "kycToken", required = false) @Nullable String kycToken, - @RequestParam(name = "respType", required = false) @Nullable String respType, - @RequestParam(name = TRANSACTION_ID, required = false) @Nullable String transactionId, - @RequestParam(name = "requestTime", required = false) @Nullable String requestTime, - @RequestParam(name = "partnerName", required = false) String partnerName, - @RequestParam(name = "keyFileNameByPartnerName", required = false) boolean keyFileNameByPartnerName, - @RequestBody Map request, - @RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName) throws Exception { - String authRequestTemplate = environment.getProperty(IDA_KYC_EXCHANGE_REQUEST_TEMPLATE); - Map reqValues = new HashMap<>(); - - if (requestTime == null) { - requestTime = DateUtils.getUTCCurrentDateTimeString(environment.getProperty("datetime.pattern")); - } - - reqValues.put(ID, id); - reqValues.put("individualIdType", idType == null || idType.trim().length() == 0 ? IdType.UIN.toString() : idType); - reqValues.put(AUTH_TYPE, reqAuth); - reqValues.put(TIMESTAMP, requestTime); - reqValues.put(TXN, transactionId == null ? "1234567890" : transactionId); - reqValues.put(VER, environment.getProperty(IDA_API_VERSION)); - reqValues.put("kycToken", kycToken); - reqValues.put("respType", respType); - reqValues.put("request", request); - - StringWriter writer = new StringWriter(); - InputStream templateValue; - if (request != null && request.size() > 0) { - templateValue = templateManager - .merge(new ByteArrayInputStream(authRequestTemplate.getBytes(StandardCharsets.UTF_8)), reqValues); - - if (templateValue != null) { - IOUtils.copy(templateValue, writer, StandardCharsets.UTF_8); - String res = writer.toString(); - ObjectNode response = mapper.readValue(res.getBytes(), ObjectNode.class); - - HttpHeaders httpHeaders = new HttpHeaders(); - String responseStr = response.toString(); - - String rpSignature = signRequest(PartnerTypes.MISP, partnerName, keyFileNameByPartnerName, responseStr, certsDir, moduleName); - httpHeaders.add("signature", rpSignature); - return new ResponseEntity<>(responseStr, httpHeaders, HttpStatus.OK); - } else { - throw new IdAuthenticationBusinessException( - IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorCode(), String.format( - IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorMessage(), TEMPLATE)); - } - - } else { - throw new IdAuthenticationBusinessException( - IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorCode(), - String.format(IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorMessage(), IDENTITY)); - } - } - - @PostMapping(path = "/create-vci-exchange-request", consumes = MediaType.APPLICATION_JSON_VALUE, produces = { - MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity createVciExchangeRequest(@RequestParam(name = ID, required = true) @Nullable String id, - @RequestParam(name = ID_TYPE, required = false) @Nullable String idType, - @RequestParam(name = "Authtype", required = false) @Nullable String reqAuth, - @RequestParam(name = TRANSACTION_ID, required = false) @Nullable String transactionId, - @RequestParam(name = "requestTime", required = false) @Nullable String requestTime, - @RequestParam(name = "vcFormat", required = false) @Nullable String vcFormat, - @RequestParam(name = "credSubjectId", required = false)@Nullable String credSubjectId, - @RequestParam(name = "vcAuthToken", required = false)@Nullable String vcAuthToken, - @RequestParam(name = "keyFileNameByPartnerName", required = false)boolean keyFileNameByPartnerName, - @RequestParam(name = "partnerName", required = false)@Nullable String partnerName, - @RequestBody Map request, - @RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName) throws Exception { - String authRequestTemplate = environment.getProperty(IDA_VCI_EXCHANGE_REQUEST_TEMPLATE); - Map reqValues = new HashMap<>(); - - if (requestTime == null) { - requestTime = DateUtils.getUTCCurrentDateTimeString(environment.getProperty("datetime.pattern")); - } - - reqValues.put(ID, id); - reqValues.put("individualIdType", idType == null || idType.trim().length() == 0 ? IdType.UIN.toString() : idType); - reqValues.put(AUTH_TYPE, reqAuth); - reqValues.put(TIMESTAMP, requestTime); - reqValues.put(TXN, transactionId == null ? "1234567890" : transactionId); - reqValues.put(VER, environment.getProperty(IDA_API_VERSION)); - reqValues.put("vcFormat", vcFormat); - reqValues.put("credSubjectId", credSubjectId); - reqValues.put("vcAuthToken", vcAuthToken); - - StringWriter writer = new StringWriter(); - InputStream templateValue; - if (request != null && request.size() > 0) { - templateValue = templateManager - .merge(new ByteArrayInputStream(authRequestTemplate.getBytes(StandardCharsets.UTF_8)), reqValues); - - if (templateValue != null) { - IOUtils.copy(templateValue, writer, StandardCharsets.UTF_8); - String res = writer.toString(); - ObjectNode response = mapper.readValue(res.getBytes(), ObjectNode.class); - - HttpHeaders httpHeaders = new HttpHeaders(); - String responseStr = response.toString(); - - String rpSignature = signRequest(PartnerTypes.MISP, partnerName, keyFileNameByPartnerName, responseStr, certsDir, moduleName); - httpHeaders.add("signature", rpSignature); - return new ResponseEntity<>(responseStr, httpHeaders, HttpStatus.OK); - } else { - throw new IdAuthenticationBusinessException( - IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorCode(), String.format( - IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorMessage(), TEMPLATE)); - } - } else { - throw new IdAuthenticationBusinessException( - IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorCode(), - String.format(IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorMessage(), IDENTITY)); - } - } - - - /** - * this method is used to create the auth request. - * - * @param id the id - * @param idType the id type - * @param isKyc the is kyc - * @param isInternal the is internal - * @param reqAuth the req auth - * @param transactionId the transaction id - * @param request the request - * @return the string - * @throws Exception - */ - @SuppressWarnings({ "unchecked", "rawtypes" }) - @PostMapping(path = "/sendOtp", produces = { - MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> sendOtp(@RequestParam(name = ID, required = true) @Nullable String id, - @RequestParam(name = ID_TYPE, required = false) @Nullable String idType, - @RequestParam(name = "isLocal", required = false ) @Nullable boolean isLocal, - @RequestParam(name = "isInternal", required = false) @Nullable boolean isInternal, - @RequestParam(name = "isEmail", required = false, defaultValue = "true") @Nullable boolean isEmail, - @RequestParam(name = "isPhone", required = false, defaultValue = "true") @Nullable boolean isPhone, - @RequestParam(name = TRANSACTION_ID, required = false) @Nullable String transactionId, - @RequestParam(name = PROP_PARTNER_URL_SUFFIX, required = false) @Nullable String partnerUrlSuffix, - @RequestParam(name = "isPreLTS", required = false) @Nullable boolean isPreLTS, - @RequestParam(name = "requestTime", required = false) @Nullable String requestTime, - @RequestParam(name = "partnerName", required = false) String partnerName, - @RequestParam(name = "keyFileNameByPartnerName", required = false) boolean keyFileNameByPartnerName, - @RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName) - - throws Exception { - - ResponseEntity otpReqEntity = createOtpRequestBody(isInternal, idType, isEmail, isPhone, id, transactionId, isPreLTS, requestTime, partnerName, keyFileNameByPartnerName, certsDir, moduleName); - String reqSignature = otpReqEntity.getHeaders().get("signature").get(0); - String reqBody = otpReqEntity.getBody(); - - RestTemplate restTemplate = encrypt.createRestTemplate(); - - HttpHeaders httpHeaders = new HttpHeaders(); - httpHeaders.add("signature", reqSignature); - httpHeaders.add("Authorization", reqSignature); - httpHeaders.add("Content-Type", "application/json"); - HttpEntity httpEntity = new HttpEntity<>(reqBody, httpHeaders); - Map reqBodyMap = mapper.readValue(reqBody, Map.class); - URI otpRequestUrl = getOtpRequestUrl((String)reqBodyMap.get("id"), isLocal, partnerUrlSuffix); - - Map respMap = new LinkedHashMap<>(); - - respMap.put("URL", otpRequestUrl); - - Map otpReqMap = new LinkedHashMap<>(); - otpReqMap.put("body", reqBody); - otpReqMap.put("signature", reqSignature); - respMap.put("otpRequest", otpReqMap); - - Map otpRespBody = new LinkedHashMap<>(); - Object respBody; - String respSignature; - try { - ResponseEntity authResponse = restTemplate.exchange(otpRequestUrl, HttpMethod.POST, httpEntity, Map.class); - respBody = authResponse.getBody(); - respSignature = authResponse.getHeaders().get("response-signature").get(0); - otpRespBody.put("signature", respSignature); - } catch (RestClientException e) { - respBody = e instanceof HttpServerErrorException ? ((HttpServerErrorException)e).getResponseBodyAsString() : ExceptionUtils.getStackTrace(e); - } - - otpRespBody.put("body", respBody); - respMap.put("otpResponse", otpRespBody); - - ResponseEntity> responseEntity = new ResponseEntity(respMap, HttpStatus.OK); - return responseEntity; - - } - - @SuppressWarnings("unchecked") - @PostMapping(path = "/createOtpReqest", produces = { - MediaType.TEXT_PLAIN_VALUE }) - public ResponseEntity createOtpRequestBody( - @RequestParam(name = "isInternal", required = false) @Nullable boolean isInternal, - @RequestParam(name = ID_TYPE, required = false) @Nullable String idType, - @RequestParam(name = "isEmail", required = false, defaultValue = "true") @Nullable boolean isEmail, - @RequestParam(name = "isPhone", required = false, defaultValue = "true") @Nullable boolean isPhone, - @RequestParam(name = ID, required = true) @NonNull String id, - @RequestParam(name = TRANSACTION_ID, required = false) @Nullable String transactionId, - @RequestParam(name = "isPreLTS", required = false) @Nullable boolean isPreLTS, - @RequestParam(name = "requestTime", required = false) @Nullable String requestTime, - @RequestParam(name = "partnerName", required = false) String partnerName, - @RequestParam(name = "keyFileNameByPartnerName", required = false) boolean keyFileNameByPartnerName, - @RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName) - throws IOException, IdAuthenticationBusinessException, KeyManagementException, NoSuchAlgorithmException, - UnrecoverableEntryException, KeyStoreException, CertificateException, OperatorCreationException, - JoseException { - String otpReqTemplate = environment.getProperty("otpRequestTemplate", DEFAULT_OTP_REQ_TEMPLATE); - - Map reqValues = new HashMap<>(); - - if (requestTime == null) { - requestTime = DateUtils.getUTCCurrentDateTimeString(environment.getProperty("datetime.pattern")); - - } - if(isPreLTS) { - if (null != idType) { - reqValues.put(ID_TYPE, idType); - } else { - reqValues.put(ID_TYPE, UIN); - } - - } - - List channels = new ArrayList(); - if(isEmail) { - channels.add(EMAIL); - } - if(isPhone) { - channels.add(PHONE); - } - - if(!isEmail && !isPhone) { - channels.add(EMAIL); - } - - String channelStr = channels.stream().collect(Collectors.joining("\",\"", "\"", "\"")); - - reqValues.put(CHANNELS, channelStr); - idValuesMapForOtpReq(id, isInternal, reqValues, transactionId, requestTime); - - StringWriter writer = new StringWriter(); - InputStream templateValue; - templateValue = templateManager - .merge(new ByteArrayInputStream(otpReqTemplate.getBytes(StandardCharsets.UTF_8)), reqValues); - - if (templateValue != null) { - IOUtils.copy(templateValue, writer, StandardCharsets.UTF_8); - String res = writer.toString(); - if(isPreLTS) { - Map resMap = mapper.readValue(res.getBytes(StandardCharsets.UTF_8), Map.class); - resMap.put("individualIdType", idType == null || idType.trim().length() == 0 ? IdType.UIN.toString() : idType); - res = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(resMap); - } - ObjectNode response = mapper.readValue(res.getBytes(), ObjectNode.class); - HttpHeaders httpHeaders = new HttpHeaders(); - String responseStr = response.toString(); - httpHeaders.add("signature", signRequest(PartnerTypes.RELYING_PARTY, partnerName, keyFileNameByPartnerName, responseStr, certsDir, moduleName)); - return new ResponseEntity<>(responseStr, httpHeaders, HttpStatus.OK); - } else { - throw new IdAuthenticationBusinessException( - IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorCode(), String.format( - IdAuthenticationErrorConstants.MISSING_INPUT_PARAMETER.getErrorMessage(), TEMPLATE)); - } - - } - - @PostMapping(path = "/signRequest", produces = { - MediaType.TEXT_PLAIN_VALUE }) - public String signRequest( - @RequestParam(name = "partnerType", required = true, defaultValue = "RELYING_PARTY") @NonNull PartnerTypes partnerType, - @RequestParam(name = "partnerName", required = false) String partnerName, - @RequestParam(name = "keyFileNameByPartnerName", required = false) boolean keyFileNameByPartnerName, - @RequestBody String request, @RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName) - throws JoseException, NoSuchAlgorithmException, UnrecoverableEntryException, KeyStoreException, - CertificateException, IOException, OperatorCreationException { - return jWSSignAndVerifyController.sign(request, false, - true, false, null, keyMgrUtil.getKeysDirPath(certsDir,moduleName), partnerType, partnerName, keyFileNameByPartnerName); - } - - private void idValuesMapForOtpReq(String id, boolean isInternal, Map reqValues, - String transactionId, String utcCurrentDateTimeString) { - reqValues.put(ID, id); - if (isInternal) { - reqValues.put(REQ_ID, "mosip.identity.otp.internal"); - } else { - reqValues.put(REQ_ID, "mosip.identity.otp"); - } - reqValues.put(TIMESTAMP, utcCurrentDateTimeString); - reqValues.put(TXN, transactionId == null ? "1234567890" : transactionId); - reqValues.put(VER, environment.getProperty(IDA_API_VERSION)); - } - - private URI getAuthRequestUrl(String reqId, boolean isLocal, String partnerUrlSuffix, boolean isNewInternalAuth) { - String baseUrl; - String urlSuffix; - String envBaseUrl = environment.getProperty(MOSIP_BASE_URL); - - boolean isInternal = false; - switch(reqId) { - case "mosip.identity.auth": - baseUrl = isLocal ? "http://localhost:" + environment.getProperty("auth.port", "8090") : envBaseUrl; - urlSuffix = "/idauthentication/v1/auth"; - break; - case "mosip.identity.kyc": - baseUrl = isLocal ? "http://localhost:" + environment.getProperty("kyc.port", "8090") : envBaseUrl; - urlSuffix = "/idauthentication/v1/kyc"; - break; - case "mosip.identity.auth.internal": - baseUrl = isLocal ? "http://localhost:" + environment.getProperty("internal.port", "8093"): envBaseUrl; - urlSuffix = isNewInternalAuth ? "/idauthentication/v1/internal/verifyidentity" : "/idauthentication/v1/internal/auth"; - isInternal = true; - break; - case "mosip.identity.kycauth": - baseUrl = isLocal ? "http://localhost:" + environment.getProperty("kyc.port", "8090") : envBaseUrl; - urlSuffix = "/idauthentication/v1/kyc-auth"; - break; - case "mosip.identity.kycexchange": - baseUrl = isLocal ? "http://localhost:" + environment.getProperty("kyc.port", "8090") : envBaseUrl; - urlSuffix = "/idauthentication/v1/kyc-exchange"; - break; - default: - baseUrl = isLocal ? "http://localhost:" + environment.getProperty("auth.port", "8090") : envBaseUrl; - urlSuffix = "/idauthentication/v1/auth"; - break; - } - - String url = baseUrl + urlSuffix; - - if(!isInternal) { - String partnerSuffix = partnerUrlSuffix == null ? environment.getProperty(PROP_PARTNER_URL_SUFFIX) : partnerUrlSuffix; - if(partnerSuffix == null) { - throw new NullPointerException("partnerUrlSuffix is not specified"); - } - url += "/" + partnerSuffix; - } - return URI.create(url); - } - - private URI getOtpRequestUrl(String reqId, boolean isLocal, String partnerUrlSuffix) { - String baseUrl; - String urlSuffix; - String envBaseUrl = environment.getProperty(MOSIP_BASE_URL); - - boolean isInternal = false; - switch(reqId) { - case "mosip.identity.otp": - baseUrl = isLocal ? "http://localhost:" + environment.getProperty("otp.port", "8092") : envBaseUrl; - urlSuffix = "/idauthentication/v1/otp"; - break; - case "mosip.identity.otp.internal": - baseUrl = isLocal ? "http://localhost:" + environment.getProperty("internal.port", "8093") : envBaseUrl; - urlSuffix = "/idauthentication/v1/internal/otp"; - isInternal = true; - break; - default: - baseUrl = isLocal ? "http://localhost:8092" : envBaseUrl; - urlSuffix = "/idauthentication/v1/auth"; - break; - } - - String url = baseUrl + urlSuffix; - - if(!isInternal) { - String partnerSuffix = partnerUrlSuffix == null ? environment.getProperty(PROP_PARTNER_URL_SUFFIX) : partnerUrlSuffix; - url += "/" + partnerSuffix; - } - return URI.create(url); - } - - public byte[] getCertificateThumbprint(Certificate cert) throws CertificateEncodingException { - return DigestUtils.sha256(cert.getEncoded()); - } - - @SuppressWarnings("unchecked") - @PostMapping(path = "/encipherBiometricData", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public List> encipherBiometrics( - @RequestParam(name = "isInternal", required = false) @Nullable boolean isInternal, - @RequestParam(name = "timestamp", required = false) @Nullable String timestampArg, - @RequestParam(name = "transactionId", required = false) @Nullable String transactionIdArg, - @RequestParam(name = "partnerName", required = false) String partnerName, - @RequestParam(name = "keyFileNameByPartnerName", required = false) boolean keyFileNameByPartnerName, - @RequestBody List> biometrics, - @RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName) throws KeyManagementException, - InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, - InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException, IOException, - JSONException, IdAuthenticationAppException, IdAuthenticationBusinessException, KeyStoreException, - CertificateException, UnrecoverableEntryException, JoseException, OperatorCreationException { - byte[] previousHash = getHash(""); - - for (Map bioMap : biometrics) { - Object data = bioMap.get(DATA); - if (data == null) { - break; - } - - if (data instanceof Map) { - Map dataMap = (Map) data; - String bioValue = (String) dataMap.get(BIO_VALUE); - String timestamp = timestampArg; - if (timestamp == null) { - timestamp = (String) dataMap.get(TIMESTAMP); - } - if (timestamp == null) { - timestamp = DateUtils.formatToISOString(DateUtils.getUTCCurrentDateTime()); - } - - dataMap.put(TIMESTAMP, timestamp); - dataMap.put(DOMAIN_URI, environment.getProperty(MOSIP_DOMAINURI,environment.getProperty(MOSIP_BASE_URL))); - dataMap.put(ENV, environment.getProperty(MOSIP_ENV, "Staging")); - dataMap.put(SPEC_VERSION, "1.0"); - Object txnIdObj = dataMap.get(TRANSACTION_ID); - if (txnIdObj == null) { - dataMap.put(TRANSACTION_ID, transactionIdArg == null ? "1234567890" : transactionIdArg); - } - String transactionId = String.valueOf(dataMap.get(TRANSACTION_ID)); - String keysDirPath = keyMgrUtil.getKeysDirPath(certsDir,moduleName); - - //SplittedEncryptedData encryptedBiometrics = encrypt.encryptBiometrics(bioValue, timestamp, - // transactionId, isInternal); - SplittedEncryptedData encryptedBiometrics = encrypt.encryptBio(bioValue, timestamp, - transactionId, isInternal, keysDirPath); - - dataMap.put(BIO_VALUE, encryptedBiometrics.getEncryptedData()); - bioMap.put(SESSION_KEY, encryptedBiometrics.getEncryptedSessionKey()); - bioMap.put("thumbprint", digest(getCertificateThumbprint(encrypt.getBioCertificate(isInternal, keysDirPath)))); - - Object digitalId = dataMap.get(DIGITAL_ID); - if (digitalId instanceof Map) { - Map digitalIdMap = (Map) digitalId; - String digitalIdStr = mapper.writeValueAsString(digitalIdMap); - String signedDititalId; - if(!isInternal) { - //String signedDititalId = jWSSignAndVerifyController.sign(digitalIdStr, true); - signedDititalId = jWSSignAndVerifyController.sign(digitalIdStr, true, true, - false, null, keysDirPath, PartnerTypes.FTM, partnerName, keyFileNameByPartnerName); - } else { - signedDititalId = CryptoUtil.encodeToURLSafeBase64(digitalIdStr.getBytes()); - } - dataMap.put(DIGITAL_ID, signedDititalId); - } - - String dataStrJson = mapper.writeValueAsString(dataMap); - - String dataStr; - if (isInternal) { - dataStr = CryptoUtil.encodeToURLSafeBase64(dataStrJson.getBytes()); - } else { - //dataStr = jWSSignAndVerifyController.sign(dataStrJson, true); - dataStr = jWSSignAndVerifyController.sign(dataStrJson, true, true, - false, null, keysDirPath, PartnerTypes.DEVICE, partnerName, keyFileNameByPartnerName); - } - bioMap.put(DATA, dataStr); - - // Updating hash calculation as per latest changes - 29-May-2021 - byte[] currentHash = getHash(CryptoUtil.decodePlainBase64(bioValue)); - byte[] finalBioDataBytes = new byte[currentHash.length + previousHash.length]; - System.arraycopy(previousHash, 0, finalBioDataBytes, 0, previousHash.length); - System.arraycopy(currentHash, 0, finalBioDataBytes, previousHash.length, currentHash.length); - byte[] finalBioDataHash = getHash(finalBioDataBytes); - - /* String concatenatedHash = previousHash + currentHash; - byte[] finalHash = getHash(concatenatedHash); - */ - String finalHashHexEncoded = digest(finalBioDataHash); - bioMap.put("hash", finalHashHexEncoded); - previousHash = finalBioDataHash; - } - } - return biometrics; - } - - private String digest(byte[] hash) throws NoSuchAlgorithmException { - return DatatypeConverter.printHexBinary(hash).toUpperCase(); - } - - /** - * Gets the hash. - * - * @param string the string - * @return the hash - * @throws UnsupportedEncodingException the unsupported encoding exception - * @throws NoSuchAlgorithmException - */ - private byte[] getHash(String string) throws UnsupportedEncodingException, NoSuchAlgorithmException { - return getHash(string.getBytes(UTF_8)); - } - - /** - * Gets the hash. - * - * @param bytes the bytes - * @return the hash - * @throws NoSuchAlgorithmException - */ - private byte[] getHash(byte[] bytes) throws NoSuchAlgorithmException { - return HMACUtils2.generateHash(bytes); - } - - /** - * - * - * @param reqAuth - * @param reqValues - * @param request - */ - private void getAuthTypeMap(String reqAuth, Map reqValues, Map request) { - String[] reqAuthArr; - if (reqAuth == null) { - BiFunction> authTypeMapFunction = (key, authType) -> Optional - .ofNullable(request).filter(map -> map.containsKey(key)).map(map -> authType); - reqAuthArr = Stream - .of(authTypeMapFunction.apply("demographics", "demo"), authTypeMapFunction.apply(BIOMETRICS, "bio"), - authTypeMapFunction.apply("otp", "otp"), authTypeMapFunction.apply("staticPin", "pin")) - .filter(Optional::isPresent).map(Optional::get).toArray(size -> new String[size]); - } else { - reqAuth = reqAuth.trim(); - if (reqAuth.contains(",")) { - reqAuthArr = reqAuth.split(","); - } else { - reqAuthArr = new String[] { reqAuth }; - } - } - - for (String authType : reqAuthArr) { - authTypeSelectionMap(reqValues, authType); - } - } - - private void authTypeSelectionMap(Map reqValues, String authType) { - - if (authType.equalsIgnoreCase(MatchType.Category.OTP.getType())) { - reqValues.put(OTP, true); - } else if (authType.equalsIgnoreCase(MatchType.Category.DEMO.getType())) { - reqValues.put(DEMO, true); - } else if (authType.equalsIgnoreCase(MatchType.Category.BIO.getType())) { - reqValues.put(BIO, true); - } else if (authType.equalsIgnoreCase(MatchType.Category.SPIN.getType())) { - reqValues.put("pin", true); - } - } - - private void encryptValuesMap(Map identity, Map reqValues, Boolean isInternal, String certsDir,String moduleName) - throws Exception { - EncryptionRequestDto encryptionRequestDto = new EncryptionRequestDto(); - encodeBioData(identity); - encryptionRequestDto.setIdentityRequest(identity); - EncryptionResponseDto encryptionResponse = encrypt.encrypt(encryptionRequestDto, isInternal, keyMgrUtil.getKeysDirPath(certsDir,moduleName)); - reqValues.put("encHmac", encryptionResponse.getRequestHMAC()); - reqValues.put("encSessionKey", encryptionResponse.getEncryptedSessionKey()); - reqValues.put("encRequest", encryptionResponse.getEncryptedIdentity()); - } - - @SuppressWarnings("unchecked") - private void encodeBioData(Map identity) { - List bioIdentity = (List) identity.get(IdAuthCommonConstants.BIOMETRICS); - if (bioIdentity == null) { - return; - } - List bioIdentityInfo = new ArrayList<>(); - - for (Object obj : bioIdentity) { - Map map = (Map) obj; - Map dataMap = map.get(DATA) instanceof Map ? (Map) map.get(DATA) : null; - try { - if (Objects.nonNull(dataMap)) { - Object value = CryptoUtil.encodeToURLSafeBase64(mapper.writeValueAsBytes(dataMap)); - map.replace(DATA, value); - } - } catch (JsonProcessingException e) { - } - bioIdentityInfo.add(map); - } - - identity.replace(IdAuthCommonConstants.BIOMETRICS, bioIdentityInfo); - - } - - @SuppressWarnings("unchecked") - private void applyRecursively(Object obj, String key, String value) { - if (obj instanceof Map) { - Map map = (Map) obj; - Optional matchingKey = map.keySet().stream().filter(k -> k.equalsIgnoreCase(key)).findFirst(); - if (matchingKey.isPresent()) { - map.put(matchingKey.get(), value); - } - - for (Object val : map.values()) { - applyRecursively(val, key, value); - } - } else if (obj instanceof List) { - List list = (List) obj; - for (Object object : list) { - applyRecursively(object, key, value); - } - } - } - - private void idValuesMap(String id, boolean isKyc, boolean isInternal, Map reqValues, - String transactionId, String utcCurrentDateTimeString) { - reqValues.put(ID, id); - if (isInternal) { - reqValues.put(AUTH_TYPE, "auth.internal"); - } else { - if (isKyc) { - reqValues.put(AUTH_TYPE, "kyc"); - reqValues.put(SECONDARY_LANG_CODE, environment.getProperty("mosip.secondary-language")); - } else { - reqValues.put(AUTH_TYPE, "auth"); - } - } - - reqValues.put(TIMESTAMP, utcCurrentDateTimeString); - reqValues.put(TXN, transactionId == null ? "1234567890" : transactionId); - reqValues.put(VER, environment.getProperty(IDA_API_VERSION)); - reqValues.put(DOMAIN_URI, environment.getProperty(MOSIP_DOMAINURI, environment.getProperty(MOSIP_BASE_URL))); - reqValues.put(ENV, environment.getProperty(MOSIP_ENV, "Staging")); - } - - @PostMapping(path = "/uploadIDACertificate", produces = MediaType.TEXT_PLAIN_VALUE) - public String uploadIDACertificate( - @RequestParam(name = "certificateType", required = true) CertificateTypes certificateType, - @RequestBody Map requestData, - @RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName) - throws CertificateException, IOException { - - String certificateData = requestData.get("certData"); - String fileName = certificateType.getFileName(); - System.out.println("certificateType: " + certificateType.toString()); - System.out.println("FileName: " + fileName); - - X509Certificate x509Cert = (X509Certificate) keyMgrUtil.convertToCertificate(certificateData); - Base64.Encoder base64Encoder = Base64.getMimeEncoder(64, LINE_SEPARATOR.getBytes()); - byte[] certificateBytes = x509Cert.getEncoded(); - String encodedCertificateData = new String(base64Encoder.encode(certificateBytes)); - StringBuilder strBuilder = new StringBuilder(); - strBuilder.append(BEGIN_CERTIFICATE); - strBuilder.append(LINE_SEPARATOR); - strBuilder.append(encodedCertificateData); - strBuilder.append(LINE_SEPARATOR); - strBuilder.append(END_CERTIFICATE); - String certificateStr = strBuilder.toString(); - - String keysDirPath = keyMgrUtil.getKeysDirPath(certsDir,moduleName); - - Path parentPath = Paths.get(keysDirPath + "/" + fileName).getParent(); - if (parentPath != null && !Files.exists(parentPath)) { - Files.createDirectories(parentPath); - } - - boolean isErrored = false; - try (BufferedWriter writer = new BufferedWriter(new FileWriter(keysDirPath + "/" + fileName ))) { - writer.write(certificateStr); - writer.flush(); - } catch (Exception e) { - System.err.println(e.getMessage()); - isErrored = true; - } - - return isErrored ? "Upload Failed" : "Upload Success"; - } - - @GetMapping(path = "/generatePartnerKeys", produces = MediaType.APPLICATION_JSON_VALUE) - public CertificateChainResponseDto generatePartnerKeys( - @RequestParam(name = "partnerType", required = true) PartnerTypes partnerType, - @RequestParam(name = "partnerName", required = true) String partnerName, - @RequestParam(name = "keyFileNameByPartnerName", required = false) boolean keyFileNameByPartnerName, - @RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName) - throws CertificateException, IOException, NoSuchAlgorithmException, UnrecoverableEntryException, - KeyStoreException, OperatorCreationException { - - return keyMgrUtil.getPartnerCertificates(partnerType, keyMgrUtil.getKeysDirPath(certsDir,moduleName), partnerName, - keyFileNameByPartnerName); - } - - @DeleteMapping(path = "/clearKeys") - public void clearKeys(@RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName) throws IOException { - - keyMgrUtil.deleteFile(new File(keyMgrUtil.getKeysDirPath(certsDir,moduleName).toString())); - } - - @PostMapping(path = "/updatePartnerCertificate", produces = MediaType.TEXT_PLAIN_VALUE) - public String updatePartnerCertificate( - @RequestParam(name = "partnerType", required = true) PartnerTypes partnerType, - @RequestParam(name = "partnerName", required = false) String partnerName, - @RequestParam(name = "keyFileNameByPartnerName", required = false) boolean keyFileNameByPartnerName, - @RequestBody Map requestData, - @RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName) throws CertificateException, - IOException, NoSuchAlgorithmException, UnrecoverableEntryException, KeyStoreException { - - String certificateData = requestData.get("certData"); - String filePrepend = partnerType.getFilePrepend(); - - X509Certificate x509Cert = (X509Certificate) keyMgrUtil.convertToCertificate(certificateData); - System.out.println("certificateType: " + partnerType.toString()); - System.out.println("filePrepend: " + filePrepend); - boolean isUpdated = keyMgrUtil.updatePartnerCertificate(filePrepend, x509Cert, keyMgrUtil.getKeysDirPath(certsDir,moduleName), - partnerName, keyFileNameByPartnerName); - return isUpdated ? "Update Success" : "Update Failed"; - } - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/BiometricValidation.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/BiometricValidation.java deleted file mode 100644 index 5a6bdd5b67..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/BiometricValidation.java +++ /dev/null @@ -1,299 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.controller; - -import io.swagger.annotations.Api; - -/** - * The Class BiometricValidation. - * - * @author Manoj SP - * - * This class is used to validate the Biometric SDK. It also contains - * functionality to convert from iso/jp2 to jpg. - * - * CheckQuality takes BIR as input. BIR input should have following data - * as mandatory: 1. bdb 2. bdbInfo - type, subtype, format - * (organization, type) - * - * match should provide input in below json structure: - * - * { "probe" : , "gallery" : } - * - * compositeMatch should provide input in below json structure: - * - * { "probe" : , "gallery" : } - */ -//@RestController -@Api(tags = { "Biometric Validation" }) -public class BiometricValidation {//implements IBioApi { -// -// /** The mapper. */ -// @Autowired -// private ObjectMapper mapper; -// -// /** The provider. */ -// @Autowired(required = false) -// private IBioApi provider; -// -// /** The rest. */ -// RestTemplate rest = new RestTemplate(); -// -// /** -// * Iso to JPG. -// * -// * @param file -// * the file -// * @return the response entity -// * @throws IOException -// * Signals that an I/O exception has occurred. -// */ -// @PostMapping(path = "/isoFileToJpg", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) -// public ResponseEntity isoFileToJPG(@RequestParam("ISO") MultipartFile file) throws IOException { -// byte[] inputFileBytes = file.getBytes(); -// int index; -// for (index = 0; index < inputFileBytes.length; index++) { -// if ((char) inputFileBytes[index] == 'j' && (char) inputFileBytes[index + 1] == 'P') { -// break; -// } -// } -// return convertToJPG(Arrays.copyOfRange(inputFileBytes, index - 4, inputFileBytes.length), -// file.getOriginalFilename()); -// } -// -// /** -// * Encoded Iso to JPG. -// * -// * @param isoEncoded -// * the file -// * @return the response entity -// * @throws IOException -// * Signals that an I/O exception has occurred. -// */ -// @PostMapping(path = "/isoEncodedToJpg", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) -// public ResponseEntity isoEncodedToJPG(@RequestBody String isoEncoded) throws IOException { -// byte[] inputBytes = CryptoUtil.decodeBase64(isoEncoded); -// int index; -// for (index = 0; index < inputBytes.length; index++) { -// if ((char) inputBytes[index] == 'j' && (char) inputBytes[index + 1] == 'P') { -// break; -// } -// } -// return convertToJPG(Arrays.copyOfRange(inputBytes, index - 4, inputBytes.length), -// "image"); -// } -// -// /** -// * Jp 2 to JPG. -// * -// * @param file -// * the file -// * @return the response entity -// * @throws IOException -// * Signals that an I/O exception has occurred. -// */ -// @PostMapping(path = "/jp2ToJpg", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) -// public ResponseEntity jp2ToJPG(@RequestParam("JP2") MultipartFile file) throws IOException { -// return convertToJPG(file.getBytes(), file.getOriginalFilename()); -// } -// -// /** -// * Jp 2 to JPG. -// * -// * @param file -// * the file -// * @return the response entity -// * @throws IOException -// * Signals that an I/O exception has occurred. -// */ -// @PostMapping(path = "/jp2EncodedToJpg", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) -// public ResponseEntity jp2EncodedToJPG(@RequestBody String isoEncoded) throws IOException { -// return convertToJPG(CryptoUtil.decodeBase64(isoEncoded), "image"); -// } -// -// /** -// * Convert to JPG. -// * -// * @param jp2Data -// * the jp 2 data -// * @param fileName -// * the file name -// * @return the response entity -// * @throws IOException -// * Signals that an I/O exception has occurred. -// */ -// private ResponseEntity convertToJPG(byte[] jp2Data, String fileName) throws IOException { -// J2KImageReader j2kImageReader = new J2KImageReader(null); -// j2kImageReader.setInput(ImageIO.createImageInputStream(new ByteArrayInputStream(jp2Data))); -// ImageReadParam imageReadParam = j2kImageReader.getDefaultReadParam(); -// BufferedImage image = j2kImageReader.read(0, imageReadParam); -// ByteArrayOutputStream imgBytes = new ByteArrayOutputStream(); -// ImageIO.write(image, "JPG", imgBytes); -// byte[] jpgImg = imgBytes.toByteArray(); -// InputStreamResource resource = new InputStreamResource(new ByteArrayInputStream(jpgImg)); -// HttpHeaders headers = new HttpHeaders(); -// headers.add("Cache-Control", "no-cache, no-store, must-revalidate"); -// headers.add("Pragma", "no-cache"); -// headers.add("Content-Disposition", "attachment; filename=" + fileName + ".jpg"); -// headers.add("Expires", "0"); -// return ResponseEntity.ok().headers(headers).contentLength(jpgImg.length) -// .contentType(MediaType.parseMediaType("application/octet-stream")).body(resource); -// } -// -// /** -// * Check quality. -// * -// * @param sample -// * the sample -// * @return the quality score -// * @throws BiometricException -// * the biometric exception -// */ -// @PostMapping(path = "/checkQuality", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) -// public QualityScore checkQuality(@ApiParam("Requires bio.test.server.provider property to be set.\n" -// + "BIR input should be as follows: \r\n { \r\n" -// + " \"bdbInfo\": {\r\n" + " \"type\": [\"FINGER\"],\r\n" -// + " \"subtype\": [\"Left\", \"Index\"],\r\n" + " \"format\": {\r\n" -// + " \"organization\": \"257\",\r\n" + " \"type\": \"7\"\r\n" + " }\r\n" -// + " },\r\n" + " \"bdb\": bdb data\r\n" + "}") @RequestBody BIR sample) throws BiometricException { -// return provider.checkQuality(sample, null); -// } -// -// /** -// * Match. -// * -// * @param node -// * the node -// * @return the score[] -// * @throws BiometricException -// * the biometric exception -// * @throws JsonParseException -// * the json parse exception -// * @throws JsonMappingException -// * the json mapping exception -// * @throws IOException -// * Signals that an I/O exception has occurred. -// */ -// @SuppressWarnings("unchecked") -// @PostMapping(path = "/match", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) -// public Score[] match( -// @ApiParam("Requires bio.test.server.provider property to be set.\n" -// + "match should provide input in below json structure:\r\n" + "{\r\n" -// + " \"probe\" : BIR data,\r\n" + " \"gallery\" : array of BIR data\r\n" -// + " }") @RequestBody ObjectNode node) -// throws BiometricException, JsonParseException, JsonMappingException, IOException { -// BIR probe = mapper.readValue(node.get("probe").toString(), BIR.class); -// BIR[] gallery = (BIR[]) ((List) mapper.readValue(node.get("gallery").toString(), -// new TypeReference>() { -// })).toArray(new BIR[] {}); -// return provider.match(probe, gallery, null); -// } -// -// /** -// * Composite match. -// * -// * @param node -// * the node -// * @return the composite score -// * @throws BiometricException -// * the biometric exception -// * @throws JsonParseException -// * the json parse exception -// * @throws JsonMappingException -// * the json mapping exception -// * @throws IOException -// * Signals that an I/O exception has occurred. -// */ -// @SuppressWarnings("unchecked") -// @PostMapping(path = "/compositeMatch", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) -// public CompositeScore compositeMatch( -// @ApiParam("Requires bio.test.server.provider property to be set.\n." -// + "compositeMatch should provide input in below json structure:\r\n" + " { \r\n" -// + " \"probe\" : array of BIR data,\r\n" + " \"gallery\" : array of BIR data\r\n" -// + " }") @RequestBody ObjectNode node) -// throws BiometricException, JsonParseException, JsonMappingException, IOException { -// BIR[] probe = (BIR[]) ((List) mapper.readValue(node.get("probe").toString(), -// new TypeReference>() { -// })).toArray(new BIR[] {}); -// BIR[] gallery = (BIR[]) ((List) mapper.readValue(node.get("gallery").toString(), -// new TypeReference>() { -// })).toArray(new BIR[] {}); -// return provider.compositeMatch(probe, gallery, null); -// } -// -// /* -// * (non-Javadoc) -// * -// * @see -// * io.mosip.kernel.core.bioapi.spi.IBioApi#checkQuality(io.mosip.kernel.core. -// * cbeffutil.entity.BIR, io.mosip.kernel.core.bioapi.model.KeyValuePair[]) -// */ -// @Override -// public QualityScore checkQuality(BIR probe, KeyValuePair[] var2) throws BiometricException { -// return this.checkQuality(probe); -// } -// -// /* -// * (non-Javadoc) -// * -// * @see -// * io.mosip.kernel.core.bioapi.spi.IBioApi#compositeMatch(io.mosip.kernel.core. -// * cbeffutil.entity.BIR[], io.mosip.kernel.core.cbeffutil.entity.BIR[], -// * io.mosip.kernel.core.bioapi.model.KeyValuePair[]) -// */ -// @Override -// public CompositeScore compositeMatch(BIR[] probe, BIR[] gallery, KeyValuePair[] var3) throws BiometricException { -// ObjectNode node = mapper.createObjectNode(); -// try { -// node.set("probe", mapper.readTree(mapper.writeValueAsString(probe))); -// List asList = Arrays.asList(gallery); -// node.set("gallery", mapper.readTree(mapper.writeValueAsString(asList))); -// return this.compositeMatch(node); -// } catch (Exception e) { -// e.printStackTrace(); -// throw new BiometricException("", e.getMessage(), e); -// } -// } -// -// /* -// * (non-Javadoc) -// * -// * @see -// * io.mosip.kernel.core.bioapi.spi.IBioApi#match(io.mosip.kernel.core.cbeffutil. -// * entity.BIR, io.mosip.kernel.core.cbeffutil.entity.BIR[], -// * io.mosip.kernel.core.bioapi.model.KeyValuePair[]) -// */ -// @Override -// public Score[] match(BIR probe, BIR[] gallery, KeyValuePair[] var3) throws BiometricException { -// ObjectNode node = mapper.createObjectNode(); -// try { -// node.set("probe", mapper.readTree(mapper.writeValueAsString(Arrays.asList(probe)))); -// node.set("gallery", mapper.readTree(mapper.writeValueAsString(Arrays.asList(gallery)))); -// return this.match(node); -// } catch (IOException e) { -// e.printStackTrace(); -// throw new BiometricException("", e.getMessage(), e); -// } -// } -// -// /* -// * (non-Javadoc) -// * -// * @see -// * io.mosip.kernel.core.bioapi.spi.IBioApi#extractTemplate(io.mosip.kernel.core. -// * cbeffutil.entity.BIR, io.mosip.kernel.core.bioapi.model.KeyValuePair[]) -// */ -// @Override -// public BIR extractTemplate(BIR probe, KeyValuePair[] var2) throws BiometricException { -// return null; -// } -// -// /* -// * (non-Javadoc) -// * -// * @see io.mosip.kernel.core.bioapi.spi.IBioApi#segment(io.mosip.kernel.core. -// * cbeffutil.entity.BIR, io.mosip.kernel.core.bioapi.model.KeyValuePair[]) -// */ -// @Override -// public BIR[] segment(BIR var1, KeyValuePair[] var2) throws BiometricException { -// return null; -// } -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Decode.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Decode.java deleted file mode 100644 index ac64f5a9f1..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Decode.java +++ /dev/null @@ -1,77 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.controller; - -import java.io.ByteArrayInputStream; -import java.nio.charset.StandardCharsets; - -import org.springframework.core.io.InputStreamResource; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import io.mosip.kernel.core.util.CryptoUtil; -import io.swagger.annotations.Api; - -/** - * - * The Class Decode is used to decode the String. - * @author Arun Bose S - */ -@RestController -@Api(tags = { "Decode" }) -public class Decode { - - /** - * Decode. - * - * @param stringToDecode the string to decode - * @return the string - */ - @PostMapping(path = "/decodeBase64Plain", consumes = MediaType.TEXT_PLAIN_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public String decodeBase64Plain(@RequestBody String stringToDecode) { - return new String(CryptoUtil.decodePlainBase64(stringToDecode), StandardCharsets.UTF_8); - } - - @PostMapping(path = "/decodeBase64UrlSafe", consumes = MediaType.TEXT_PLAIN_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public String decodeBase64UrlSafe(@RequestBody String stringToDecode) { - return new String(CryptoUtil.decodeURLSafeBase64(stringToDecode), StandardCharsets.UTF_8); - } - - /** - *Encodes the contents of cpeff file. - * - * @param stringToDecode the string to decode - * @param fileName the file name - * @return the response entity - */ - @PostMapping(path = "/decodeBase64PlainToFile", consumes = MediaType.TEXT_PLAIN_VALUE, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) - public ResponseEntity decodeBase64PlainToFile(@RequestBody String stringToDecode, - @RequestParam String fileName) { - byte[] decodedFileData = CryptoUtil.decodePlainBase64(stringToDecode); - HttpHeaders headers = new HttpHeaders(); - headers.add("Cache-Control", "no-cache, no-store, must-revalidate"); - headers.add("Pragma", "no-cache"); - headers.add("Content-Disposition", "attachment; filename=" + fileName); - headers.add("Expires", "0"); - InputStreamResource resource = new InputStreamResource(new ByteArrayInputStream(decodedFileData)); - return ResponseEntity.ok().headers(headers).contentLength(decodedFileData.length) - .contentType(MediaType.parseMediaType("application/octet-stream")).body(resource); - } - - @PostMapping(path = "/decodeBase64UrlSafeToFile", consumes = MediaType.TEXT_PLAIN_VALUE, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) - public ResponseEntity decodeBase64UrlSafeToFile(@RequestBody String stringToDecode, - @RequestParam String fileName) { - byte[] decodedFileData = CryptoUtil.decodeURLSafeBase64(stringToDecode); - HttpHeaders headers = new HttpHeaders(); - headers.add("Cache-Control", "no-cache, no-store, must-revalidate"); - headers.add("Pragma", "no-cache"); - headers.add("Content-Disposition", "attachment; filename=" + fileName); - headers.add("Expires", "0"); - InputStreamResource resource = new InputStreamResource(new ByteArrayInputStream(decodedFileData)); - return ResponseEntity.ok().headers(headers).contentLength(decodedFileData.length) - .contentType(MediaType.parseMediaType("application/octet-stream")).body(resource); - } -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Decrypt.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Decrypt.java deleted file mode 100644 index a5b5da133f..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Decrypt.java +++ /dev/null @@ -1,518 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.controller; - -import static io.mosip.authentication.core.constant.IdAuthCommonConstants.DEFAULT_AAD_LAST_BYTES_NUM; -import static io.mosip.authentication.core.constant.IdAuthCommonConstants.DEFAULT_SALT_LAST_BYTES_NUM; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.security.GeneralSecurityException; -import java.security.InvalidAlgorithmParameterException; -import java.security.InvalidKeyException; -import java.security.KeyManagementException; -import java.security.KeyStore.PrivateKeyEntry; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.PrivateKey; -import java.security.UnrecoverableEntryException; -import java.security.cert.CertificateException; -import java.security.spec.InvalidKeySpecException; -import java.security.spec.MGF1ParameterSpec; -import java.util.Arrays; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import javax.crypto.BadPaddingException; -import javax.crypto.Cipher; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.NoSuchPaddingException; -import javax.crypto.SecretKey; -import javax.crypto.spec.GCMParameterSpec; -import javax.crypto.spec.OAEPParameterSpec; -import javax.crypto.spec.PSource.PSpecified; -import javax.crypto.spec.SecretKeySpec; - -import org.apache.commons.codec.DecoderException; -import org.apache.commons.codec.binary.Hex; -import org.apache.commons.lang.ArrayUtils; -import org.bouncycastle.crypto.InvalidCipherTextException; -import org.bouncycastle.operator.OperatorCreationException; -import org.json.JSONException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.env.Environment; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpRequest; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseCookie; -import org.springframework.http.ResponseEntity; -import org.springframework.http.client.ClientHttpRequestExecution; -import org.springframework.http.client.ClientHttpRequestInterceptor; -import org.springframework.http.client.ClientHttpResponse; -import org.springframework.lang.Nullable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.reactive.function.client.ClientResponse; -import org.springframework.web.reactive.function.client.WebClient; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; - -import io.mosip.authentication.core.constant.IdAuthConfigKeyConstants; -import io.mosip.authentication.core.constant.IdAuthenticationErrorConstants; -import io.mosip.authentication.core.exception.IdAuthUncheckedException; -import io.mosip.authentication.core.logger.IdaLogger; -import io.mosip.authentication.core.util.BytesUtil; -import io.mosip.kernel.core.http.RequestWrapper; -import io.mosip.kernel.core.logger.spi.Logger; -import io.mosip.kernel.core.util.CryptoUtil; -import io.mosip.kernel.core.util.DateUtils; -import io.mosip.testrig.authentication.demo.service.controller.Encrypt.SplittedEncryptedData; -import io.mosip.testrig.authentication.demo.service.dto.CryptomanagerRequestDto; -import io.mosip.testrig.authentication.demo.service.dto.EncryptionResponseDto; -import io.mosip.testrig.authentication.demo.service.helper.CryptoCoreUtil; -import io.mosip.testrig.authentication.demo.service.helper.KeyMgrUtil; -import io.mosip.testrig.authentication.demo.service.helper.PartnerTypes; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation;; - -/** - * The Class Decrypt is used to decrypt the KYC Response. - * @author Arun Bose S - * @author Sanjay Murali - */ -@RestController -@Api(tags = { "Decrypt" }) -public class Decrypt { - - private static final int TAG_LENGTH = 128; - - @Autowired - private Environment env; - - /** The obj mapper. */ - @Autowired - private ObjectMapper objMapper; - - /** The app ID. */ - @Value("${application.id}") - private String appID; - - /** The app ID. */ - @Value("${" + IdAuthConfigKeyConstants.PARTNER_REFERENCE_ID + "}") - private String partnerId; - - /** The encrypt URL. */ - @Value("${mosip.ida.decrypt-url}") - private String decryptURL; - - /** The key splitter. */ - @Value("${" +IdAuthConfigKeyConstants.KEY_SPLITTER+ "}") - private String keySplitter; - - @Autowired - KeyMgrUtil keyMgrUtil; - - @Autowired - Encrypt encrypt; - - @Autowired - CryptoCoreUtil cryptoCoreUtil; - - /** The logger. */ - private static Logger logger = IdaLogger.getLogger(Decrypt.class); - - /** - * Decrypt. - * - * @param data the data - * @return the string - * @throws IOException Signals that an I/O exception has occurred. - * @throws InvalidKeySpecException the invalid key spec exception - * @throws NoSuchAlgorithmException the no such algorithm exception - * @throws KeyManagementException the key management exception - */ - @PostMapping(path = "/authRequest/decrypt", produces = MediaType.APPLICATION_JSON_VALUE) - public String decrypt(@RequestBody String data, - @RequestParam(name="refId",required=false) @Nullable String refId, - @RequestParam(name="isInternal",required=false) @Nullable boolean isInternal, - @RequestParam(name="isBiometrics",required=false) @Nullable boolean isBiometrics, - @RequestParam(name="salt",required=false) @Nullable String salt, - @RequestParam(name="aad",required=false) @Nullable String aad) - throws IOException, InvalidKeySpecException, NoSuchAlgorithmException, KeyManagementException { - if (refId == null) { - refId = getRefId(isInternal, isBiometrics); - } - return kernelDecrypt(data, refId, salt, aad); - } - - @PostMapping(path = "/authRequest/decryptSplittedData", produces = MediaType.APPLICATION_JSON_VALUE) - public String decryptSplittedData(@RequestBody SplittedEncryptedData splittedData, - @RequestParam(name="refId",required=false) @Nullable String refId, - @RequestParam(name="isInternal",required=false) @Nullable boolean isInternal, - @RequestParam(name="isInternal",required=false) @Nullable boolean isBiometrics, - @RequestParam(name="salt",required=false) @Nullable String salt, - @RequestParam(name="aad",required=false) @Nullable String aad) - throws IOException, InvalidKeySpecException, NoSuchAlgorithmException, KeyManagementException { - byte[] data = combineToByteArray(splittedData.getEncryptedData(), splittedData.getEncryptedSessionKey()); - if (refId == null) { - refId = getRefId(isInternal, isBiometrics); - } - byte[] bytesFromThumbprint = getBytesFromThumbprint(splittedData.getThumbprint()); - - data = ArrayUtils.addAll(bytesFromThumbprint, data); - return kernelDecrypt(CryptoUtil.encodeToURLSafeBase64(data), refId, salt, aad); - } - - public static byte[] getBytesFromThumbprint(String thumbprint) { - try { - //First try decoding with hex - return decodeHex(thumbprint); - } catch (DecoderException e) { - try { - //Then try decoding with base64 - return CryptoUtil.decodeURLSafeBase64(thumbprint); - } catch (Exception ex) { - throw new IdAuthUncheckedException(IdAuthenticationErrorConstants.UNABLE_TO_PROCESS, ex); - } - } - } - - public static byte[] decodeHex(String hexData) throws DecoderException{ - return Hex.decodeHex(hexData); - } - - @PostMapping(path = "/authRequest/decryptAuthRequest", produces = MediaType.APPLICATION_JSON_VALUE) - public String decryptAuthRequest(@RequestBody Map authRequestMap) - throws IOException, InvalidKeySpecException, NoSuchAlgorithmException, KeyManagementException, InvalidKeyException, NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException, JSONException { - - boolean isInternal = authRequestMap.get("id").equals("mosip.identity.auth.internal"); - Map outputAuthRequestMap = new LinkedHashMap<>(authRequestMap); - String request = (String) outputAuthRequestMap.get("request"); - String reqSessionKey = (String) outputAuthRequestMap.get("requestSessionKey"); - String thumbprint = (String) outputAuthRequestMap.get("thumbprint"); - - String decryptSplittedData = this.decryptSplittedData(new SplittedEncryptedData(reqSessionKey, request, thumbprint), null, isInternal, false, null, null); - @SuppressWarnings("unchecked") - Map requestMap = objMapper.readValue(decryptSplittedData.getBytes("UTF-8"), Map.class); - outputAuthRequestMap.put("request", requestMap); - - decryptBiometricsInRequestBlock(isInternal, requestMap); - - return objMapper.writeValueAsString(outputAuthRequestMap); - } - - @SuppressWarnings("unchecked") - @PostMapping(path = "/authRequest/decryptBiometricsInRequestBlock", produces = MediaType.APPLICATION_JSON_VALUE) - private Map decryptBiometricsInRequestBlock( - @RequestParam(name="isInternal",required=false) @Nullable boolean isInternal, - @RequestBody Map requestMap) throws IOException, JsonParseException, - JsonMappingException, KeyManagementException, NoSuchAlgorithmException, JSONException, InvalidKeyException, - NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException, - InvalidKeySpecException { - List> biometricsMap = (List>) requestMap.get("biometrics"); - decryptBiometricsListOfAuthRequest(isInternal, biometricsMap); - return requestMap; - } - - @SuppressWarnings("unchecked") - @PostMapping(path = "/authRequest/decryptBiometricsListOfAuthRequest", produces = MediaType.APPLICATION_JSON_VALUE) - private List> decryptBiometricsListOfAuthRequest( - @RequestParam(name="isInternal",required=false) @Nullable boolean isInternal, - @RequestBody List> biometricsMap) throws IOException, - JsonParseException, JsonMappingException, KeyManagementException, NoSuchAlgorithmException, JSONException, - InvalidKeyException, NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, - BadPaddingException, InvalidKeySpecException { - if(biometricsMap != null) { - for(Map segmentMap: biometricsMap) { - String biometricDataStr = (String) segmentMap.get("data"); - Map bioDataMap; - if(isInternal) { - bioDataMap = objMapper.readValue(CryptoUtil.decodeURLSafeBase64(biometricDataStr), Map.class); - } else { - bioDataMap = objMapper.readValue(CryptoUtil.decodeURLSafeBase64(biometricDataStr.split("\\.")[1]), Map.class); - } - segmentMap.put("data", bioDataMap); - - String digitalIdStr = (String) bioDataMap.get("digitalId"); - if(!isInternal && digitalIdStr != null) { - Map bioDigitalIdMap = objMapper.readValue(CryptoUtil.decodeURLSafeBase64(digitalIdStr.split("\\.")[1]), Map.class); - bioDataMap.put("digitalId", bioDigitalIdMap); - } - - String encryptedBioValue = (String) bioDataMap.get("bioValue"); - String timestamp = (String) bioDataMap.get("timestamp"); - String transactionId = (String) bioDataMap.get("transactionId"); - String bioSessionKey = (String) segmentMap.get("sessionKey"); - String thumbprint = (String) segmentMap.get("thumbprint"); - - byte[] bytesFromThumbprint = getBytesFromThumbprint(thumbprint); - - - byte[] data = combineToByteArray(encryptedBioValue, bioSessionKey); - //Check if the data contains thumbprint already - byte[] tpBytes = new byte[bytesFromThumbprint.length]; - System.arraycopy(data, 0, tpBytes, 0, bytesFromThumbprint.length); - if(Arrays.compare(tpBytes, bytesFromThumbprint) != 0) { - data = ArrayUtils.addAll(bytesFromThumbprint, data); - } - - String decryptBiometrics = this.decryptBiometrics(CryptoUtil.encodeToURLSafeBase64(data), timestamp, transactionId, isInternal); - - bioDataMap.put("bioValue", decryptBiometrics); - } - } - return biometricsMap; - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @PostMapping(path = "/decryptBiometricValue") - public String decryptBiometrics(@RequestBody String encryptedBioValue, - @RequestParam(name="timestamp",required=false) @Nullable String timestamp, - @RequestParam(name="transactionId",required=false) @Nullable String transactionId, - @RequestParam(name="isInternal",required=false) @Nullable boolean isInternal) - throws KeyManagementException, NoSuchAlgorithmException, IOException, JSONException, InvalidKeyException, - NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException, - InvalidKeySpecException { - Encrypt.turnOffSslChecking(); - RestTemplate restTemplate = new RestTemplate(); - ClientHttpRequestInterceptor interceptor = new ClientHttpRequestInterceptor() { - - @Override - public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) - throws IOException { - String authToken = generateAuthToken(); - if(authToken != null && !authToken.isEmpty()) { - request.getHeaders().set("Cookie", "Authorization=" + authToken); - } - return execution.execute(request, body); - } - }; - - restTemplate.setInterceptors(Collections.singletonList(interceptor)); - - - byte[] xorBytes = BytesUtil.getXOR(timestamp, transactionId); - byte[] saltLastBytes = BytesUtil.getLastBytes(xorBytes, env.getProperty(IdAuthConfigKeyConstants.IDA_SALT_LASTBYTES_NUM, Integer.class, DEFAULT_SALT_LAST_BYTES_NUM)); - String salt = CryptoUtil.encodeToURLSafeBase64(saltLastBytes); - byte[] aadLastBytes = BytesUtil.getLastBytes(xorBytes, env.getProperty(IdAuthConfigKeyConstants.IDA_AAD_LASTBYTES_NUM, Integer.class, DEFAULT_AAD_LAST_BYTES_NUM)); - String aad = CryptoUtil.encodeToURLSafeBase64(aadLastBytes); - - CryptomanagerRequestDto request = new CryptomanagerRequestDto(); - request.setApplicationId(appID); - request.setSalt(salt); - request.setAad(aad); - request.setReferenceId(getRefId(isInternal, true)); - request.setData(encryptedBioValue); - request.setTimeStamp(DateUtils.formatToISOString(DateUtils.getUTCCurrentDateTime())); - - HttpEntity> httpEntity = new HttpEntity<>(createRequest(request)); - ResponseEntity response = restTemplate.exchange(decryptURL, HttpMethod.POST, httpEntity, Map.class); - - if(response.getStatusCode() == HttpStatus.OK) { - Map responseMap = (Map) response.getBody().get("response"); - if(responseMap != null) { - //Encode biovalue as plain base64 encoding (not url encoded) - return CryptoUtil.encodeToPlainBase64(CryptoUtil.decodeURLSafeBase64((String) responseMap.get("data"))); - } - } - return null ; - } - - private String getRefId(boolean isInternal, boolean isBiometrics) { - String refId; - if(isBiometrics) { - if (isInternal) { - refId = env.getProperty(IdAuthConfigKeyConstants.INTERNAL_BIO_REFERENCE_ID); - } else { - refId = env.getProperty(IdAuthConfigKeyConstants.PARTNER_BIO_REFERENCE_ID); - } - } else { - if (isInternal) { - refId = env.getProperty(IdAuthConfigKeyConstants.INTERNAL_REFERENCE_ID); - } else { - refId = env.getProperty(IdAuthConfigKeyConstants.PARTNER_REFERENCE_ID); - } - } - return refId; - } - - private byte[] combineToByteArray(String request, String requestSessionKey) { - byte[] encryptedRequest = CryptoUtil.decodeURLSafeBase64(request); - byte[] encryptedSessionKey = CryptoUtil.decodeURLSafeBase64(requestSessionKey); - return CryptoUtil.combineByteArray(encryptedRequest, encryptedSessionKey, keySplitter); - } - - /** - * This method is used to call the kernel decrypt api for decryption. - * - * @param data the data - * @param salt - * @param aad - * @return the string - * @throws KeyManagementException the key management exception - * @throws NoSuchAlgorithmException the no such algorithm exception - */ - @SuppressWarnings({ "unchecked", "rawtypes" }) - public String kernelDecrypt(String data, String refId, String salt, String aad) - throws KeyManagementException, NoSuchAlgorithmException { - Encrypt.turnOffSslChecking(); - RestTemplate restTemplate = new RestTemplate(); - ClientHttpRequestInterceptor interceptor = new ClientHttpRequestInterceptor() { - - @Override - public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) - throws IOException { - String authToken = generateAuthToken(); - if(authToken != null && !authToken.isEmpty()) { - request.getHeaders().set("Cookie", "Authorization=" + authToken); - } - return execution.execute(request, body); - } - }; - - restTemplate.setInterceptors(Collections.singletonList(interceptor)); - - CryptomanagerRequestDto cryptomanagerRequestDto = new CryptomanagerRequestDto(); - cryptomanagerRequestDto.setApplicationId(appID); - cryptomanagerRequestDto.setReferenceId(refId); - cryptomanagerRequestDto.setData(data); - cryptomanagerRequestDto.setAad(aad); - cryptomanagerRequestDto.setSalt(salt); - cryptomanagerRequestDto.setTimeStamp(DateUtils.formatToISOString(DateUtils.getUTCCurrentDateTime())); - - HttpEntity> httpEntity = new HttpEntity<>(createRequest(cryptomanagerRequestDto)); - ResponseEntity response = restTemplate.exchange(decryptURL, HttpMethod.POST, httpEntity, Map.class); - - if(response.getStatusCode() == HttpStatus.OK) { - String responseData = (String) ((Map) response.getBody().get("response")).get("data"); - return new String (CryptoUtil.decodeURLSafeBase64(responseData), StandardCharsets.UTF_8); - } - return null; - } - - /** - * Generate auth token. - * - * @return the string - */ - public String generateAuthToken() { - ObjectNode requestBody = objMapper.createObjectNode(); - requestBody.put("clientId", env.getProperty("auth-token-generator.rest.clientId")); - requestBody.put("secretKey", env.getProperty("auth-token-generator.rest.secretKey")); - requestBody.put("appId", env.getProperty("auth-token-generator.rest.appId")); - RequestWrapper request = new RequestWrapper<>(); - request.setRequesttime(DateUtils.getUTCCurrentDateTime()); - request.setRequest(requestBody); - ClientResponse response = WebClient.create(env.getProperty("auth-token-generator.rest.uri")).post() - .syncBody(request) - .exchange().block(); - logger.info("sessionID", "IDA", "DECRYPT", "AuthResponse :" + response.toEntity(String.class).block().getBody()); - List list = response.cookies().get("Authorization"); - if(list != null && !list.isEmpty()) { - ResponseCookie responseCookie = list.get(0); - return responseCookie.getValue(); - } - return ""; - } - - /** - * Creates the request. - * - * @param the generic type - * @param t the t - * @return the request wrapper - */ - public static RequestWrapper createRequest(T t){ - RequestWrapper request = new RequestWrapper<>(); - request.setRequest(t); - request.setId("ida"); - request.setRequesttime(DateUtils.getUTCCurrentDateTime()); - return request; - } - - @PostMapping(path = "/decryptEkycData", produces = MediaType.TEXT_PLAIN_VALUE) - public String decryptEkycData( - @RequestBody Map requestData, - @RequestParam(name = "partnerName", required = false) String partnerName, - @RequestParam(name = "keyFileNameByPartnerName", required = false) boolean keyFileNameByPartnerName, - @RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName - ) throws Exception { - - String identity = requestData.get("identity"); - PrivateKeyEntry ekycKey = keyMgrUtil.getKeyEntry(keyMgrUtil.getKeysDirPath(certsDir, moduleName), PartnerTypes.EKYC, partnerName, keyFileNameByPartnerName); - - String sessionKey = requestData.get("sessionKey"); - - byte[] encSecKey; - byte[] encKycData; - if(sessionKey == null) { - SplittedEncryptedData encryptedData = encrypt.splitEncryptedData(identity); - encSecKey = CryptoUtil.decodeURLSafeBase64(encryptedData.getEncryptedSessionKey()); - encKycData = CryptoUtil.decodeURLSafeBase64(encryptedData.getEncryptedData()); - } else { - encSecKey = CryptoUtil.decodeURLSafeBase64(sessionKey); - encKycData = CryptoUtil.decodeURLSafeBase64(identity); - } - - byte[] decryptedSecrectKey = decryptSecretKey(ekycKey.getPrivateKey(), encSecKey); - - Cipher cipher = Cipher.getInstance("AES/GCM/PKCS5Padding"); //NoPadding - byte[] nonce = Arrays.copyOfRange(encKycData, encKycData.length - cipher.getBlockSize(), encKycData.length); - byte[] encryptedKycData = Arrays.copyOf(encKycData, encKycData.length - cipher.getBlockSize()); - - SecretKey secretKey = new SecretKeySpec(decryptedSecrectKey, 0, decryptedSecrectKey.length, "AES"); - GCMParameterSpec gcmParameterSpec = new GCMParameterSpec(TAG_LENGTH, nonce); - cipher.init(Cipher.DECRYPT_MODE, secretKey, gcmParameterSpec); - - return new String(cipher.doFinal(encryptedKycData), "UTF-8"); - } - - @PostMapping(path = "/decryptWithPartnerKey", produces = MediaType.TEXT_PLAIN_VALUE) - public String decryptWithPartnerKey( - @RequestBody String data, - @RequestParam(name = "partnerType", required = true) PartnerTypes partnerType, - @RequestParam(name = "partnerName", required = false) String partnerName, - @RequestParam(name = "keyFileNameByPartnerName", required = false) boolean keyFileNameByPartnerName, - @RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName - ) throws Exception { - PrivateKeyEntry ekycKey = keyMgrUtil.getKeyEntry(keyMgrUtil.getKeysDirPath(certsDir, moduleName), partnerType, partnerName, keyFileNameByPartnerName); - return cryptoCoreUtil.decrypt(data, ekycKey); - } - - @PostMapping(path = "/asymmetricDecryptionForPrivateKeyP12File") - @ApiOperation(value = "Asymmetric Decrypt using private key p12 file", response = EncryptionResponseDto.class) - public String asymmetricDecryptionForPrivateKeyP12File(@RequestBody String data, - @RequestParam(name = "p12FileName", required = true) String p12FileName, - @RequestParam(name = "keystorePassword", required = true) char[] p12Pass, - @RequestParam(name = "keyAlias", required = true) String keyAlias, - @RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName) throws Exception { - return kernelAsymmetricDecryptForP12File(data, p12FileName, certsDir, moduleName, p12Pass, keyAlias); - } - - private String kernelAsymmetricDecryptForP12File(String data, String p12FileName, String certsDir, - String moduleName, char[] p12Pass, String keyAlias) throws InvalidCipherTextException, NoSuchAlgorithmException, UnrecoverableEntryException, KeyStoreException, CertificateException, OperatorCreationException, GeneralSecurityException, IOException { - return keyMgrUtil.asymmetricDecryptionForP12File(CryptoUtil.decodePlainBase64(data), p12FileName, certsDir, moduleName, p12Pass, keyAlias); - } - - private byte[] decryptSecretKey(PrivateKey privKey, byte[] encKey) throws NoSuchAlgorithmException, NoSuchPaddingException, - InvalidKeyException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException { - Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPWITHSHA-256ANDMGF1PADDING"); - OAEPParameterSpec oaepParams = new OAEPParameterSpec("SHA-256", "MGF1", MGF1ParameterSpec.SHA256, - PSpecified.DEFAULT); - cipher.init(Cipher.DECRYPT_MODE, privKey, oaepParams); - return cipher.doFinal(encKey, 0, encKey.length); - } - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Encode.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Encode.java deleted file mode 100644 index ad691e53f0..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Encode.java +++ /dev/null @@ -1,59 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.controller; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; - -//import java.util.Base64; - -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -import io.mosip.kernel.core.util.CryptoUtil; -import io.swagger.annotations.Api; - -/** - * @author ArunBose S - * @author DineshKaruppiah - * The Class Encode is used to encode the String. - */ -@RestController -@Api(tags = { "Encode" }) -public class Encode { - - /** - * Encode. - * - * @param stringToEncode the string to encode - * @return the string - */ - @PostMapping(path = "/encodeBase64UrlSafe", consumes = MediaType.TEXT_PLAIN_VALUE, produces = MediaType.TEXT_PLAIN_VALUE) - public String encodeBase64UrlSafe(@RequestBody String stringToEncode) { - return CryptoUtil.encodeToURLSafeBase64(stringToEncode.getBytes(StandardCharsets.UTF_8)); - } - - @PostMapping(path = "/encodeBase64Plain", consumes = MediaType.TEXT_PLAIN_VALUE, produces = MediaType.TEXT_PLAIN_VALUE) - public String encodeBase64Plain(@RequestBody String stringToEncode) { - return CryptoUtil.encodeToPlainBase64(stringToEncode.getBytes(StandardCharsets.UTF_8)); - } - - /** - * Encodes the contents of cpeff file. - * - * @param file the file - * @return the string - * @throws IOException Signals that an I/O exception has occurred. - */ - @PostMapping(value = "/encodeToBase64UrlSafeFromFile", produces = MediaType.TEXT_PLAIN_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) - public String encodeToBase64UrlSafeFromFile(@RequestPart MultipartFile file) throws IOException { - return CryptoUtil.encodeToURLSafeBase64(file.getBytes()); - } - - @PostMapping(value = "/encodeToBase64PlainFromFile", produces = MediaType.TEXT_PLAIN_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) - public String encodeToBase64PlainSafeFromFile(@RequestPart MultipartFile file) throws IOException { - return CryptoUtil.encodeToPlainBase64(file.getBytes()); - } -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Encrypt.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Encrypt.java deleted file mode 100644 index 39e5b9001c..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Encrypt.java +++ /dev/null @@ -1,609 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.controller; - -import static io.mosip.authentication.core.constant.IdAuthCommonConstants.DEFAULT_AAD_LAST_BYTES_NUM; -import static io.mosip.authentication.core.constant.IdAuthCommonConstants.DEFAULT_SALT_LAST_BYTES_NUM; - -import java.io.ByteArrayInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.security.GeneralSecurityException; -import java.security.InvalidAlgorithmParameterException; -import java.security.InvalidKeyException; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import java.security.PublicKey; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.security.spec.InvalidKeySpecException; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.IntStream; - -import javax.crypto.BadPaddingException; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.NoSuchPaddingException; -import javax.crypto.SecretKey; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; -import javax.xml.bind.DatatypeConverter; - -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang.ArrayUtils; -import org.bouncycastle.operator.OperatorCreationException; -import org.json.JSONException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.env.Environment; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpRequest; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseCookie; -import org.springframework.http.ResponseEntity; -import org.springframework.http.client.ClientHttpRequestExecution; -import org.springframework.http.client.ClientHttpRequestInterceptor; -import org.springframework.http.client.ClientHttpResponse; -import org.springframework.lang.Nullable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.client.RestClientException; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.reactive.function.client.ClientResponse; -import org.springframework.web.reactive.function.client.WebClient; -import org.springframework.web.util.UriComponentsBuilder; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; - -import io.mosip.authentication.core.constant.IdAuthConfigKeyConstants; -import io.mosip.authentication.core.logger.IdaLogger; -import io.mosip.authentication.core.util.BytesUtil; -import io.mosip.kernel.core.http.RequestWrapper; -import io.mosip.kernel.core.logger.spi.Logger; -import io.mosip.kernel.core.util.CryptoUtil; -import io.mosip.kernel.core.util.DateUtils; -import io.mosip.kernel.core.util.HMACUtils2; -import io.mosip.testrig.authentication.demo.service.dto.CryptomanagerRequestDto; -import io.mosip.testrig.authentication.demo.service.dto.EncryptionRequestDto; -import io.mosip.testrig.authentication.demo.service.dto.EncryptionResponseDto; -import io.mosip.testrig.authentication.demo.service.helper.CertificateTypes; -import io.mosip.testrig.authentication.demo.service.helper.CryptoUtility; -import io.mosip.testrig.authentication.demo.service.helper.KeyMgrUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * The Class Encrypt is used to encrypt the identity block using Kernel Api. - * - * @author Dinesh Karuppiah - */ - -@RestController -@Api(tags = { "Encrypt" }) -public class Encrypt { - - public static final int THUMBPRINT_LENGTH = 20; - - @Autowired - private Environment env; - - /** The Constant ASYMMETRIC_ALGORITHM. */ - private static final String SSL = "SSL"; - - /** The obj mapper. */ - @Autowired - private ObjectMapper objMapper; - - @Autowired - KeyMgrUtil keyMgrUtil; - - /** KeySplitter. */ - @Value("${" + IdAuthConfigKeyConstants.KEY_SPLITTER + "}") - private String keySplitter; - - /** The encrypt URL. */ - @Value("${mosip.ida.publicKey-url}") - private String publicKeyURL; - - /** The app ID. */ - @Value("${application.id}") - private String appID; - - @Autowired - private CryptoUtility cryptoUtil; - - @Value("${mosip.ida.encrypt-url}") - private String encryptURL; - - /** The logger. */ - private static Logger logger = IdaLogger.getLogger(Encrypt.class); - - /** - * Encrypt. - * - * @param encryptionRequestDto the encryption request dto - * @param isInternal the is internal - * @return the encryption response dto - * @throws Exception - */ - @PostMapping(path = "/encrypt") - @ApiOperation(value = "Encrypt Identity with sessionKey and Encrypt Session Key with Public Key", response = EncryptionResponseDto.class) - public EncryptionResponseDto encrypt(@RequestBody EncryptionRequestDto encryptionRequestDto, - @RequestParam(name = "refId", required = false) @Nullable String refId, - @RequestParam(name = "isInternal", required = false) @Nullable boolean isInternal, - @RequestParam(name = "isInternal", required = false) @Nullable boolean isBiometrics) throws Exception { - if (refId == null) { - refId = getRefId(isInternal, isBiometrics); - } - return kernelEncrypt(encryptionRequestDto, refId); - } - - @PostMapping(path = "/asymmetricEncryptionForCertFile") - @ApiOperation(value = "Asymmetric Encrypt data using certificate file", response = EncryptionResponseDto.class) - public String asymmetricEncryptionForCertFile(@RequestBody String data, - @RequestParam(name = "certFileName", required = true) String certFileName, - @RequestParam(name = "certsDir", required = false) String certsDir, - @RequestParam(name = "moduleName", required = false) String moduleName) throws Exception { - return kernelAsymmetricEncryptForCertFile(data, certFileName, certsDir, moduleName); - } - - @PostMapping(path = "/asymmetricEncryptionForPublicKeyPEMFile") - @ApiOperation(value = "Asymmetric Encrypt data with public key PEM file", response = EncryptionResponseDto.class) - public String asymmetricEncryptionForPublicKeyPEMFile(@RequestBody String data, - @RequestParam(name = "publicKeyPEMFileName", required = true) String publicKeyPEMFileName, - @RequestParam(name = "keysDir", required = false) String keysDir, - @RequestParam(name = "moduleName", required = false) String moduleName) throws Exception { - return kernelAsymmetricEncryptForPublicKeyPEMFile(data, publicKeyPEMFileName, keysDir, moduleName); - } - - private String kernelAsymmetricEncryptForCertFile(String data, String certFileName, String certsDir, String moduleName) throws OperatorCreationException, IOException, GeneralSecurityException { - return keyMgrUtil.asymmetricEncryptionForCert(data.getBytes(), certFileName, certsDir, moduleName); - } - - private String kernelAsymmetricEncryptForPublicKeyPEMFile(String data, String publicKeyPEMFile, String certsDir, String moduleName) throws OperatorCreationException, IOException, GeneralSecurityException { - return keyMgrUtil.asymmetricEncryptionForPemFile(data.getBytes(), publicKeyPEMFile, certsDir, moduleName); - } - - /** - * this method is used to call Kernel encrypt api. - * - * @param encryptionRequestDto the encryption request dto - * @param isInternal the is internal - * @return the encryption response dto - * @throws Exception - */ - private EncryptionResponseDto kernelEncrypt(EncryptionRequestDto encryptionRequestDto, String refId) - throws Exception { - String identityBlock = objMapper.writeValueAsString(encryptionRequestDto.getIdentityRequest()); - SecretKey secretKey = cryptoUtil.genSecKey(); - EncryptionResponseDto encryptionResponseDto = new EncryptionResponseDto(); - byte[] encryptedIdentityBlock = cryptoUtil.symmetricEncrypt(identityBlock.getBytes(StandardCharsets.UTF_8), - secretKey); - encryptionResponseDto.setEncryptedIdentity(Base64.encodeBase64URLSafeString(encryptedIdentityBlock)); - X509Certificate x509Cert = getCertificate(refId); - PublicKey publicKey = x509Cert.getPublicKey(); - byte[] encryptedSessionKeyByte = cryptoUtil.asymmetricEncrypt((secretKey.getEncoded()), publicKey); - encryptionResponseDto.setEncryptedSessionKey(Base64.encodeBase64URLSafeString(encryptedSessionKeyByte)); - byte[] byteArr = cryptoUtil.symmetricEncrypt(Encrypt - .digestAsPlainText(HMACUtils2.generateHash(identityBlock.getBytes(StandardCharsets.UTF_8))).getBytes(), - secretKey); - encryptionResponseDto.setRequestHMAC(Base64.encodeBase64URLSafeString(byteArr)); - return encryptionResponseDto; - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - @PostMapping(path = "/encryptBiometricValue") - - public SplittedEncryptedData encryptBiometrics(@RequestBody String bioValue, - @RequestParam(name = "timestamp", required = false) @Nullable String timestamp, - @RequestParam(name = "transactionId", required = false) @Nullable String transactionId, - @RequestParam(name = "isInternal", required = false) @Nullable boolean isInternal) - throws Exception { - RestTemplate restTemplate = createRestTemplate(); - - byte[] xorBytes = BytesUtil.getXOR(timestamp, transactionId); - byte[] saltLastBytes = BytesUtil.getLastBytes(xorBytes, env.getProperty( - IdAuthConfigKeyConstants.IDA_SALT_LASTBYTES_NUM, Integer.class, DEFAULT_SALT_LAST_BYTES_NUM)); - String salt = CryptoUtil.encodeToURLSafeBase64(saltLastBytes); - byte[] aadLastBytes = BytesUtil.getLastBytes(xorBytes, env.getProperty( - IdAuthConfigKeyConstants.IDA_AAD_LASTBYTES_NUM, Integer.class, DEFAULT_AAD_LAST_BYTES_NUM)); - String aad = CryptoUtil.encodeToURLSafeBase64(aadLastBytes); - - CryptomanagerRequestDto request = new CryptomanagerRequestDto(); - request.setApplicationId(appID); - request.setSalt(salt); - request.setAad(aad); - request.setReferenceId(getRefId(isInternal, true)); - request.setData(bioValue); - request.setTimeStamp(timestamp); - - HttpEntity> httpEntity = new HttpEntity<>(createRequest(request)); - ResponseEntity response = restTemplate.exchange(encryptURL, HttpMethod.POST, httpEntity, Map.class); - - if (response.getStatusCode() == HttpStatus.OK) { - String responseData = (String) ((Map) response.getBody().get("response")).get("data"); - SplittedEncryptedData splitedEncryptedData = splitEncryptedData(responseData); - return splitedEncryptedData; - } - return null; - } - - public RestTemplate createRestTemplate() throws NoSuchAlgorithmException, KeyManagementException { - Encrypt.turnOffSslChecking(); - RestTemplate restTemplate = new RestTemplate(); - ClientHttpRequestInterceptor interceptor = new ClientHttpRequestInterceptor() { - - @Override - public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) - throws IOException { - String authToken = generateAuthToken(); - if (authToken != null && !authToken.isEmpty()) { - request.getHeaders().set("Cookie", "Authorization=" + authToken); - } - return execution.execute(request, body); - } - }; - - restTemplate.setInterceptors(Collections.singletonList(interceptor)); - return restTemplate; - } - - /** - * Creates the request. - * - * @param the generic type - * @param t the t - * @return the request wrapper - */ - public static RequestWrapper createRequest(T t) { - RequestWrapper request = new RequestWrapper<>(); - request.setRequest(t); - request.setId("ida"); - request.setRequesttime(DateUtils.getUTCCurrentDateTime()); - return request; - } - - @PostMapping(path = "/splitEncryptedData", produces = MediaType.APPLICATION_JSON_VALUE) - public SplittedEncryptedData splitEncryptedData(@RequestBody String data) throws Exception { - boolean encryptedDataHasVersion = env.getProperty("encryptedDataHasVersion", boolean.class, false); - byte[] dataBytes = CryptoUtil.decodeURLSafeBase64(data); - byte[][] splits = splitAtFirstOccurance(dataBytes, keySplitter.getBytes()); - byte[] thumbPrintAndSessionKey = splits[0]; - byte[] sessionKey; - byte[] thumbPrint; - - if (thumbPrintAndSessionKey.length >= 288) { - thumbPrint = Arrays.copyOfRange(thumbPrintAndSessionKey, thumbPrintAndSessionKey.length - 288, - thumbPrintAndSessionKey.length - 256);// Skip the 6 bytes version and take 32 bytes - sessionKey = Arrays.copyOfRange(thumbPrintAndSessionKey, thumbPrintAndSessionKey.length - 256, - thumbPrintAndSessionKey.length); - } - else { - throw new Exception("Invalid Encrypted Session Key"); } - - byte[] encryptedData = splits[1]; - return new SplittedEncryptedData(CryptoUtil.encodeToURLSafeBase64(sessionKey), CryptoUtil.encodeToURLSafeBase64(encryptedData), digestAsPlainText(thumbPrint)); - } - - @PostMapping(path = "/combineDataToEncrypt", consumes = MediaType.APPLICATION_JSON_VALUE) - public String combineDataToEncrypt(@RequestBody SplittedEncryptedData splittedData) { - return CryptoUtil - .encodeToURLSafeBase64(CryptoUtil.combineByteArray(CryptoUtil.decodeURLSafeBase64(splittedData.getEncryptedData()), - CryptoUtil.decodeURLSafeBase64(splittedData.getEncryptedSessionKey()), keySplitter)); - } - - private static byte[][] splitAtFirstOccurance(byte[] strBytes, byte[] sepBytes) { - int index = findIndex(strBytes, sepBytes); - if (index >= 0) { - byte[] bytes1 = new byte[index]; - byte[] bytes2 = new byte[strBytes.length - (bytes1.length + sepBytes.length)]; - System.arraycopy(strBytes, 0, bytes1, 0, bytes1.length); - System.arraycopy(strBytes, (bytes1.length + sepBytes.length), bytes2, 0, bytes2.length); - return new byte[][] { bytes1, bytes2 }; - } else { - return new byte[][] { strBytes, new byte[0] }; - } - } - - private static int findIndex(byte arr[], byte[] subarr) { - int len = arr.length; - int subArrayLen = subarr.length; - return IntStream.range(0, len).filter(currentIndex -> { - if ((currentIndex + subArrayLen) <= len) { - byte[] sArray = new byte[subArrayLen]; - System.arraycopy(arr, currentIndex, sArray, 0, subArrayLen); - return Arrays.equals(sArray, subarr); - } - return false; - }).findFirst() // first occurence - .orElse(-1); // No element found - } - - /** - * Gets the encrypted value. - * - * @param data the data - * @param isInternal the is internal - * @return the encrypted value - * @throws IOException Signals that an I/O exception has occurred. - * @throws KeyManagementException the key management exception - * @throws NoSuchAlgorithmException the no such algorithm exception - * @throws RestClientException the rest client exception - * @throws JSONException the JSON exception - * @throws CertificateException - */ - @SuppressWarnings({ "unchecked", "rawtypes" }) - public X509Certificate getCertificate(String refId) throws IOException, KeyManagementException, - NoSuchAlgorithmException, RestClientException, JSONException, CertificateException { - turnOffSslChecking(); - RestTemplate restTemplate = new RestTemplate(); - ClientHttpRequestInterceptor interceptor = new ClientHttpRequestInterceptor() { - - @Override - public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) - throws IOException { - String authToken = generateAuthToken(); - if (authToken != null && !authToken.isEmpty()) { - request.getHeaders().set("Cookie", "Authorization=" + authToken); - } - return execution.execute(request, body); - } - }; - - restTemplate.setInterceptors(Collections.singletonList(interceptor)); - - Map uriParams = new HashMap<>(); - UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(publicKeyURL) - .queryParam("applicationId", appID).queryParam("referenceId", refId); - ResponseEntity response = restTemplate.exchange(builder.build(uriParams), HttpMethod.GET, null, Map.class); - String certificate = (String) ((Map) response.getBody().get("response")).get("certificate"); - - certificate = JWSSignAndVerifyController.trimBeginEnd(certificate); - CertificateFactory cf = CertificateFactory.getInstance("X.509"); - X509Certificate x509cert = (X509Certificate) cf - .generateCertificate(new ByteArrayInputStream(java.util.Base64.getDecoder().decode(certificate))); - return x509cert; - } - - public String getRefId(boolean isInternal, boolean isBiometrics) { - String refId; - if (isBiometrics) { - if (isInternal) { - refId = env.getProperty(IdAuthConfigKeyConstants.INTERNAL_BIO_REFERENCE_ID); - } else { - refId = env.getProperty(IdAuthConfigKeyConstants.PARTNER_BIO_REFERENCE_ID); - } - } else { - if (isInternal) { - refId = env.getProperty(IdAuthConfigKeyConstants.INTERNAL_REFERENCE_ID); - } else { - refId = env.getProperty(IdAuthConfigKeyConstants.PARTNER_REFERENCE_ID); - } - } - return refId; - } - - /** - * Generate auth token. - * - * @return the string - */ - private String generateAuthToken() { - ObjectNode requestBody = objMapper.createObjectNode(); - requestBody.put("clientId", env.getProperty("auth-token-generator.rest.clientId")); - requestBody.put("secretKey", env.getProperty("auth-token-generator.rest.secretKey")); - requestBody.put("appId", env.getProperty("auth-token-generator.rest.appId")); - RequestWrapper request = new RequestWrapper<>(); - request.setRequesttime(DateUtils.getUTCCurrentDateTime()); - request.setRequest(requestBody); - ClientResponse response = WebClient.create(env.getProperty("auth-token-generator.rest.uri")).post() - .syncBody(request).exchange().block(); - logger.info("sessionID", "IDA", "ENCRYPT", - "AuthResponse :" + response.toEntity(String.class).block().getBody()); - List list = response.cookies().get("Authorization"); - if (list != null && !list.isEmpty()) { - ResponseCookie responseCookie = list.get(0); - return responseCookie.getValue(); - } - return ""; - } - - /** - * Gets the headers. - * - * @param req the req - * @return the headers - */ - @SuppressWarnings("unused") - private HttpEntity getHeaders(CryptomanagerRequestDto req) { - HttpHeaders headers = new HttpHeaders(); - headers.set("Accept", MediaType.APPLICATION_JSON_VALUE); - return new HttpEntity(req, headers); - } - - @PostMapping(path = "/prependThumbprintToDecrypt", consumes = MediaType.APPLICATION_JSON_VALUE) - public String prependThumbprintToDecrypt(@RequestBody SplittedData splittedData) { - return CryptoUtil.encodeToURLSafeBase64( - ArrayUtils.addAll(CryptoUtil.decodeURLSafeBase64(splittedData.getThumbprint()), CryptoUtil.decodeURLSafeBase64(splittedData.getEncryptedData()))); - } - - /** - * The Constant UNQUESTIONING_TRUST_MANAGER nullifies the check for certificates - * for SSL Connection - */ - private static final TrustManager[] UNQUESTIONING_TRUST_MANAGER = new TrustManager[] { new X509TrustManager() { - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return null; - } - - public void checkClientTrusted(java.security.cert.X509Certificate[] arg0, String arg1) - throws CertificateException { - } - - public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String arg1) - throws CertificateException { - } - } }; - - /** - * Turns off the ssl checking. - * - * @throws NoSuchAlgorithmException the no such algorithm exception - * @throws KeyManagementException the key management exception - */ - public static void turnOffSslChecking() throws NoSuchAlgorithmException, KeyManagementException { - // Install the all-trusting trust manager - final SSLContext sc = SSLContext.getInstance(Encrypt.SSL); - sc.init(null, UNQUESTIONING_TRUST_MANAGER, null); - HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); - } - - public static class SplittedEncryptedData { - private String encryptedSessionKey; - private String encryptedData; - private String thumbprint; - - public SplittedEncryptedData() { - super(); - } - - public SplittedEncryptedData(String encryptedSessionKey, String encryptedData) { - super(); - this.encryptedData = encryptedData; - this.encryptedSessionKey = encryptedSessionKey; - } - - public SplittedEncryptedData(String encryptedSessionKey, String encryptedData, String thumbprint) { - super(); - this.encryptedData = encryptedData; - this.encryptedSessionKey = encryptedSessionKey; - this.thumbprint = thumbprint; - } - - public String getEncryptedData() { - return encryptedData; - } - - public void setEncryptedData(String encryptedData) { - this.encryptedData = encryptedData; - } - - public String getEncryptedSessionKey() { - return encryptedSessionKey; - } - - public void setEncryptedSessionKey(String encryptedSessionKey) { - this.encryptedSessionKey = encryptedSessionKey; - } - - public String getThumbprint() { - return thumbprint; - } - - public void setThumbprint(String thumbprint) { - this.thumbprint = thumbprint; - } - } - - public static String digestAsPlainText(byte[] data) { - return DatatypeConverter.printHexBinary(data).toUpperCase(); - } - - @Data - @NoArgsConstructor - @AllArgsConstructor - public static class SplittedData { - private String thumbprint; - private String encryptedData; - } - - public EncryptionResponseDto encrypt(EncryptionRequestDto encryptionRequestDto, boolean isInternal, String dirPath) throws CertificateException, IOException, - InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException { - X509Certificate x509Cert = isInternal ? getCertificate(dirPath, CertificateTypes.INTERNAL.getFileName()) : - getCertificate(dirPath, CertificateTypes.PARTNER.getFileName()); - - return kernelEncrypt(encryptionRequestDto, x509Cert); - } - - private EncryptionResponseDto kernelEncrypt(EncryptionRequestDto encryptionRequestDto, X509Certificate x509Cert) throws JsonProcessingException, NoSuchAlgorithmException, - InvalidKeyException, NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException { - String identityBlock = objMapper.writeValueAsString(encryptionRequestDto.getIdentityRequest()); - SecretKey secretKey = cryptoUtil.genSecKey(); - EncryptionResponseDto encryptionResponseDto = new EncryptionResponseDto(); - byte[] encryptedIdentityBlock = cryptoUtil.symmetricEncrypt(identityBlock.getBytes(StandardCharsets.UTF_8), - secretKey); - encryptionResponseDto.setEncryptedIdentity(Base64.encodeBase64URLSafeString(encryptedIdentityBlock)); - PublicKey publicKey = x509Cert.getPublicKey(); - byte[] encryptedSessionKeyByte = cryptoUtil.asymmetricEncrypt((secretKey.getEncoded()), publicKey); - encryptionResponseDto.setEncryptedSessionKey(Base64.encodeBase64URLSafeString(encryptedSessionKeyByte)); - byte[] byteArr = cryptoUtil.symmetricEncrypt(Encrypt - .digestAsPlainText(HMACUtils2.generateHash(identityBlock.getBytes(StandardCharsets.UTF_8))).getBytes(), - secretKey); - encryptionResponseDto.setRequestHMAC(Base64.encodeBase64URLSafeString(byteArr)); - return encryptionResponseDto; - } - - private X509Certificate getCertificate(String dirPath, String fileName) throws CertificateException, IOException { - Path path = Paths.get(dirPath + "/" + fileName); - if (!Files.exists(path)){ - throw new FileNotFoundException("Certificate File Not found in temp directory. FileName: " + fileName); - } - String certificateData = Files.readString(path); - return (X509Certificate) keyMgrUtil.convertToCertificate(certificateData); - } - - public SplittedEncryptedData encryptBio(String bioValue, String timestamp, String transactionId, boolean isInternal, String dirPath) - throws KeyManagementException, NoSuchAlgorithmException, IOException, JSONException, InvalidKeyException, - NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException, - InvalidKeySpecException, CertificateException { - - X509Certificate x509Cert = isInternal ? getCertificate(dirPath, CertificateTypes.INTERNAL.getFileName()) : - getCertificate(dirPath, CertificateTypes.IDA_FIR.getFileName()); - - byte[] xorBytes = BytesUtil.getXOR(timestamp, transactionId); - byte[] saltLastBytes = BytesUtil.getLastBytes(xorBytes, env.getProperty( - IdAuthConfigKeyConstants.IDA_SALT_LASTBYTES_NUM, Integer.class, DEFAULT_SALT_LAST_BYTES_NUM)); - byte[] aadLastBytes = BytesUtil.getLastBytes(xorBytes, env.getProperty( - IdAuthConfigKeyConstants.IDA_AAD_LASTBYTES_NUM, Integer.class, DEFAULT_AAD_LAST_BYTES_NUM)); - - SecretKey secretKey = cryptoUtil.genSecKey(); - byte[] encryptedBioBlock = cryptoUtil.symmetricEncrypt(CryptoUtil.decodePlainBase64(bioValue), - secretKey, saltLastBytes, aadLastBytes); - - PublicKey publicKey = x509Cert.getPublicKey(); - byte[] encryptedSessionKeyByte = cryptoUtil.asymmetricEncrypt(secretKey.getEncoded(), publicKey); - return new SplittedEncryptedData(CryptoUtil.encodeToURLSafeBase64(encryptedSessionKeyByte), CryptoUtil.encodeToURLSafeBase64(encryptedBioBlock)); - - } - - public X509Certificate getCertificate(boolean isInternal, String dirPath) throws CertificateException, IOException { - - return isInternal ? getCertificate(dirPath, CertificateTypes.INTERNAL.getFileName()) : - getCertificate(dirPath, CertificateTypes.PARTNER.getFileName()); - } - - public X509Certificate getBioCertificate(boolean isInternal, String dirPath) throws CertificateException, IOException { - - return isInternal ? getCertificate(dirPath, CertificateTypes.INTERNAL.getFileName()) : - getCertificate(dirPath, CertificateTypes.IDA_FIR.getFileName()); - } - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/JWSSignAndVerifyController.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/JWSSignAndVerifyController.java deleted file mode 100644 index fc1a7d1561..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/JWSSignAndVerifyController.java +++ /dev/null @@ -1,355 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.controller; - -import java.io.BufferedReader; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; -import java.security.KeyManagementException; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.PrivateKey; -import java.security.UnrecoverableEntryException; -import java.security.KeyStore.PrivateKeyEntry; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; -import java.security.spec.InvalidKeySpecException; -import java.util.Collections; -import java.util.List; -import java.util.Objects; - -import javax.ws.rs.core.MediaType; - -import org.bouncycastle.operator.OperatorCreationException; -import org.jose4j.jws.JsonWebSignature; -import org.jose4j.lang.JoseException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.core.env.Environment; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpRequest; -import org.springframework.http.ResponseCookie; -import org.springframework.http.ResponseEntity; -import org.springframework.http.client.ClientHttpRequestExecution; -import org.springframework.http.client.ClientHttpRequestInterceptor; -import org.springframework.http.client.ClientHttpResponse; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.reactive.function.client.ClientResponse; -import org.springframework.web.reactive.function.client.WebClient; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; - -import io.mosip.kernel.core.http.RequestWrapper; -import io.mosip.kernel.core.http.ResponseWrapper; -import io.mosip.kernel.core.util.CryptoUtil; -import io.mosip.kernel.core.util.DateUtils; -import io.mosip.kernel.crypto.jce.core.CryptoCore; -import io.mosip.kernel.signature.dto.JWTSignatureRequestDto; -import io.mosip.kernel.signature.dto.JWTSignatureResponseDto; -import io.mosip.testrig.authentication.demo.service.helper.KeyMgrUtil; -import io.mosip.testrig.authentication.demo.service.helper.PartnerTypes; -import io.swagger.annotations.Api; -import lombok.Data; - -// -/** - * @author Sanjay Murali The Class JWSSignAndVerifyController is used to - * digitally sign the request. - */ -@RestController -@Api(tags = { "JWS Signature" }) -public class JWSSignAndVerifyController { - - @Autowired - private CryptoCore cryptoCore; - - /** The sign applicationid. */ - @Value("${mosip.sign.applicationid:KERNEL}") - private String signApplicationid; - - /** The sign refid. */ - @Value("${mosip.sign.refid:SIGN}") - private String signRefid; - - /** The obj mapper. */ - @Autowired - private ObjectMapper objMapper; - - @Autowired - private Environment env; - - private static final String SIGN_ALGO = "RS256"; - - @Autowired - KeyMgrUtil keyMgrUtil; - - /** - * Sign. - * - * @param data the data - * @return the string - * @throws KeyStoreException the key store exception - * @throws NoSuchAlgorithmException the no such algorithm exception - * @throws CertificateException the certificate exception - * @throws IOException Signals that an I/O exception has - * occurred. - * @throws UnrecoverableEntryException the unrecoverable entry exception - * @throws JoseException the jose exception - * @throws InvalidKeySpecException the invalid key spec exception - * @throws KeyManagementException - * @throws UnsupportedEncodingException - */ - @PostMapping(path = "/sign", consumes = MediaType.TEXT_PLAIN, produces = MediaType.TEXT_PLAIN) - public String sign(@RequestBody String data, boolean isPayloadRequired) - throws KeyManagementException, NoSuchAlgorithmException, UnsupportedEncodingException { - Encrypt.turnOffSslChecking(); - RestTemplate restTemplate = new RestTemplate(); - ClientHttpRequestInterceptor interceptor = new ClientHttpRequestInterceptor() { - - @Override - public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) - throws IOException { - String authToken = generateAuthToken(); - if (authToken != null && !authToken.isEmpty()) { - request.getHeaders().set("Cookie", "Authorization=" + authToken); - } - return execution.execute(request, body); - } - }; - - restTemplate.setInterceptors(Collections.singletonList(interceptor)); - - JWTSignatureRequestDto request = new JWTSignatureRequestDto(); - request.setApplicationId("IDA"); - request.setDataToSign(CryptoUtil.encodeToURLSafeBase64(data.getBytes("UTF-8"))); - request.setIncludeCertHash(true); - request.setIncludeCertificate(true); - request.setIncludePayload(isPayloadRequired); - request.setReferenceId(signRefid); - RequestWrapper requestWrapper = new RequestWrapper<>(); - requestWrapper.setRequest(request); - HttpEntity> requestEntity = new HttpEntity<>(requestWrapper); - ResponseEntity> exchange = restTemplate.exchange( - env.getProperty("ida.internal.jwtSign.url"), HttpMethod.POST, requestEntity, - new ParameterizedTypeReference>() { - }); - return exchange.getBody().getResponse().getJwtSignedData(); -// FileInputStream pkeyfis = new FileInputStream("lib/Keystore/PrivateKey.pem"); -// String pKey = getFileContent(pkeyfis, "UTF-8"); -// FileInputStream certfis = new FileInputStream("lib/Keystore/MosipTestCert.pem"); -// String cert = getFileContent(certfis, "UTF-8"); -// pKey = trimBeginEnd(pKey); -// cert = trimBeginEnd(cert); -// CertificateFactory cf = CertificateFactory.getInstance("X.509"); -// X509Certificate certificate = (X509Certificate) cf.generateCertificate(new ByteArrayInputStream(Base64.getDecoder().decode(cert))); -// KeyFactory kf = KeyFactory.getInstance("RSA"); -// PrivateKey privateKey = kf.generatePrivate(new PKCS8EncodedKeySpec(Base64.getDecoder().decode(pKey))); -// -// return cryptoCore.sign(data.getBytes("UTF-8"), privateKey, certificate); - - } - - private String generateAuthToken() { - ObjectNode requestBody = objMapper.createObjectNode(); - requestBody.put("clientId", env.getProperty("auth-token-generator.rest.clientId")); - requestBody.put("secretKey", env.getProperty("auth-token-generator.rest.secretKey")); - requestBody.put("appId", env.getProperty("auth-token-generator.rest.appId")); - RequestWrapper request = new RequestWrapper<>(); - request.setRequesttime(DateUtils.getUTCCurrentDateTime()); - request.setRequest(requestBody); - ClientResponse response = WebClient.create(env.getProperty("auth-token-generator.rest.uri")).post() - .syncBody(request).exchange().block(); - List list = response.cookies().get("Authorization"); - if (list != null && !list.isEmpty()) { - ResponseCookie responseCookie = list.get(0); - return responseCookie.getValue(); - } - return ""; - } - - public static String trimBeginEnd(String pKey) { - pKey = pKey.replaceAll("-*BEGIN([^-]*)-*(\r?\n)?", ""); - pKey = pKey.replaceAll("-*END([^-]*)-*(\r?\n)?", ""); - pKey = pKey.replaceAll("\\s", ""); - return pKey; - } - - /** - * Sign. - * - * @param data the data - * @return the string - * @throws KeyStoreException the key store exception - * @throws NoSuchAlgorithmException the no such algorithm exception - * @throws CertificateException the certificate exception - * @throws IOException Signals that an I/O exception has - * occurred. - * @throws UnrecoverableEntryException the unrecoverable entry exception - * @throws JoseException the jose exception - * @throws InvalidKeySpecException the invalid key spec exception - */ - @PostMapping(path = "/verify", consumes = MediaType.TEXT_PLAIN, produces = MediaType.APPLICATION_JSON) - public SignatureStatus verify(@RequestBody String jwsSignature) throws KeyStoreException, NoSuchAlgorithmException, - CertificateException, IOException, UnrecoverableEntryException, JoseException, InvalidKeySpecException { - SignatureStatus status = new SignatureStatus(); - if (cryptoCore.verifySignature(jwsSignature)) { - status.setStatus("VALID"); - status.setPayload(getPayloadFromJwsSingature(jwsSignature)); - } else { - status.setStatus("INVALID"); - } - return status; - } - - @PostMapping(path = "/getSplittedPayloadSectionFromJWS", consumes = MediaType.TEXT_PLAIN, produces = MediaType.TEXT_PLAIN) - public String getSplittedPayloadSectionFromJwsSingature(@RequestBody String jws) { - String[] split = jws.split("\\."); - if (split.length >= 2) { - return split[1]; - } - return jws; - } - - @PostMapping(path = "/getPayloadFromJWS", consumes = MediaType.TEXT_PLAIN, produces = MediaType.TEXT_PLAIN) - public String getPayloadFromJwsSingature(@RequestBody String jws) { - return new String(CryptoUtil.decodeURLSafeBase64(getSplittedPayloadSectionFromJwsSingature(jws))); - } - - /** - * Gets the file content. - * - * @param fis the fis - * @param encoding the encoding - * @return the file content - * @throws IOException Signals that an I/O exception has occurred. - */ - public static String getFileContent(FileInputStream fis, String encoding) throws IOException { - try (BufferedReader br = new BufferedReader(new InputStreamReader(fis, encoding))) { - StringBuilder sb = new StringBuilder(); - String line; - while ((line = br.readLine()) != null) { - sb.append(line); - sb.append('\n'); - } - return sb.toString(); - } - } - - /* - * private String dynamicCertificateAndSign(String data) throws IOException, - * NoSuchAlgorithmException, CertificateException, InvalidKeyException, - * NoSuchProviderException, SignatureException, CertificateParsingException, - * CertificateEncodingException, JoseException { String commonName = "sanz"; - * String organizationalUnit = " Hi-Tech World"; String organization = - * "XYZ Limited"; String country = "india"; - * - * int keySize = 2048; int validDays = 9999; X500Name distinguishedName = new - * X500Name(commonName, organizationalUnit, organization, country); KeyPair kp = - * generateRSAKeyPair(keySize); - * - * PrivateKey privkey = kp.getPrivate(); X509CertInfo info = new X509CertInfo(); - * - * Date since = new Date(); // Since Now Date until = new Date(since.getTime() + - * validDays * 86400000l); // Until x days (86400000 milliseconds in one // day) - * - * CertificateValidity interval = new CertificateValidity(since, until); - * BigInteger sn = new BigInteger(64, new SecureRandom()); - * - * info.set(X509CertInfo.VALIDITY, interval); - * info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn)); - * info.set(X509CertInfo.SUBJECT, distinguishedName); - * info.set(X509CertInfo.ISSUER, distinguishedName); info.set(X509CertInfo.KEY, - * new CertificateX509Key(kp.getPublic())); info.set(X509CertInfo.VERSION, new - * CertificateVersion(CertificateVersion.V3)); - * - * AlgorithmId algo = new AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid); - * info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo)); - * - * // Sign the cert to identify the algorithm that is used. X509CertImpl cert = - * new X509CertImpl(info); cert.sign(privkey, "SHA1withRSA"); - * - * // Update the algorithm and sign again algo = (AlgorithmId) - * cert.get(X509CertImpl.SIG_ALG); info.set(CertificateAlgorithmId.NAME + "." + - * CertificateAlgorithmId.ALGORITHM, algo); - * - * cert = new X509CertImpl(info); cert.sign(privkey, "SHA1withRSA"); - * CertificateFactory cf = CertificateFactory.getInstance("X.509"); - * X509Certificate certificate = (X509Certificate) cf .generateCertificate(new - * ByteArrayInputStream(cert.getEncoded())); List certList = - * new ArrayList<>(); certList.add(certificate); X509Certificate[] certArray = - * certList.toArray(new X509Certificate[] {}); - * - * JsonWebSignature jws = new JsonWebSignature(); - * jws.setCertificateChainHeaderValue(certArray); - * jws.setAlgorithmHeaderValue(AlgorithmIdentifiers.RSA_USING_SHA256); byte[] - * emptyArray = new byte[0]; - * jws.setPayload(HMACUtils.digestAsPlainText(HMACUtils.generateHash(emptyArray) - * )); jws.setKey(kp.getPrivate()); - * - * return jws.getCompactSerialization(); } - * - * private static KeyPair generateRSAKeyPair(int keySize) throws - * NoSuchAlgorithmException { - * - * KeyPairGenerator kpg; - * - * kpg = KeyPairGenerator.getInstance("RSA"); kpg.initialize(keySize); - * - * KeyPair kp = kpg.genKeyPair(); - * - * return kp; } - */ - - @Data - public static class SignatureStatus { - private String status; - private String payload; - - } - - public String sign(String dataToSign, - boolean includePayload, - boolean includeCertificate, - boolean includeCertHash, - String certificateUrl, - String dirPath, - PartnerTypes partnerType, - String organizationName, - boolean keyFileNameByPartnerName) throws JoseException, NoSuchAlgorithmException, UnrecoverableEntryException, - KeyStoreException, CertificateException, IOException, OperatorCreationException { - - JsonWebSignature jwSign = new JsonWebSignature(); - PrivateKeyEntry keyEntry = keyMgrUtil.getKeyEntry(dirPath, partnerType, organizationName, - keyFileNameByPartnerName); - if (Objects.isNull(keyEntry)) { - throw new KeyStoreException("Key file not available for partner type: " + partnerType.toString()); - } - - PrivateKey privateKey = keyEntry.getPrivateKey(); - X509Certificate x509Certificate = (X509Certificate) keyEntry.getCertificate(); - if (includeCertificate) - jwSign.setCertificateChainHeaderValue(new X509Certificate[] { x509Certificate }); - - if (includeCertHash) - jwSign.setX509CertSha256ThumbprintHeaderValue(x509Certificate); - - if (Objects.nonNull(certificateUrl)) - jwSign.setHeader("x5u", certificateUrl); - - jwSign.setPayload(dataToSign); - jwSign.setAlgorithmHeaderValue(SIGN_ALGO); - jwSign.setKey(privateKey); - jwSign.setDoKeyValidation(false); - if (includePayload) - return jwSign.getCompactSerialization(); - - return jwSign.getDetachedContentCompactSerialization(); - - } -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/SQLPerformanceController.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/SQLPerformanceController.java deleted file mode 100644 index e70f2080ef..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/SQLPerformanceController.java +++ /dev/null @@ -1,82 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.controller; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.ResultSetMetaData; -import java.sql.SQLException; -import java.sql.Statement; -import java.time.Duration; -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import io.mosip.authentication.core.logger.IdaLogger; -import io.mosip.kernel.core.logger.spi.Logger; -import io.mosip.testrig.authentication.demo.service.helper.DBUtil; -import io.swagger.annotations.Api; - -@RestController -@Api(tags = { "SQL Performance" }) -public class SQLPerformanceController { - - /** The logger. */ - private static Logger logger = IdaLogger.getLogger(SQLPerformanceController.class); - - @Autowired - private DBUtil dbUtil; - - @PostMapping(path = "/selectQueryWithTime", consumes = MediaType.TEXT_PLAIN_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public Map selectQueryWithTime(@RequestBody String sqlQuery, - @RequestParam(name = "dbName", required = false, defaultValue=DBUtil.IDA) String dbName) { - - String jdbcUrl = dbUtil.getDbUrl(dbName); - String username = dbUtil.getDbUser(dbName); - String password = dbUtil.getDbPass(dbName); - - try (Connection conn = DriverManager.getConnection(jdbcUrl, username, password); - Statement stmt = conn.createStatement(); - ) { - LocalDateTime start = LocalDateTime.now(); - try( - ResultSet resultSet = stmt.executeQuery(sqlQuery);) { - LocalDateTime end = LocalDateTime.now(); - - HashMap responseMap = new HashMap<>(); - List> resultSetToList = resultSetToList(resultSet); - responseMap.put("ResultSet", resultSetToList); - responseMap.put("QueryTimeMilliSeconds", Duration.between(start, end).toMillis()); - return responseMap; - } - } catch (SQLException e) { - logger.info("sessionID", "IDA", "selectQueryWithTime", "SQLException :" + e.getMessage()); - HashMap responseMap = new HashMap<>(); - responseMap.put("ErrorResult", e.getMessage()); - return responseMap; - } - } - - private List> resultSetToList(ResultSet rs) throws SQLException { - ResultSetMetaData md = rs.getMetaData(); - int columns = md.getColumnCount(); - List> rows = new ArrayList>(); - while (rs.next()) { - Map row = new HashMap(columns); - for (int i = 1; i <= columns; ++i) { - row.put(md.getColumnName(i), rs.getObject(i)); - } - rows.add(row); - } - return rows; - } - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/SignatureController.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/SignatureController.java deleted file mode 100644 index 6279be6519..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/SignatureController.java +++ /dev/null @@ -1,85 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.controller; - -import java.io.IOException; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import java.util.Collections; -import java.util.Map; -import java.util.Objects; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpRequest; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.http.client.ClientHttpRequestExecution; -import org.springframework.http.client.ClientHttpRequestInterceptor; -import org.springframework.http.client.ClientHttpResponse; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.client.RestTemplate; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.mosip.authentication.core.constant.IdAuthCommonConstants; -import io.mosip.kernel.core.http.RequestWrapper; -import io.mosip.kernel.core.util.DateUtils; -import io.mosip.testrig.authentication.demo.service.dto.ValidateSignRequestDto; -import io.swagger.annotations.Api; - -@RestController -@Api(tags = { "Digital Signature" }) -public class SignatureController { - - @Autowired - ObjectMapper mapper; - - @Autowired - Decrypt decrypt; - - /** The encrypt URL. */ - @Value("${mosip.ida.validate.signature-url}") - private String validateSignUrl; - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @PostMapping(path = "/validateSign",consumes=MediaType.APPLICATION_JSON_VALUE) - public String validateSign(@RequestParam String signature, - @RequestBody Map data) throws KeyManagementException, NoSuchAlgorithmException, JsonProcessingException { - ValidateSignRequestDto validateSignRequestDto = new ValidateSignRequestDto(); - validateSignRequestDto.setData(mapper.writeValueAsString(data)); - validateSignRequestDto.setSignature(signature); - validateSignRequestDto.setTimestamp(DateUtils.getUTCCurrentDateTime()); - - Encrypt.turnOffSslChecking(); - RestTemplate restTemplate = new RestTemplate(); - ClientHttpRequestInterceptor interceptor = new ClientHttpRequestInterceptor() { - - @Override - public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) - throws IOException { - String authToken = decrypt.generateAuthToken(); - if(authToken != null && !authToken.isEmpty()) { - request.getHeaders().set("Cookie", "Authorization=" + authToken); - } - return execution.execute(request, body); - } - }; - - restTemplate.setInterceptors(Collections.singletonList(interceptor)); - - HttpEntity> httpEntity = new HttpEntity<>(Decrypt.createRequest(validateSignRequestDto)); - ResponseEntity response = restTemplate.exchange(validateSignUrl, HttpMethod.POST, httpEntity, Map.class); - if(response.getStatusCode() == HttpStatus.OK && response.getBody().containsKey(IdAuthCommonConstants.RESPONSE) - && Objects.nonNull(response.getBody().get(IdAuthCommonConstants.RESPONSE))) { - return (String) ((Map) response.getBody().get(IdAuthCommonConstants.RESPONSE)).get(IdAuthCommonConstants.STATUS); - } - return "failure"; - } - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Test.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Test.java deleted file mode 100644 index b89bcc14a6..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/Test.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.controller; - -import java.nio.charset.Charset; - -public class Test { - - public static void main(String[] args) { - System.out.println(Charset.defaultCharset()); - - } - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/WebSub.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/WebSub.java deleted file mode 100644 index 79ea81dbf7..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/controller/WebSub.java +++ /dev/null @@ -1,127 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.controller; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.support.ServletUriComponentsBuilder; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.mosip.kernel.core.http.ResponseWrapper; -import io.mosip.kernel.core.websub.spi.PublisherClient; -import io.mosip.kernel.core.websub.spi.SubscriptionClient; -import io.mosip.kernel.websub.api.annotation.PreAuthenticateContentAndVerifyIntent; -import io.mosip.kernel.websub.api.model.SubscriptionChangeRequest; -import io.mosip.kernel.websub.api.model.SubscriptionChangeResponse; -import io.mosip.kernel.websub.api.model.UnsubscriptionRequest; -import io.mosip.testrig.authentication.demo.service.dto.EventModel; - -@RestController -public class WebSub { - - @Autowired - private PublisherClient pb; - - @Value("${websub.publisher.url}") - private String publisherUrl; - - @Autowired - SubscriptionClient sb; - - @Value("${websub.hub.url}") - private String hubUrl; - - @Autowired - private ObjectMapper objectMapper; - - @Value("${websub.secret}") - private String webSubSecret; - - @PostMapping(path = "/registerTopicToPublish", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseWrapper registerTopicToPublish(@RequestParam(name = "topic", required = true) String topic) { - ResponseWrapper responseWrapper = new ResponseWrapper<>(); - - pb.registerTopic(topic, publisherUrl); - - responseWrapper.setResponse("Registered topic for Publishing: " + topic); - - return responseWrapper; - } - - @PostMapping(path = "/unregisterTopicToPublish", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseWrapper unregisterTopicToPublish(@RequestParam(name = "topic", required = true) String topic) { - ResponseWrapper responseWrapper = new ResponseWrapper<>(); - - pb.unregisterTopic(topic, publisherUrl); - - responseWrapper.setResponse("Unregistered topic for Publishing: " + topic); - - return responseWrapper; - } - - @PostMapping(path = "/publish", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseWrapper publish(@RequestBody EventModel body, - @RequestParam(name = "topic", required = true) String topic) { - ResponseWrapper responseWrapper = new ResponseWrapper<>(); - - //pb.registerTopic(topic, publisherUrl); - - pb.publishUpdate(topic, body, MediaType.APPLICATION_JSON_UTF8_VALUE, new HttpHeaders(), publisherUrl); - - //pb.unregisterTopic(topic, publisherUrl); - - responseWrapper.setResponse("Published for topic: " + topic); - - return responseWrapper; - } - - @PostMapping(value = "/callback", consumes = "application/json") - @PreAuthenticateContentAndVerifyIntent(secret = "Kslk30SNF2AChs2", callback = "/callback", topic = "mytopic1") - public void printPost(@RequestBody EventModel body) { - try { - System.out.println(objectMapper.writeValueAsString(body)); - } catch (JsonProcessingException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - @PostMapping(path = "/subscribe", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseWrapper subscribe(@RequestParam(name = "topic", required = true) String topic) { - ResponseWrapper responseWrapper = new ResponseWrapper<>(); - final String baseUrl = - ServletUriComponentsBuilder.fromCurrentContextPath().build().toUriString(); - SubscriptionChangeRequest subscriptionRequest = new SubscriptionChangeRequest(); - subscriptionRequest.setCallbackURL(baseUrl + "/callback"); - subscriptionRequest.setHubURL(hubUrl); - subscriptionRequest.setSecret(webSubSecret); - subscriptionRequest.setTopic(topic); - sb.subscribe(subscriptionRequest); - - responseWrapper.setResponse("Subscribed for topic: " + topic); - - return responseWrapper; - } - - @PostMapping(path = "/unsubscribe", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseWrapper publish(@RequestParam(name = "topic", required = true) String topic) { - ResponseWrapper responseWrapper = new ResponseWrapper<>(); - - UnsubscriptionRequest subscriptionRequest = new UnsubscriptionRequest(); - subscriptionRequest.setCallbackURL("/callback"); - subscriptionRequest.setHubURL(hubUrl); - subscriptionRequest.setTopic(topic); - sb.unSubscribe(subscriptionRequest); - - responseWrapper.setResponse("Unsubscribed for topic: " + topic); - - return responseWrapper; - } - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/CertificateChainResponseDto.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/CertificateChainResponseDto.java deleted file mode 100644 index 48fdc9df2b..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/CertificateChainResponseDto.java +++ /dev/null @@ -1,9 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.dto; -import lombok.Data; - -@Data -public class CertificateChainResponseDto { - String caCertificate; - String interCertificate; - String partnerCertificate; -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/CryptomanagerRequestDto.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/CryptomanagerRequestDto.java deleted file mode 100644 index b367b6f5b2..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/CryptomanagerRequestDto.java +++ /dev/null @@ -1,14 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.dto; - -import lombok.Data; - -@Data -public class CryptomanagerRequestDto { - String applicationId; - String data; - String referenceId; - String salt; - String aad; - String timeStamp; - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/CryptomanagerResponseDto.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/CryptomanagerResponseDto.java deleted file mode 100644 index fe4af031aa..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/CryptomanagerResponseDto.java +++ /dev/null @@ -1,9 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.dto; - -import lombok.Data; - -@Data -public class CryptomanagerResponseDto { - String data; - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/EncryptedRequest.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/EncryptedRequest.java deleted file mode 100644 index 0a349b5348..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/EncryptedRequest.java +++ /dev/null @@ -1,9 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.dto; - -import lombok.Data; - -@Data -public class EncryptedRequest { - String key; - String data; -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/EncryptionRequestDto.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/EncryptionRequestDto.java deleted file mode 100644 index 5b4ceba574..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/EncryptionRequestDto.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.dto; - -import java.util.Map; - -import lombok.Data; - -@Data -public class EncryptionRequestDto { - - private Map identityRequest; - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/EncryptionResponseDto.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/EncryptionResponseDto.java deleted file mode 100644 index 969d4d3c47..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/EncryptionResponseDto.java +++ /dev/null @@ -1,10 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.dto; - -import lombok.Data; - -@Data -public class EncryptionResponseDto { - String encryptedSessionKey; - String encryptedIdentity; - String requestHMAC; -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/Event.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/Event.java deleted file mode 100644 index 4a2c5c06ca..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/Event.java +++ /dev/null @@ -1,23 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.dto; - -import java.util.Map; - -import lombok.Data; - -@Data -public class Event { - //uuid event id to be create and put in loggers - private String id; - - //request id - private String transactionId; - - private Type type; - - private String timestamp; - - private String dataShareUri; - - private Map data; - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/EventModel.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/EventModel.java deleted file mode 100644 index 368b4ce78a..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/EventModel.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.dto; - -import lombok.Data; - -@Data -public class EventModel { - - private String publisher; - private String topic; - private String publishedOn; - private Event event; -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/PublicKeyResponseDTO.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/PublicKeyResponseDTO.java deleted file mode 100644 index 0896a63479..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/PublicKeyResponseDTO.java +++ /dev/null @@ -1,49 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.dto; - -import java.time.LocalDateTime; - -import com.fasterxml.jackson.annotation.JsonIgnore; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * Response class for Public Key - * - * @author Arun Bose - * - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@ApiModel(description = "Class representing a Public Key Response") -public class PublicKeyResponseDTO { - - /** - * The string alias - */ - @JsonIgnore - private String alias; - - /** - * Field for public key - */ - @ApiModelProperty(notes = "Public key in BASE64 encoding format", required = true) - private T publicKey; - - /** - * Key creation time - */ - @ApiModelProperty(notes = "Timestamp of issuance of public key", required = true) - private LocalDateTime issuedAt; - - /** - * Key expiry time - */ - @ApiModelProperty(notes = "Timestamp of expiry of public key", required = true) - private LocalDateTime expiryAt; - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/Type.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/Type.java deleted file mode 100644 index bda3a2c530..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/Type.java +++ /dev/null @@ -1,11 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.dto; - -import lombok.Data; - -@Data -public class Type { - - private String namespace; - private String name; - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/ValidateSignRequestDto.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/ValidateSignRequestDto.java deleted file mode 100644 index b6bc1a22af..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/dto/ValidateSignRequestDto.java +++ /dev/null @@ -1,24 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.dto; - -import java.time.LocalDateTime; - -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class ValidateSignRequestDto { - @NotBlank - private String signature; - @NotBlank - private String data; - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") - @NotNull - private LocalDateTime timestamp; - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/CertificateTypes.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/CertificateTypes.java deleted file mode 100644 index e757ca46d7..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/CertificateTypes.java +++ /dev/null @@ -1,18 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.helper; - -public enum CertificateTypes { - - INTERNAL("ida-internal.cer"), - PARTNER("ida-partner.cer"), - IDA_FIR("ida-fir.cer"); - - private String fileName; - - private CertificateTypes(String fileName) { - this.fileName = fileName; - } - - public String getFileName() { - return this.fileName; - } -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/CryptoCoreUtil.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/CryptoCoreUtil.java deleted file mode 100644 index 9e928a4ef4..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/CryptoCoreUtil.java +++ /dev/null @@ -1,365 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.helper; - -import static java.util.Arrays.copyOfRange; - -import java.math.BigInteger; -import java.security.GeneralSecurityException; -import java.security.InvalidAlgorithmParameterException; -import java.security.InvalidKeyException; -import java.security.KeyStore.PrivateKeyEntry; -import java.security.NoSuchAlgorithmException; -import java.security.NoSuchProviderException; -import java.security.PrivateKey; -import java.security.PublicKey; -import java.security.cert.Certificate; -import java.security.interfaces.RSAPrivateKey; -import java.security.spec.MGF1ParameterSpec; -import java.util.Arrays; -import java.util.Objects; - -import javax.crypto.BadPaddingException; -import javax.crypto.Cipher; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.NoSuchPaddingException; -import javax.crypto.SecretKey; -import javax.crypto.spec.GCMParameterSpec; -import javax.crypto.spec.OAEPParameterSpec; -import javax.crypto.spec.PSource.PSpecified; -import javax.crypto.spec.SecretKeySpec; - -import org.apache.commons.codec.digest.DigestUtils; -import org.bouncycastle.crypto.InvalidCipherTextException; -import org.bouncycastle.crypto.digests.SHA256Digest; -import org.bouncycastle.crypto.encodings.OAEPEncoding; -import org.bouncycastle.crypto.engines.RSAEngine; -import org.bouncycastle.crypto.params.RSAKeyParameters; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - -import io.mosip.kernel.core.crypto.exception.InvalidParamSpecException; -import io.mosip.kernel.core.util.CryptoUtil; -import io.mosip.kernel.crypto.jce.constant.SecurityExceptionCodeConstant; -import io.mosip.kernel.crypto.jce.util.CryptoUtils; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -@Component -public class CryptoCoreUtil { - - private final static String RSA_ECB_OAEP_PADDING = "RSA/ECB/OAEPWITHSHA-256ANDMGF1PADDING"; - - private final static int THUMBPRINT_LENGTH = 32; - private final static int NONCE = 12; - private final static int AADSize = 32; - public static final byte[] VERSION_RSA_2048 = "VER_R2".getBytes(); - - private static final String MGF1 = "MGF1"; - - private static final String HASH_ALGO = "SHA-256"; - - private static final String PKCS11_STORE_TYPE = "PKCS11"; - - // Used as a hack for softhsm oeap padding decryption usecase will be when we - // will use in HSM - @SuppressWarnings("java:S106") - private static final String RSA_ECB_NO_PADDING = "RSA/ECB/NoPadding"; // NOSONAR using the padding for allowing OAEP padding in PKCS11 library - - - @Value("${mosip.prependThumbprint:true}") - private boolean isThumbprint; - - @Value("${mosip.kernel.crypto.asymmetric-algorithm-name:" + RSA_ECB_OAEP_PADDING + "}") - private String asymmetricAlgorithm; - - @Value("${mosip.kernel.keymanager.hsm.keystore-type:PKCS11}") - private String keystoreType; - - @Value("${mosip.kernel.keygenerator.asymmetric-key-length:2048}") - private int asymmetricKeyLength; - - - public String decrypt(String data, PrivateKeyEntry privateKeyEntry) throws Exception { - try { - byte[] dataBytes = CryptoUtil.decodeURLSafeBase64(data); - byte[] decryptedDataBytes = decryptData(dataBytes, privateKeyEntry); - return new String(decryptedDataBytes); - }catch (Exception e){ - log.error( "Not able to decrypt the data : {}", e); - } - throw new Exception("Unknown decryption exception."); - } - - public byte[] decryptData(byte[] requestData, PrivateKeyEntry privateKey) throws Exception { - String keySplitter = "#KEY_SPLITTER#"; - SecretKey symmetricKey = null; - byte[] encryptedData = null; - byte[] encryptedSymmetricKey = null; - final int cipherKeyandDataLength = requestData.length; - final int keySplitterLength = keySplitter.length(); - - int keyDemiliterIndex = getSplitterIndex(requestData, 0, keySplitter); - byte[] encryptedKey = copyOfRange(requestData, 0, keyDemiliterIndex); - byte[] headerBytes = parseEncryptKeyHeader(encryptedKey); - byte[] decryptedSymmetricKey = null; - try { - encryptedData = copyOfRange(requestData, keyDemiliterIndex + keySplitterLength, cipherKeyandDataLength); - if (Arrays.equals(headerBytes, VERSION_RSA_2048)) { - encryptedSymmetricKey = Arrays.copyOfRange(encryptedKey, THUMBPRINT_LENGTH + VERSION_RSA_2048.length, - encryptedKey.length); - byte[] aad = Arrays.copyOfRange(encryptedData, 0, AADSize); - byte[] nonce = Arrays.copyOfRange(aad, 0, NONCE); - byte[] encData = Arrays.copyOfRange(encryptedData, AADSize, encryptedData.length); - decryptedSymmetricKey = asymmetricDecrypt(privateKey.getPrivateKey(), - ((RSAPrivateKey) privateKey.getPrivateKey()).getModulus(), encryptedSymmetricKey); - symmetricKey = new SecretKeySpec(decryptedSymmetricKey, 0, decryptedSymmetricKey.length, "AES"); - return symmetricDecrypt(symmetricKey, encData, nonce, aad); - } else if (isThumbprint) { - encryptedSymmetricKey = Arrays.copyOfRange(encryptedKey, THUMBPRINT_LENGTH, encryptedKey.length); - decryptedSymmetricKey = asymmetricDecrypt(privateKey.getPrivateKey(), - ((RSAPrivateKey) privateKey.getPrivateKey()).getModulus(), encryptedSymmetricKey); - symmetricKey = new SecretKeySpec(decryptedSymmetricKey, 0, decryptedSymmetricKey.length, "AES"); - return symmetricDecrypt(symmetricKey, encryptedData, null); - } else { - decryptedSymmetricKey = asymmetricDecrypt(privateKey.getPrivateKey(), - ((RSAPrivateKey) privateKey.getPrivateKey()).getModulus(), encryptedKey); - symmetricKey = new SecretKeySpec(decryptedSymmetricKey, 0, decryptedSymmetricKey.length, "AES"); - return symmetricDecrypt(symmetricKey, encryptedData, null); - } - } catch (Exception e) { - log.error( "Not able to decrypt the data : {}", e); - } - throw new Exception("Unknown decryption exception."); - } - - public byte[] parseEncryptKeyHeader(byte[] encryptedKey) { - byte[] versionHeaderBytes = Arrays.copyOfRange(encryptedKey, 0, VERSION_RSA_2048.length); - if (!Arrays.equals(versionHeaderBytes, VERSION_RSA_2048)) { - return new byte[0]; - } - return versionHeaderBytes; - } - - private static int getSplitterIndex(byte[] encryptedData, int keyDemiliterIndex, String keySplitter) { - final byte keySplitterFirstByte = keySplitter.getBytes()[0]; - final int keySplitterLength = keySplitter.length(); - for (byte data : encryptedData) { - if (data == keySplitterFirstByte) { - final String keySplit = new String( - copyOfRange(encryptedData, keyDemiliterIndex, keyDemiliterIndex + keySplitterLength)); - if (keySplitter.equals(keySplit)) { - break; - } - } - keyDemiliterIndex++; - } - return keyDemiliterIndex; - } - - /** - * - * @param privateKey - * @param keyModulus - * @param data - * @return - * @throws IllegalBlockSizeException - * @throws BadPaddingException - * @throws NoSuchAlgorithmException - * @throws NoSuchPaddingException - * @throws InvalidAlgorithmParameterException - * @throws InvalidKeyException - */ - private static byte[] asymmetricDecrypt(PrivateKey privateKey, BigInteger keyModulus, byte[] data) - throws IllegalBlockSizeException, BadPaddingException, NoSuchAlgorithmException, NoSuchPaddingException, - InvalidAlgorithmParameterException, InvalidKeyException { - - Cipher cipher; - try { - cipher = Cipher.getInstance(RSA_ECB_OAEP_PADDING); - OAEPParameterSpec oaepParams = new OAEPParameterSpec("SHA-256", "MGF1", MGF1ParameterSpec.SHA256, - PSpecified.DEFAULT); - cipher.init(Cipher.DECRYPT_MODE, privateKey, oaepParams); - return cipher.doFinal(data); - } catch (java.security.NoSuchAlgorithmException e) { - log.error("Not able to decrypt the data : {}" , e); - throw new NoSuchAlgorithmException(e); - } catch (NoSuchPaddingException e) { - throw new NoSuchPaddingException(e.getMessage()); - } catch (java.security.InvalidKeyException e) { - throw new InvalidKeyException(e); - } catch (InvalidAlgorithmParameterException e) { - throw new InvalidAlgorithmParameterException(e); - } - } - - private static byte[] symmetricDecrypt(SecretKey key, byte[] data, byte[] aad) { - byte[] output = null; - try { - Cipher cipher = Cipher.getInstance("AES/GCM/PKCS5Padding"); - byte[] randomIV = Arrays.copyOfRange(data, data.length - cipher.getBlockSize(), data.length); - SecretKeySpec keySpec = new SecretKeySpec(key.getEncoded(), "AES"); - GCMParameterSpec gcmParameterSpec = new GCMParameterSpec(128, randomIV); - - cipher.init(Cipher.DECRYPT_MODE, keySpec, gcmParameterSpec); - if (aad != null && aad.length != 0) { - cipher.updateAAD(aad); - } - output = cipher.doFinal(Arrays.copyOf(data, data.length - cipher.getBlockSize())); - } catch (Exception e) { - - } - return output; - } - - public byte[] symmetricDecrypt(SecretKey key, byte[] data, byte[] nonce, byte[] aad) - throws Exception { - // Objects.requireNonNull(key, null); - // CryptoUtils.verifyData(data); - byte[] output = null; - Cipher cipher; - try { - cipher = Cipher.getInstance("AES/GCM/PKCS5Padding"); - SecretKeySpec keySpec = new SecretKeySpec(key.getEncoded(), "AES"); - GCMParameterSpec gcmParameterSpec = new GCMParameterSpec(128, nonce); - cipher.init(Cipher.DECRYPT_MODE, keySpec, gcmParameterSpec); - if (aad != null) { - cipher.updateAAD(aad); - } - output = cipher.doFinal(data, 0, data.length); - } catch (InvalidAlgorithmParameterException e) { - throw new Exception("Invalid key exception.", e); - } catch (IllegalBlockSizeException e) { - throw new Exception("Invalid key exception.", e); - } catch (BadPaddingException e) { - throw new Exception("Certificate thumbprint error.", e); - } catch (NoSuchAlgorithmException e) { - throw new Exception("Certificate thumbprint error.", e); - } catch (NoSuchPaddingException e) { - throw new Exception("Certificate thumbprint error.", e); - } catch (InvalidKeyException e) { - throw new Exception("Invalid key exception.", e); - } - return output; - } - - public static byte[] getCertificateThumbprint(Certificate cert) throws Exception { - try { - return DigestUtils.sha256(cert.getEncoded()); - } catch (java.security.cert.CertificateEncodingException e) { - throw new Exception("Invalid key exception.", e); - } - } - - public byte[] asymmetricEncrypt(PublicKey key, byte[] data) throws GeneralSecurityException { - Objects.requireNonNull(key, SecurityExceptionCodeConstant.MOSIP_INVALID_KEY_EXCEPTION.getErrorMessage()); - CryptoUtils.verifyData(data); - Cipher cipher; - try { - cipher = Cipher.getInstance(asymmetricAlgorithm); - } catch (java.security.NoSuchAlgorithmException | NoSuchPaddingException e) { - throw e; - } - final OAEPParameterSpec oaepParams = new OAEPParameterSpec(HASH_ALGO, MGF1, MGF1ParameterSpec.SHA256, - PSpecified.DEFAULT); - try { - cipher.init(Cipher.ENCRYPT_MODE, key, oaepParams); - } catch (java.security.InvalidKeyException e) { - throw e; - } catch (InvalidAlgorithmParameterException e) { - throw new InvalidParamSpecException( - SecurityExceptionCodeConstant.MOSIP_INVALID_PARAM_SPEC_EXCEPTION.getErrorCode(), - SecurityExceptionCodeConstant.MOSIP_INVALID_PARAM_SPEC_EXCEPTION.getErrorMessage(), e); - } - return doFinal(data, cipher); - } - - public byte[] asymmetricDecrypt(PrivateKey privateKey, byte[] data) throws GeneralSecurityException, InvalidCipherTextException { - if (PKCS11_STORE_TYPE.equalsIgnoreCase(keystoreType)) { - BigInteger keyModulus = ((RSAPrivateKey) privateKey).getModulus(); - return asymmetricDecrypt(privateKey, keyModulus, data, null); - } - return jceAsymmetricDecrypt(privateKey, data, null); - } - - private byte[] asymmetricDecrypt(PrivateKey privateKey, BigInteger keyModulus, byte[] data, String storeType) throws GeneralSecurityException, InvalidCipherTextException { - Objects.requireNonNull(privateKey, SecurityExceptionCodeConstant.MOSIP_INVALID_KEY_EXCEPTION.getErrorMessage()); - CryptoUtils.verifyData(data); - Cipher cipher; - try { - cipher = Objects.isNull(storeType) ? Cipher.getInstance(RSA_ECB_NO_PADDING) : // NOSONAR using the padding for allowing OAEP padding in PKCS11 library - Cipher.getInstance(RSA_ECB_NO_PADDING, storeType); // NOSONAR using the padding for allowing OAEP padding in PKCS11 library - } catch (java.security.NoSuchAlgorithmException | NoSuchPaddingException | NoSuchProviderException e) { - throw e; - } - - try { - cipher.init(Cipher.DECRYPT_MODE, privateKey); - } catch (java.security.InvalidKeyException e) { - throw e; - } - /* - * This is a hack of removing OEAP padding after decryption with NO Padding as - * SoftHSM does not support it.Will be removed after HSM implementation - */ - byte[] paddedPlainText = doFinal(data, cipher); - if (paddedPlainText.length < asymmetricKeyLength / 8) { - byte[] tempPipe = new byte[asymmetricKeyLength / 8]; - System.arraycopy(paddedPlainText, 0, tempPipe, tempPipe.length - paddedPlainText.length, - paddedPlainText.length); - paddedPlainText = tempPipe; - } - - return unpadOAEPPadding(paddedPlainText, keyModulus); - } - - // This is a hack of removing OEAP padding after decryption with NO Padding as - // SoftHSM does not support it.Will be removed after HSM implementation - /** - * - * @param paddedPlainText - * @param privateKey - * @return - * @throws InvalidCipherTextException - */ - private byte[] unpadOAEPPadding(byte[] paddedPlainText, BigInteger keyModulus) throws InvalidCipherTextException { - - try { - OAEPEncoding encode = new OAEPEncoding(new RSAEngine(), new SHA256Digest()); - BigInteger exponent = new BigInteger("1"); - RSAKeyParameters keyParams = new RSAKeyParameters(false, keyModulus, exponent); - encode.init(false, keyParams); - return encode.processBlock(paddedPlainText, 0, paddedPlainText.length); - } catch (InvalidCipherTextException e) { - throw e; - } - } - - private byte[] jceAsymmetricDecrypt(PrivateKey privateKey, byte[] data, String storeType) throws GeneralSecurityException{ - Objects.requireNonNull(privateKey, SecurityExceptionCodeConstant.MOSIP_INVALID_KEY_EXCEPTION.getErrorMessage()); - CryptoUtils.verifyData(data); - Cipher cipher; - try { - cipher = Objects.isNull(storeType) ? Cipher.getInstance(asymmetricAlgorithm) : - Cipher.getInstance(asymmetricAlgorithm, storeType); - OAEPParameterSpec oaepParams = new OAEPParameterSpec(HASH_ALGO, MGF1, MGF1ParameterSpec.SHA256, - PSpecified.DEFAULT); - cipher.init(Cipher.DECRYPT_MODE, privateKey, oaepParams); - return doFinal(data, cipher); - } catch (java.security.NoSuchAlgorithmException | NoSuchPaddingException | NoSuchProviderException e) { - throw e; - } catch (java.security.InvalidKeyException e) { - throw e; - } catch (InvalidAlgorithmParameterException e) { - throw e; - } - } - - private byte[] doFinal(byte[] data, Cipher cipher) throws IllegalBlockSizeException, BadPaddingException { - try { - return cipher.doFinal(data); - } catch (IllegalBlockSizeException e) { - throw e; - } catch (BadPaddingException e) { - throw e; - } - } -} \ No newline at end of file diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/CryptoUtility.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/CryptoUtility.java deleted file mode 100644 index 25e09692e0..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/CryptoUtility.java +++ /dev/null @@ -1,143 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.helper; - -import java.security.InvalidAlgorithmParameterException; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.security.PrivateKey; -import java.security.PublicKey; -import java.security.SecureRandom; -import java.security.Security; - -import javax.crypto.BadPaddingException; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.KeyGenerator; -import javax.crypto.NoSuchPaddingException; -import javax.crypto.SecretKey; - -import org.bouncycastle.jce.provider.BouncyCastleProvider; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import io.mosip.kernel.core.crypto.spi.CryptoCoreSpec; - - -/** - * The Class CryptoUtility is used for encryption and decryption. - * - * @author Arun Bose S - * The Class CryptoUtil. - */ -@Component -public class CryptoUtility { - - /** The Constant SYM_ALGORITHM. */ - private static final String SYM_ALGORITHM = "AES"; - - /** The Constant SYM_ALGORITHM_LENGTH. */ - private static final int SYM_ALGORITHM_LENGTH = 256; - - /** The bouncy castle provider. */ - private static BouncyCastleProvider bouncyCastleProvider; - - static { - bouncyCastleProvider = addProvider(); - } - - /** - * {@link CryptoCoreSpec} instance for cryptographic functionalities. - */ - @Autowired - private CryptoCoreSpec cryptoCore; - - - - /** - * Symmetric encrypt. - * - * @param data the data - * @param secretKey the secret key - * @return the byte[] - * @throws NoSuchAlgorithmException the no such algorithm exception - * @throws NoSuchPaddingException the no such padding exception - * @throws InvalidKeyException the invalid key exception - * @throws InvalidAlgorithmParameterException the invalid algorithm parameter exception - * @throws IllegalBlockSizeException the illegal block size exception - * @throws BadPaddingException the bad padding exception - */ - public byte[] symmetricEncrypt(byte[] data, SecretKey secretKey) - throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, - InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException { - return cryptoCore.symmetricEncrypt(secretKey, data, null); - - } - - - - /** - * Symmetric decrypt. - * - * @param secretKey the secret key - * @param encryptedDataByteArr the encrypted data byte arr - * @return the byte[] - * @throws NoSuchAlgorithmException the no such algorithm exception - * @throws NoSuchPaddingException the no such padding exception - * @throws InvalidKeyException the invalid key exception - * @throws IllegalBlockSizeException the illegal block size exception - * @throws BadPaddingException the bad padding exception - * @throws InvalidAlgorithmParameterException the invalid algorithm parameter exception - */ - public byte[] symmetricDecrypt(SecretKey secretKey, byte[] encryptedDataByteArr) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException { - return cryptoCore.symmetricDecrypt(secretKey, encryptedDataByteArr, null); - } - - /** - * Adds the provider. - * - * @return the bouncy castle provider - */ - private static BouncyCastleProvider addProvider() { - BouncyCastleProvider bouncyCastleProvider = new BouncyCastleProvider(); - Security.addProvider(bouncyCastleProvider); - return bouncyCastleProvider; - } - - /** - * Gen sec key. - * - * @return the secret key - * @throws NoSuchAlgorithmException the no such algorithm exception - */ - public SecretKey genSecKey() throws NoSuchAlgorithmException { - KeyGenerator keyGen; - SecretKey secretKey = null; - keyGen = KeyGenerator.getInstance(CryptoUtility.SYM_ALGORITHM, bouncyCastleProvider); - keyGen.init(CryptoUtility.SYM_ALGORITHM_LENGTH, new SecureRandom()); - secretKey = keyGen.generateKey(); - return secretKey; - - } - - /** - * Asymmetric encrypt. - * - * @param data the data - * @param publicKey the public key - * @return the byte[] - * @throws NoSuchAlgorithmException the no such algorithm exception - * @throws NoSuchPaddingException the no such padding exception - * @throws InvalidKeyException the invalid key exception - * @throws IllegalBlockSizeException the illegal block size exception - * @throws BadPaddingException the bad padding exception - */ - public byte[] asymmetricEncrypt(byte[] data, PublicKey publicKey) throws NoSuchAlgorithmException, - NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException { - return cryptoCore.asymmetricEncrypt(publicKey, data); - } - - public byte[] symmetricEncrypt(byte[] data, SecretKey secretKey, byte[] iv, byte[] aad) - throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, - InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException { - return cryptoCore.symmetricEncrypt(secretKey, data, iv, aad); - - } -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/DBUtil.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/DBUtil.java deleted file mode 100644 index fea7abbda9..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/DBUtil.java +++ /dev/null @@ -1,46 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.helper; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.env.Environment; -import org.springframework.stereotype.Component; - -import io.mosip.kernel.core.util.CryptoUtil; - -@Component -public class DBUtil { - - public static final String MASTER = "master"; - public static final String IDA = "ida"; - - @Autowired - private Environment env; - - public String getDbUser(String db) { - return new String(CryptoUtil.decodeBase64(env.getProperty(db + ".db.user"))); - } - - public String getDbPass(String db) { - return new String(CryptoUtil.decodeBase64(env.getProperty(db + ".db.pass"))); - } - - public String getDbUrl(String db) { - String baseUrl = env.getProperty("mosip.base.url"); - if(baseUrl != null) { - if(baseUrl.contains("dev")) { - return env.getProperty("dev." + db + ".db.url"); - } else if(baseUrl.contains("qa")) { - return env.getProperty("qa." + db + ".db.url"); - } else if(baseUrl.contains("ext-int")) { - return env.getProperty("ext-int." + db + ".db.url"); - } else if(baseUrl.contains("preprod")) { - return env.getProperty("preprod." + db + ".db.url"); - } else if(baseUrl.contains("int")) { - return env.getProperty("int." + db + ".db.url"); - } else { - return env.getProperty(env.getProperty("spring.profiles.active") + "." + db + ".db.url"); - } - } - return null; - } - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/KeyMgrUtil.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/KeyMgrUtil.java deleted file mode 100644 index 8d484de364..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/KeyMgrUtil.java +++ /dev/null @@ -1,503 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.helper; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.StringReader; -import java.io.StringWriter; -import java.math.BigInteger; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.security.GeneralSecurityException; -import java.security.KeyFactory; -import java.security.KeyPair; -import java.security.KeyPairGenerator; -import java.security.KeyStore; -import java.security.KeyStore.PasswordProtection; -import java.security.KeyStore.PrivateKeyEntry; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.PrivateKey; -import java.security.PublicKey; -import java.security.SecureRandom; -import java.security.UnrecoverableEntryException; -import java.security.cert.Certificate; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.security.interfaces.RSAPublicKey; -import java.security.spec.InvalidKeySpecException; -import java.security.spec.X509EncodedKeySpec; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.util.Arrays; -import java.util.Date; -import java.util.Objects; - -import javax.security.auth.x500.X500Principal; - -import org.bouncycastle.asn1.x500.RDN; -import org.bouncycastle.asn1.x500.X500Name; -import org.bouncycastle.asn1.x500.X500NameBuilder; -import org.bouncycastle.asn1.x500.style.BCStyle; -import org.bouncycastle.asn1.x500.style.IETFUtils; -import org.bouncycastle.asn1.x500.style.RFC4519Style; -import org.bouncycastle.asn1.x509.BasicConstraints; -import org.bouncycastle.asn1.x509.Extension; -import org.bouncycastle.asn1.x509.KeyUsage; -import org.bouncycastle.cert.CertIOException; -import org.bouncycastle.cert.X509CertificateHolder; -import org.bouncycastle.cert.X509v3CertificateBuilder; -import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; -import org.bouncycastle.cert.jcajce.JcaX509ExtensionUtils; -import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder; -import org.bouncycastle.crypto.InvalidCipherTextException; -import org.bouncycastle.openssl.jcajce.JcaPEMWriter; -import org.bouncycastle.operator.ContentSigner; -import org.bouncycastle.operator.OperatorCreationException; -import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; -import org.bouncycastle.util.io.pem.PemObject; -import org.bouncycastle.util.io.pem.PemReader; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.env.Environment; -import org.springframework.stereotype.Component; - -import io.mosip.authentication.core.exception.IdAuthenticationBusinessException; -import io.mosip.authentication.core.util.CryptoUtil; -import io.mosip.testrig.authentication.demo.service.dto.CertificateChainResponseDto; - -@Component -public class KeyMgrUtil { - - private static final String DOMAIN_URL = "mosip.base.url"; - - private static final String CERTIFICATE_TYPE = "X.509"; - - private static final String CA_P12_FILE_NAME = "-ca.p12"; - private static final String INTER_P12_FILE_NAME = "-inter.p12"; - private static final String PARTNER_P12_FILE_NAME = "-partner.p12"; - - private static final char[] TEMP_P12_PWD = "qwerty@123".toCharArray(); - - private static final String KEY_ALIAS = "keyalias"; - private static final String KEY_STORE = "PKCS12"; - private static final String RSA_ALGO = "RSA"; - private static final int RSA_KEY_SIZE = 2048; - private static final String SIGN_ALGO = "SHA256withRSA"; - private static final String DEVICE_SPECIFIC_KEY = "-dsk"; - private static final String CHIP_SPECIFIC_KEY = "-csk"; - - - @Autowired - private Environment environment; - - @Value("${rp-partner-cert-expiry-years:5}") - private int rpPartnerCertExpiryYears; - - @Value("${ftm-partner-cert-expiry-years:1}") - private int ftmCertificateExpiryYears; - - @Value("${device-partner-cert-expiry-months:6}") - private int deviceCertificateExpiryMonths; - - @Autowired - CryptoCoreUtil cryptoCoreUtil; - - public Certificate convertToCertificate(String certData) throws IOException, CertificateException { - StringReader strReader = new StringReader(certData); - PemReader pemReader = new PemReader(strReader); - PemObject pemObject = pemReader.readPemObject(); - - byte[] certBytes = pemObject.getContent(); - CertificateFactory certFactory = CertificateFactory.getInstance(CERTIFICATE_TYPE); - return certFactory.generateCertificate(new ByteArrayInputStream(certBytes)); - } - - public CertificateChainResponseDto getPartnerCertificates(PartnerTypes partnerType, String dirPath, String organization, boolean keyFileNameByPartnerName) throws - NoSuchAlgorithmException, UnrecoverableEntryException, KeyStoreException, IOException, CertificateException, OperatorCreationException { - String filePrepend = keyFileNameByPartnerName ? partnerType.getFilePrepend() + '-' + organization : partnerType.getFilePrepend(); - String caFilePath = dirPath + '/' + filePrepend + CA_P12_FILE_NAME; - LocalDateTime dateTime = LocalDateTime.now(); - LocalDateTime dateTimeExp = dateTime.plusYears(rpPartnerCertExpiryYears); - PrivateKeyEntry caPrivKeyEntry = getPrivateKeyEntry(caFilePath); - KeyUsage keyUsage = new KeyUsage(KeyUsage.digitalSignature | KeyUsage.keyCertSign); - if (Objects.isNull(caPrivKeyEntry)) { - caPrivKeyEntry = generateKeys(null, "CA-" + filePrepend, "CA-" + filePrepend, caFilePath, keyUsage, dateTime, dateTimeExp, organization); - } - String caCertificate = getCertificate(caPrivKeyEntry); - - String interFilePath = dirPath + '/' + filePrepend + INTER_P12_FILE_NAME; - PrivateKeyEntry interPrivKeyEntry = getPrivateKeyEntry(interFilePath); - if (Objects.isNull(interPrivKeyEntry)) { - interPrivKeyEntry = generateKeys(caPrivKeyEntry.getPrivateKey(), "CA-" + filePrepend, "INTER-" + filePrepend, interFilePath, keyUsage, dateTime, dateTimeExp, organization); - } - String interCertificate = getCertificate(interPrivKeyEntry); - - String partnerFilePath = dirPath + '/' + filePrepend + PARTNER_P12_FILE_NAME; - PrivateKeyEntry partnerPrivKeyEntry = getPrivateKeyEntry(partnerFilePath); - if (Objects.isNull(partnerPrivKeyEntry)) { - if (filePrepend.equalsIgnoreCase(PartnerTypes.EKYC.name())){ - keyUsage = new KeyUsage(KeyUsage.keyEncipherment | KeyUsage.encipherOnly | KeyUsage.decipherOnly); - } - partnerPrivKeyEntry = generateKeys(interPrivKeyEntry.getPrivateKey(), "INTER-" + filePrepend, "PARTNER-" + filePrepend, - partnerFilePath, keyUsage, dateTime, dateTimeExp, organization); - } - - if(partnerType.equals(PartnerTypes.DEVICE) || partnerType.equals(PartnerTypes.FTM)) { - getKeyEntry(dirPath, partnerType, organization, keyFileNameByPartnerName); - } - - - String partnerCertificate = getCertificate(partnerPrivKeyEntry); - CertificateChainResponseDto responseDto = new CertificateChainResponseDto(); - responseDto.setCaCertificate(caCertificate); - responseDto.setInterCertificate(interCertificate); - responseDto.setPartnerCertificate(partnerCertificate); - return responseDto; - } - - public PrivateKeyEntry getPrivateKeyEntry(String filePath) throws NoSuchAlgorithmException, UnrecoverableEntryException, - KeyStoreException, IOException, CertificateException{ - return getPrivateKeyEntry(filePath, getP12Pass(), getKeyAlias()); - } - - public PrivateKeyEntry getPrivateKeyEntry(String filePath, char[] p12Pass, String keyAlias) throws NoSuchAlgorithmException, UnrecoverableEntryException, - KeyStoreException, IOException, CertificateException{ - Path path = Paths.get(filePath); - if (Files.exists(path)){ - KeyStore keyStore = KeyStore.getInstance(KEY_STORE); - try(InputStream p12FileStream = new FileInputStream(filePath);) { - keyStore.load(p12FileStream, p12Pass); - return (PrivateKeyEntry) keyStore.getEntry(getKeyAlias(keyAlias), new PasswordProtection (getP12Pass(p12Pass))); - } - } - return null; - } - - private char[] getP12Pass(char[] p12Pass) { - return p12Pass == null ? getP12Pass() : p12Pass; - } - - private String getKeyAlias(String keyAlias) { - return keyAlias == null ? getKeyAlias() : keyAlias; - } - - private char[] getP12Pass() { - String pass = environment.getProperty("p12.password"); - return pass == null ? TEMP_P12_PWD : pass.toCharArray(); - } - - private String getCertificate(PrivateKeyEntry keyEntry) throws IOException{ - StringWriter stringWriter = new StringWriter(); - JcaPEMWriter pemWriter = new JcaPEMWriter(stringWriter); - pemWriter.writeObject(keyEntry.getCertificate()); - pemWriter.flush(); - return stringWriter.toString(); - } - - public boolean deleteFile(File file) throws IOException { - if (file != null) { - if (file.isDirectory()) { - File[] files = file.listFiles(); - - for (File f: files) { - deleteFile(f); - } - } - return Files.deleteIfExists(file.toPath()); - } - return false; - } - - private PrivateKeyEntry generateKeys(PrivateKey signKey, String signCertType, String certType, String p12FilePath, KeyUsage keyUsage, - LocalDateTime dateTime, LocalDateTime dateTimeExp, String organization) throws - NoSuchAlgorithmException, OperatorCreationException, CertificateException, KeyStoreException, IOException { - KeyPairGenerator generator = KeyPairGenerator.getInstance(RSA_ALGO); - SecureRandom random = new SecureRandom(); - generator.initialize(RSA_KEY_SIZE, random); - KeyPair keyPair = generator.generateKeyPair(); - X509Certificate signCert = null; - if(Objects.isNull(signKey)) { - signCert = generateX509Certificate(keyPair.getPrivate(), keyPair.getPublic(), signCertType, certType, keyUsage, dateTime, dateTimeExp, organization); - } else { - signCert = generateX509Certificate(signKey, keyPair.getPublic(), signCertType, certType, keyUsage, dateTime, dateTimeExp, organization); - } - X509Certificate[] chain = new X509Certificate[] {signCert}; - PrivateKeyEntry privateKeyEntry = new PrivateKeyEntry(keyPair.getPrivate(), chain); - - KeyStore keyStore = KeyStore.getInstance(KEY_STORE); - keyStore.load(null, getP12Pass()); - keyStore.setEntry(getKeyAlias(), privateKeyEntry, new PasswordProtection (getP12Pass())); - Path parentPath = Paths.get(p12FilePath).getParent(); - if (parentPath != null && !Files.exists(parentPath)) { - Files.createDirectories(parentPath); - } - - - OutputStream outputStream = new FileOutputStream(p12FilePath); - keyStore.store(outputStream, getP12Pass()); - outputStream.flush(); - outputStream.close(); - return new PrivateKeyEntry(keyPair.getPrivate(), chain); - } - - private X509Certificate generateX509Certificate(PrivateKey signPrivateKey, PublicKey publicKey, String signCertType, - String certType, KeyUsage keyUsage, LocalDateTime dateTime, LocalDateTime dateTimeExp, String organization) throws - OperatorCreationException, NoSuchAlgorithmException, CertIOException, CertificateException { - X500Name certIssuer = getCertificateAttributes(signCertType, organization); - X500Name certSubject = getCertificateAttributes(certType, organization); - Date notBefore = Date.from(dateTime.atZone(ZoneId.systemDefault()).toInstant()); - Date notAfter = Date.from(dateTimeExp.atZone(ZoneId.systemDefault()).toInstant()); - - BigInteger certSerialNum = new BigInteger(Long.toString(new SecureRandom().nextLong())); - - ContentSigner certContentSigner = new JcaContentSignerBuilder(SIGN_ALGO).build(signPrivateKey); - X509v3CertificateBuilder certBuilder = new JcaX509v3CertificateBuilder(certIssuer, certSerialNum, notBefore, - notAfter, certSubject, publicKey); - JcaX509ExtensionUtils certExtUtils = new JcaX509ExtensionUtils(); - certBuilder.addExtension(Extension.basicConstraints, true, new BasicConstraints(true)); - certBuilder.addExtension(Extension.subjectKeyIdentifier, false, certExtUtils.createSubjectKeyIdentifier(publicKey)); - certBuilder.addExtension(Extension.keyUsage, true, keyUsage); - X509CertificateHolder certHolder = certBuilder.build(certContentSigner); - return new JcaX509CertificateConverter().getCertificate(certHolder); - } - - private static X500Name getCertificateAttributes(String cn, String organization) { - - X500NameBuilder builder = new X500NameBuilder(RFC4519Style.INSTANCE); - builder.addRDN(BCStyle.C, "IN"); - builder.addRDN( BCStyle.ST, "KA"); - builder.addRDN(BCStyle.O, organization); - builder.addRDN(BCStyle.OU, "IDA-TEST-ORG-UNIT"); - builder.addRDN(BCStyle.CN, cn); - return builder.build(); - } - - public String readStringFile(String dirPath, String fileName) throws IOException { - return Files.readString(new File(dirPath + File.separator + fileName).toPath()); - } - - public String asymmetricEncryptionForCert(byte[] dataToEncrypt, String certFileName, String certsDir, String moduleName) throws GeneralSecurityException, IOException { - X509Certificate x509Certificate = getX509Certificate(readStringFile(getKeysDirPath(certsDir, moduleName), certFileName)); - PublicKey publicKey = x509Certificate.getPublicKey(); - return asymmetricEncryptionPublicKey(dataToEncrypt, publicKey); - } - - public String asymmetricEncryptionForPemFile(byte[] dataToEncrypt, String pemFile, String certsDir, String moduleName) throws GeneralSecurityException, IOException { - PublicKey publicKey = getPublicKey(readStringFile(getKeysDirPath(certsDir, moduleName), pemFile)); - return asymmetricEncryptionPublicKey(dataToEncrypt, publicKey); - } - - public String asymmetricEncryptionPublicKey(byte[] dataToEncrypt, PublicKey publicKey) throws GeneralSecurityException { - byte[] encryptedData = cryptoCoreUtil.asymmetricEncrypt(publicKey, dataToEncrypt); - System.out.println("AssymetricEncrypted data -- Start" + encryptedData+ " End--AssymetricEncrypted data" ); - return CryptoUtil.encodeBase64(encryptedData); - } - - public String asymmetricDecryptionForP12File(byte[] bytes, String p12FileName, String certsDir, String moduleName, char[] p12Pass, String keyAlias) throws InvalidCipherTextException, NoSuchAlgorithmException, UnrecoverableEntryException, KeyStoreException, CertificateException, OperatorCreationException, GeneralSecurityException, IOException { - return new String(cryptoCoreUtil.asymmetricDecrypt( - getPrivateKeyEntry(getKeysDirPath(certsDir, moduleName) + File.separator + p12FileName, p12Pass, keyAlias) - .getPrivateKey(), - bytes)); - } - - - /** - * Gets the x 509 certificate. - * - * @param partnerCertificate the partner certificate - * @return the x 509 certificate - * @throws CertificateException - * @throws IdAuthenticationBusinessException the id authentication business exception - */ - private X509Certificate getX509Certificate(String partnerCertificate) throws CertificateException { - String certificate = trimBeginEnd(partnerCertificate); - CertificateFactory cf = CertificateFactory.getInstance("X.509"); - X509Certificate x509cert = (X509Certificate) cf - .generateCertificate(new ByteArrayInputStream(java.util.Base64.getDecoder().decode(certificate))); - return x509cert; - } - - private PublicKey getPublicKey(String publicKeyPEM) throws CertificateException, NoSuchAlgorithmException, InvalidKeySpecException { - String trimmedPublicKeyPEM = trimBeginEnd(publicKeyPEM); - byte[] encoded = java.util.Base64.getDecoder().decode(trimmedPublicKeyPEM); - - KeyFactory keyFactory = KeyFactory.getInstance("RSA"); - X509EncodedKeySpec keySpec = new X509EncodedKeySpec(encoded); - return (RSAPublicKey) keyFactory.generatePublic(keySpec); - } - - /** - * Trim begin end. - * - * @param pKey the key - * @return the string - */ - public static String trimBeginEnd(String pKey) { - pKey = pKey.replaceAll("-{0,30}BEGIN([^-]{0,30})-{0,30}(\r?\n)?", ""); - pKey = pKey.replaceAll("-{0,30}END([^-]{0,30})-{0,30}(\r?\n)?", ""); - pKey = pKey.replaceAll("\\s", ""); - return pKey; - } - - - public PrivateKeyEntry getKeyEntry(String dirPath, PartnerTypes partnerType, String organization, boolean keyFileNameByPartnerName) throws NoSuchAlgorithmException, UnrecoverableEntryException, - KeyStoreException, CertificateException, IOException, OperatorCreationException { - - if (partnerType == PartnerTypes.EKYC) { - String filePrepend = keyFileNameByPartnerName ? PartnerTypes.EKYC.getFilePrepend() + '-' + organization - : PartnerTypes.EKYC.getFilePrepend(); - String partnerFilePath = dirPath + '/' + filePrepend + PARTNER_P12_FILE_NAME; - PrivateKeyEntry privateKeyEntry = getPrivateKeyEntry(partnerFilePath); - if(privateKeyEntry == null) { - filePrepend = keyFileNameByPartnerName ? PartnerTypes.RELYING_PARTY.getFilePrepend() + '-' + organization - : PartnerTypes.RELYING_PARTY.getFilePrepend(); - partnerFilePath = dirPath + '/' + filePrepend + PARTNER_P12_FILE_NAME; - privateKeyEntry = getPrivateKeyEntry(partnerFilePath); - } - return privateKeyEntry; - } - - - if (partnerType == PartnerTypes.RELYING_PARTY) { - String filePrepend = keyFileNameByPartnerName ? PartnerTypes.RELYING_PARTY.getFilePrepend() + '-' + organization - : PartnerTypes.RELYING_PARTY.getFilePrepend(); - String partnerFilePath = dirPath + '/' + filePrepend + PARTNER_P12_FILE_NAME; - return getPrivateKeyEntry(partnerFilePath); - } - - if (partnerType == PartnerTypes.MISP) { - String filePrepend = keyFileNameByPartnerName ? PartnerTypes.MISP.getFilePrepend() + '-' + organization - : PartnerTypes.MISP.getFilePrepend(); - String partnerFilePath = dirPath + '/' + filePrepend + PARTNER_P12_FILE_NAME; - return getPrivateKeyEntry(partnerFilePath); - } - - String filePrepend = partnerType.getFilePrepend(); - if (partnerType == PartnerTypes.FTM) { - String csPartnerFilePath = dirPath + '/' + filePrepend + CHIP_SPECIFIC_KEY + PARTNER_P12_FILE_NAME; - PrivateKeyEntry csKeyEntry = getPrivateKeyEntry(csPartnerFilePath); - if (Objects.nonNull(csKeyEntry)) - return csKeyEntry; - - String partnerFilePath = dirPath + '/' + filePrepend + PARTNER_P12_FILE_NAME; - PrivateKeyEntry pKeyEntry = getPrivateKeyEntry(partnerFilePath); - LocalDateTime dateTime = LocalDateTime.now(); - LocalDateTime dateTimeExp = dateTime.plusYears(ftmCertificateExpiryYears); - KeyUsage keyUsage = new KeyUsage(KeyUsage.digitalSignature | KeyUsage.keyCertSign); - - X500Principal signerPrincipal = ((X509Certificate)pKeyEntry.getCertificate()).getSubjectX500Principal(); - X500Name x500Name = new X500Name(signerPrincipal.getName()); - RDN[] rdns = x500Name.getRDNs(BCStyle.CN); - String cName = IETFUtils.valueToString((rdns[0]).getFirst().getValue()); - System.out.println("signerPrincipal:: " + signerPrincipal.toString()); - System.out.println("cName:: " + cName); - - RDN[] o = x500Name.getRDNs(BCStyle.O); - String oName = IETFUtils.valueToString((o[0]).getFirst().getValue()); - System.out.println("oName:: " + oName); - return generateKeys(pKeyEntry.getPrivateKey(), cName, "CSK-" + partnerType, - csPartnerFilePath, keyUsage, dateTime, dateTimeExp, oName); - - } - - if (partnerType == PartnerTypes.DEVICE) { - String dsPartnerFilePath = dirPath + '/' + filePrepend + DEVICE_SPECIFIC_KEY + PARTNER_P12_FILE_NAME; - PrivateKeyEntry dsKeyEntry = getPrivateKeyEntry(dsPartnerFilePath); - if (Objects.nonNull(dsKeyEntry) && isCertificateValid((X509Certificate) dsKeyEntry.getCertificate())) - return dsKeyEntry; - - String partnerFilePath = dirPath + '/' + filePrepend + PARTNER_P12_FILE_NAME; - PrivateKeyEntry pKeyEntry = getPrivateKeyEntry(partnerFilePath); - LocalDateTime dateTime = LocalDateTime.now(); - LocalDateTime dateTimeExp = dateTime.plusMonths(deviceCertificateExpiryMonths); - KeyUsage keyUsage = new KeyUsage(KeyUsage.digitalSignature | KeyUsage.keyCertSign); - - X500Principal signerPrincipal = ((X509Certificate)pKeyEntry.getCertificate()).getSubjectX500Principal(); - X500Name x500Name = new X500Name(signerPrincipal.getName()); - RDN[] rdns = x500Name.getRDNs(BCStyle.CN); - String cName = IETFUtils.valueToString((rdns[0]).getFirst().getValue()); - System.out.println("signerPrincipal:: " + signerPrincipal.toString()); - System.out.println("cName:: " + cName); - - RDN[] o = x500Name.getRDNs(BCStyle.O); - String oName = IETFUtils.valueToString((o[0]).getFirst().getValue()); - System.out.println("oName:: " + oName); - return generateKeys(pKeyEntry.getPrivateKey(), cName, "DSK-" + partnerType, - dsPartnerFilePath, keyUsage, dateTime, dateTimeExp, oName); - } - return null; - } - - private boolean isCertificateValid(X509Certificate cert) { - try { - cert.checkValidity(); - return true; - } catch (Exception e) { - } - return false; - } - - public boolean updatePartnerCertificate(String partnerType, X509Certificate updateCert, String dirPath, String organization, boolean keyFileNameByPartnerName) throws NoSuchAlgorithmException, - UnrecoverableEntryException, KeyStoreException, CertificateException, IOException { - String filePrepend = keyFileNameByPartnerName ? partnerType + '-' + organization : partnerType; - String partnerFilePath = dirPath + '/' + filePrepend + PARTNER_P12_FILE_NAME; - - PrivateKeyEntry partnerPrivKeyEntry = getPrivateKeyEntry(partnerFilePath); - if (Objects.nonNull(partnerPrivKeyEntry)) { - X509Certificate fileCert = (X509Certificate) partnerPrivKeyEntry.getCertificate(); - if (!Arrays.equals(fileCert.getPublicKey().getEncoded(), updateCert.getPublicKey().getEncoded())){ - throw new CertificateException("Public Key not matched. Please upload correct certificate."); - } - X509Certificate[] chain = new X509Certificate[] {updateCert}; - PrivateKeyEntry newPrivateKeyEntry = new PrivateKeyEntry(partnerPrivKeyEntry.getPrivateKey(), chain); - - KeyStore keyStore = KeyStore.getInstance(KEY_STORE); - keyStore.load(null, getP12Pass()); - keyStore.setEntry(getKeyAlias(), newPrivateKeyEntry, new PasswordProtection (getP12Pass())); - - OutputStream outputStream = new FileOutputStream(partnerFilePath); - keyStore.store(outputStream, getP12Pass()); - outputStream.flush(); - outputStream.close(); - return true; - } - return false; - } - - private String getKeyAlias() { - return environment.getProperty("p12.key.alias", KEY_ALIAS); - } - - - public String getKeysDirPath(String certsDir, String moduleName) { - String domain = environment.getProperty(DOMAIN_URL, "localhost").replace("https://", "").replace("http://", "").replace("/", ""); - - String certsTargetDir = System.getProperty("java.io.tmpdir")+ File.separator + System.getProperty("parent.certs.folder.name", "AUTHCERTS"); - - if (System.getProperty("os.name").toLowerCase().contains("windows") == false) { - certsTargetDir = "/home/mosip/authcerts"; - } - - String certsModuleName = "IDA"; - - - if (certsDir != null && certsDir.length() != 0){ - certsTargetDir = certsDir; - } - - if (moduleName != null && moduleName.length() != 0){ - certsModuleName = moduleName; - } - return certsTargetDir + File.separator + certsModuleName + "-" + domain; - - } - - -} diff --git a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/PartnerTypes.java b/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/PartnerTypes.java deleted file mode 100644 index a9f5ed32f3..0000000000 --- a/authentication-demo-service/src/main/java/io/mosip/testrig/authentication/demo/service/helper/PartnerTypes.java +++ /dev/null @@ -1,20 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.helper; - -public enum PartnerTypes { - - DEVICE("device"), - RELYING_PARTY("rp"), - FTM("ftm"), - EKYC("ekyc"), - MISP("misp"); - - private String filePrepend; - - private PartnerTypes(String filePrepend) { - this.filePrepend = filePrepend; - } - - public String getFilePrepend() { - return this.filePrepend; - } -} diff --git a/authentication-demo-service/src/main/resources/application-dev.properties b/authentication-demo-service/src/main/resources/application-dev.properties deleted file mode 100644 index a66b7918be..0000000000 --- a/authentication-demo-service/src/main/resources/application-dev.properties +++ /dev/null @@ -1,580 +0,0 @@ -mosip.base.url=https://dev.mosip.net - -websub.publisher.url=http://localhost:9191/websub/publish -websub.hub.url=http://localhost:9191/websub/hub -websub.secret=Kslk30SNF2AChs2 - -ida.internal.jwtSign.url=${mosip.base.url}/idauthentication/v1/internal/jwtSign - -mosip.kernel.partner.allowed.domains=Auth,FTM,Device - -# Biometric Validation - uncomment and provide data or pass as VM args -#bio.test.server.provider=com.identy.IdentyBioSDK - -# ********** IdRepo **************** -mosip.kernel.jsonvalidator.property-source=CONFIG_SERVER -mosip.kernel.jsonvalidator.file-storage-uri=http://104.211.212.28:51000/kernel-idrepo-service/dev/DEV/ -mosip.kernel.jsonvalidator.schema-name=mosip-identity-json-schema.json -# ********** Common Properties **************** -ida-demo.api.version=v1 -server.port = 8082 -ida.authRequest.template={"consentObtained":true,"id":"mosip.identity.$authType","individualId":"$id","keyIndex":"string","request":"$encRequest","requestHMAC":"$encHmac","requestSessionKey":"$encSessionKey","requestTime":"$timestamp","transactionID":"$txn","version":"$ver","domainUri":"$domainUri","env":"$env","specVersion":"1.0","thumbprint":"$thumbprint"} -ida.kycExchangeRequest.template={"consentObtained":["true"],"locales":["eng"],"id":"mosip.identity.$authType","individualId":"$id","individualIdType":"$individualIdType","kycToken":"$kycToken","respType":"$respType","metadata":"$request","requestTime":"$timestamp","transactionID":"$txn","version":"$ver"} -otpRequestTemplate={\ - "id": "$reqId",\ - "individualId": "$id",\ - "otpChannel": [\ - $channels\ - ],\ - "requestTime": "$timestamp",\ - "transactionID": "$txn",\ - "version": "$ver"\ -} -server.servlet.context-path = /${ida-demo.api.version}/identity -logging.level.* = debug -# Application ID of IDA -application.id=IDA -#Application name of IDA -application.name=ID-Authentication - -# public key(Get public key using keymanager service and encode to base64) -publicKey.ida =TUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUFxWEpfMlZ1a0p0WWRtb0staGdqNkpJTlhraExheTBUT3MtNlZoTjF6Z1pEeTRVcXRqVzhoOFB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QUWdmZXVkSEpRb0EyLXNiZlp1TGdMMXVxM2tDQ1JpSzlPeFkzekk0TndtaFMwOEZLUVhCSjE5ODNLb0FsSDVrZndTOFZjc3VONUcyOGtfU2I2Y0pXX01ZZjlpMGd5RDhaY3FQa29CaGJkVUJBem1GaTd2TXhpV2ZpZFlDRWVqN0ZLMEJyaDhIRzdMSHNkd1Z0UldxbTNSTUtmSXRnRXVJZ1BzcmVpbU5mSXF2bHdKb25IUmtlR0pEcDM4Sk1EQkMweFZmVTA5cDMyYTFiZlJFMUppN2swTkhheEs1SThnRXdVMlN6ZG1NTE9RY2Jac19XbjZScDROVjlza3pEM21EMXdJcTZnTjNUZnlpNWhFZzVLV3p3eUMtNVdrRFhiazJVak02UkdTbG1PaXh1VEN3YlFJREFRQUI= -publicKey.internal=TUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUF0a1NuaVRCY3VOaFFOdm82aEhSS0V1TENnZHQxTEpnQ3BfQko1eDRuMjM1QVpzaEUwcmx6d3kzdE1UcTBTWW13YUNncXN4WE1sUkFCdVNNZ0xJdnI1aGg2UHY2NUtTdXdHdlJMMzNuQS1SbWpnVEZqOEIzRExfMktHSlBKLTIxRG1tLW9WZUxZTWd2Qm1ZM1U5M3hnYk15NXl5QnBOX3AtMHlnS2k4aVdCVDlkMWp1cHRoUU5sU2tBQ3hPV3RpU0tvTGhhNE12OHA4OHp5RGRiWWl2azdzNnlGT0xUWDFpX011WFhRSW5jQkVfVkx0ZTVVMHNRblJ4cV9JX2FVeTU5NHloQjRFUmsxS3AtbnBqMWJEWHZMaXZyZlByRTVYZjFkR1RQeDBnMEFSaFN1R2N4bUh1b1A1WDBoQ25CSmpmc3Q4ekhyWGU0MWVraEZNNmIxbDNQMFFJREFRQUI - - -# Reference ID used for crypto manager in authentication -partner.reference.id=PARTNER -# Reference ID used for crypto manager in internal authentication -internal.reference.id=INTERNAL -# Reference ID used for crypto manager in authentication for biometrics -partner.biometric.reference.id=IDA-FIR -# Reference ID used for crypto manager in internal authentication for biometrics -internal.biometric.reference.id=INTERNAL - -keysplitter=#KEY_SPLITTER# - - -ida.api.version=1.0 - -# ********* Postgres Properties ************ -javax.persistence.jdbc.driver=org.postgresql.Driver -javax.persistence.jdbc.url=jdbc:postgresql://localhost:5432/ida_db -javax.persistence.jdbc.user=postgres -javax.persistence.jdbc.password=admin - - -# ********* Hibernate Properties *********** -hibernate.dialect=org.hibernate.dialect.PostgreSQL95Dialect -hibernate.jdbc.lob.non_contextual_creation=true -#hibernate.hbm2ddl.auto=update -hibernate.show_sql=true -hibernate.format_sql=true -hibernate.connection.charSet=utf8 -hibernate.cache.use_second_level_cache=false -hibernate.cache.use_query_cache=false -hibernate.cache.use_structured_entries=false -hibernate.generate_statistics=false -spring.datasource.initialization-mode=never - - -# ******** Functional configurations ******** -datetime.pattern=yyyy-MM-dd'T'HH:mm:ss.SSS'Z' -date.pattern=yyyy-MM-dd -datetime.pattern.withzone=yyyy-MM-dd'T'HH:mm:ss.SSSXXX - - -demo.default.match.value=60 - -# ********* ADMIN Configurations ************ -authrequest.received-time-allowed.in-hours=24 - -#********* Store Private Key ********* -sample.privatekey.filepath={0}\Private_key - -mosip.kernel.encrypt-url=${mosip.base.url}/v1/keymanager/encrypt -mosip.kernel.decrypt-url=${mosip.base.url}/v1/keymanager/decrypt -mosip.kernel.publicKey-url=${mosip.base.url}/v1/keymanager/publickey/{appId} -kernel.validate.signature-url=${mosip.base.url}/v1/signature/validate - -mosip.ida.encrypt-url=${mosip.base.url}/idauthentication/v1/internal/encrypt -mosip.ida.decrypt-url=${mosip.base.url}/idauthentication/v1/internal/decrypt -mosip.ida.publicKey-url=${mosip.base.url}/idauthentication/v1/internal/getCertificate -mosip.ida.validate.signature-url=${mosip.base.url}/idauthentication/v1/internal/validate - -#Auth token -auth-token-generator.rest.uri=${mosip.base.url}/v1/authmanager/authenticate/clientidsecretkey -auth-token-generator.rest.clientId=mosip-resident-client -auth-token-generator.rest.secretKey=abc123 -auth-token-generator.rest.appId=resident - - -auth-token-generator-user.rest.uri=${mosip.base.url}/v1/authmanager/authenticate/useridPwd -auth-token-generator-user.rest.userName=110006 -auth-token-generator-user.rest.password=mosip -auth-token-generator-user.rest.appId=ida - -add-device-provider-url=${mosip.base.url}/v1/masterdata/deviceprovider -add-device-provider-request-template={\ - "address": "test",\ - "certificateAlias": "added",\ - "contactNumber": "9663175928",\ - "email": "test@mosip.io",\ - "isActive": true,\ - "vendorName": "$DEVICE_PROVIDER_NAME"\ -} - -add-mds-request-url=${mosip.base.url}/v1/masterdata/mosipdeviceservice -add-mds-request-template={\ - "isActive": true,\ - "deviceProviderId": "$DEVICE_PROVIDER_ID",\ - "make": "$MAKE",\ - "model": "$MODEL",\ - "regDeviceSubCode": "$DEVICE_SUB_TYPE_CODE",\ - "regDeviceTypeCode": "$DEVICE_TYPE_CODE",\ - "swBinaryHash": "test",\ - "swCreateDateTime": "2019-11-19T07:00:13.375Z",\ - "swExpiryDateTime": "2019-11-30T07:00:13.375Z",\ - "swVersion": "$SERVICE_VERSION"\ -} - -add-device-request-url=${mosip.base.url}/v1/masterdata/registereddevices -add-device-request-template={\ - "deviceData": {\ - "deviceId": "70959dd5-e45f-438a-9ff8-9b263908e572",\ - "purpose": "$PURPOSE",\ - "deviceInfo": {\ - "deviceSubId": "$DEVICE_SUB_ID",\ - "certification": "L0",\ - "digitalId": {\ - "serialNo": "$SERIAL_NO",\ - "deviceProvider": "$DEVICE_PROVIDER_NAME",\ - "deviceProviderId": "$DEVICE_PROVIDER_ID",\ - "make": "$MAKE",\ - "model": "$MODEL",\ - "dateTime": "2020-01-13T07:20:42.195Z",\ - "type": "$DEVICE_TYPE_CODE",\ - "subType": "$DEVICE_SUB_TYPE_CODE"\ - },\ - "firmware": "firmware",\ - "deviceExpiry": "2020-01-13T12:50:42.196Z",\ - "timeStamp": "2020-01-13T12:50:42.208Z"\ - },\ - "foundationalTrustProviderId": ""\ - }\ -} - -validate-device-request-url=${mosip.base.url}/v1/masterdata/deviceprovidermanagement/validate -validate-device-request-template={\ - "deviceCode": "$DEVICE_CODE",\ - "digitalId": {\ - "serialNo": "$SERIAL_NO",\ - "dp": "$DEVICE_PROVIDER_NAME",\ - "dpId": "$DEVICE_PROVIDER_ID",\ - "make": "$MAKE",\ - "model": "$MODEL",\ - "type": "$DEVICE_TYPE",\ - "subType": "$DEVICE_SUB_TYPE",\ - "dateTime": "2019-12-05T10:41:15.052Z"\ - },\ - "deviceServiceVersion": "$SERVICE_VERSION"\ -} - -dev.master.db.url=jdbc:postgresql://104.211.208.136:9001/mosip_master -qa.master.db.url=jdbc:postgresql://52.172.54.231:9001/mosip_master -int.master.db.url=jdbc:postgresql://104.211.202.203:9001/mosip_master -ext-int.master.db.url=jdbc:postgresql://52.172.14.84:9001/mosip_master -preprod.master.db.url=jdbc:postgresql://150.10.40.12:9001/mosip_master - -master.db.user=bWFzdGVydXNlcg -master.db.pass=TW9zaXBAZGV2MTIz - -dev.ida.db.url=jdbc:postgresql://104.211.208.136:9001/mosip_ida -qa.ida.db.url=jdbc:postgresql://52.172.54.231:9001/mosip_ida -int.ida.db.url=jdbc:postgresql://104.211.202.203:9001/mosip_ida -ext-int.ida.db.url=jdbc:postgresql://52.172.14.84:9001/mosip_ida -preprod.ida.db.url=jdbc:postgresql://104.211.242.168:9001/mosip_ida - -ida.db.user=aWRhdXNlcg -ida.db.pass=TW9zaXBAZGV2MTIz - -mosip.ida.publickey=IDA - -#---------------Global Config----------------- - - -#Kernel-idobjectalidator -# Plug in property source as either 'LOCAL' or 'CONFIG_SERVER' or 'APPLICATION_CONTEXT' through this key -mosip.kernel.idobjectvalidator.property-source=APPLICATION_CONTEXT -mosip.kernel.idobjectvalidator.schema-name=mosip-identity-json-schema.json -mosip.kernel.idobjectvalidator.file-storage-uri=${spring.cloud.config.uri}/${spring.application.name}/${spring.profiles.active}/${spring.cloud.config.label}/ - -mosip.kernel.idobjectvalidator.masterdata.languages.rest.uri=${mosip.base.url}/v1/masterdata/languages -mosip.kernel.idobjectvalidator.masterdata.gendertypes.rest.uri=${mosip.base.url}/v1/masterdata/gendertypes -mosip.kernel.idobjectvalidator.masterdata.documentcategories.rest.uri=${mosip.base.url}/v1/masterdata/documentcategories -mosip.kernel.idobjectvalidator.masterdata.documenttypes.rest.uri=${mosip.base.url}/v1/masterdata/documenttypes/{documentcategorycode}/{langcode} -mosip.kernel.idobjectvalidator.masterdata.locations.rest.uri=${mosip.base.url}/v1/masterdata/locations/{langcode} -mosip.kernel.idobjectvalidator.masterdata.locationhierarchy.rest.uri=${mosip.base.url}/v1/masterdata/locations/locationhierarchy/{hierarchyname} - -mosip.kernel.idobjectvalidator.mandatory-attributes.id-repository.new-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus -mosip.kernel.idobjectvalidator.mandatory-attributes.pre-registration.new-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus -mosip.kernel.idobjectvalidator.mandatory-attributes.reg-client.new-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus -mosip.kernel.idobjectvalidator.mandatory-attributes.reg-processor.new-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus -mosip.kernel.idobjectvalidator.mandatory-attributes.pre-registration.child-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus -mosip.kernel.idobjectvalidator.mandatory-attributes.reg-client.child-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus,parentOrGuardianName,parentOrGuardianRID|parentOrGuardianUIN,parentOrGuardianBiometrics -mosip.kernel.idobjectvalidator.mandatory-attributes.reg-processor.child-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus,parentOrGuardianName,parentOrGuardianRID|parentOrGuardianUIN,parentOrGuardianBiometrics - -# Business Validation for ID Schema attributes - These should not be changed, as it impacts all modules -mosip.id.validation.identity.dateOfBirth=^(19\\d\\d|20\\d\\d)/([0][1-9]|1[0-2])/([0][1-9]|[1-2]\\d|3[01])$ -mosip.id.validation.identity.phone=^([6-9]{1})([0-9]{9})$ -mosip.id.validation.identity.email=^[\\w-\\+]+(\\.[\\w]+)*@[\\w-]+(\\.[\\w]+)*(\\.[a-zA-Z]{2,})$ -mosip.id.validation.identity.postalCode=^[(?i)A-Z0-9]{5}$ -mosip.id.validation.identity.age=^(150|1[0-4][0-9]|[1-9]?[0-9])$ -mosip.id.validation.identity.fullName.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.addressLine1.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.addressLine2.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.addressLine3.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.region.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.province.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.city.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.[*].[*].language=^[(?i)a-z]{3}$ -mosip.id.validation.identity.referenceIdentityNumber=^([0-9]{10,30})$ -mosip.country.code=MOR - -# Language Supported By Platform - ISO -mosip.supported-languages=eng,ara,fra - -mosip.primary-language=eng -mosip.secondary-language=ara - -# Application IDs -mosip.prereg.app-id=PRE_REGISTRATION -mosip.reg.app-id=REGISTRATION -mosip.regproc.app-id=REGISTRATION_PROCESSOR -mosip.ida.app-id=IDA -mosip.idrepo.app-id=ID_REPO - -# UTC ISO Date Time Pattern -mosip.utc-datetime-pattern=yyyy-MM-dd'T'HH:mm:ss.SSS'Z' - -mosip.signed.response.header=response-signature - - -#----------------------- CBEFF Util-------------------------------------------------- -# Cbeff URL where the files will be stored in git, change it accordingly in case of change of storage location. -mosip.kernel.xsdstorage-uri=${spring.cloud.config.uri}/${spring.application.name}/${spring.profiles.active}/${spring.cloud.config.label}/ -# Cbeff XSD file name in config server -mosip.kernel.xsdfile=mosip-cbeff-extint.xsd - -#----------------------------- Applicant Type -------------------------------------------------- -mosip.kernel.applicant.type.age.limit = 5 - -#----------------------------- Static PIN -------------------------------------------------- -mosip.kernel.pin.length=6 - -#-----------------------------TspId ----------------------------------------------- -#length of the Tsp id -mosip.kernel.tspid.length=4 - -#-----------------------------partnerId ----------------------------------------------- -#length of the partner id -mosip.kernel.partnerid.length=4 - -#-----------------------------TOKEN-ID Properties--------------------------------- -#lenght of the token id -mosip.kernel.tokenid.length=36 - -#-----------------------------Registration Center Id ----------------------------------------------- -#length of the registration center id -mosip.kernel.registrationcenterid.length=5 - -#-----------------------------Machine Id ----------------------------------------------- -#length of the machine id -mosip.kernel.machineid.length=5 - -#-----------------------------RID Properties--------------------------------------- -# length of the rid -mosip.kernel.rid.length=29 -# length of the timestamp -mosip.kernel.rid.timestamp-length=14 -# rid sequence max digits -mosip.kernel.rid.sequence-length=5 - -# Upper bound of number of digits in sequence allowed in id. For example if -# limit is 3, then 12 is allowed but 123 is not allowed in id (in both -# ascending and descending order) -mosip.kernel.tokenid.sequence-limit=3 - -#-----------------------------PRID Properties------------------------------------ - -#prid-length -mosip.kernel.prid.length=14 - -# Upper bound of number of digits in sequence allowed in id. For example if -# limit is 3, then 12 is allowed but 123 is not allowed in id (in both -# ascending and descending order) -#to disable validation assign zero or negative value -mosip.kernel.prid.sequence-limit=3 - -# Number of digits in repeating block allowed in id. For example if limit is 2, -# then 4xxx4 is allowed but 48xxx48 is not allowed in id (x is any digit) -#to disable validation assign zero or negative value -mosip.kernel.prid.repeating-block-limit=3 - - -# Lower bound of number of digits allowed in between two repeating digits in -# id. For example if limit is 2, then 11 and 1x1 is not allowed in id (x is any digit) to disable validation assign zero or negative value -mosip.kernel.prid.repeating-limit=2 - -# list of number that id should not be start with to disable null -mosip.kernel.prid.not-start-with=0,1 - -#restricted numbers for prid -mosip.kernel.prid.restricted-numbers=786,666 - - -#-----------------------------VID Properties-------------------------------------- -# length of the vid -mosip.kernel.vid.length=16 - -# Upper bound of number of digits in sequence allowed in id. For example if -# limit is 3, then 12 is allowed but 123 is not allowed in id (in both -# ascending and descending order) -# to disable sequence limit validation assign 0 or negative value -mosip.kernel.vid.length.sequence-limit=3 - -# Number of digits in repeating block allowed in id. For example if limit is 2, -# then 4xxx4 is allowed but 48xxx48 is not allowed in id (x is any digit) -# to disable repeating block validation assign 0 or negative value -mosip.kernel.vid.length.repeating-block-limit=2 - - -# Lower bound of number of digits allowed in between two repeating digits in -# id. For example if limit is 2, then 11 and 1x1 is not allowed in id (x is any digit) -# to disable repeating limit validation, assign 0 or negative value -mosip.kernel.vid.length.repeating-limit=2 - -# list of number that id should not be start with -# to disable null -mosip.kernel.vid.not-start-with=0,1 - -#restricted numbers for vid -mosip.kernel.vid.restricted-numbers=786,666 - -#-----------------------------UIN Properties-------------------------------------- -#length of the uin -mosip.kernel.uin.length=10 -#minimum threshold of unused uin -mosip.kernel.uin.min-unused-threshold=200000 -#number of uins to generate -mosip.kernel.uin.uins-to-generate=500000 -#restricted numbers for uin -mosip.kernel.uin.restricted-numbers=786,666 - -# Upper bound of number of digits in sequence allowed in id. For example if -# limit is 3, then 12 is allowed but 123 is not allowed in id (in both -# ascending and descending order) -# to disable sequence limit validation assign 0 or negative value -mosip.kernel.uin.length.sequence-limit=3 - -# Number of digits in repeating block allowed in id. For example if limit is 2, -# then 4xxx4 is allowed but 48xxx48 is not allowed in id (x is any digit) -#to disable validation assign zero or negative value -mosip.kernel.uin.length.repeating-block-limit=2 - -# Lower bound of number of digits allowed in between two repeating digits in -# id. For example if limit is 2, then 11 and 1x1 is not allowed in id (x is any digit) -# to disable repeating limit validation, assign 0 or negative value -mosip.kernel.uin.length.repeating-limit=2 - -#reverse group digit limit for uin filter -mosip.kernel.uin.length.reverse-digits-limit=5 - -#group digit limit for uin filter -mosip.kernel.uin.length.digits-limit=5 - -#should not start with -mosip.kernel.uin.not-start-with=0,1 - -#adjacent even digit limit for uin filter -mosip.kernel.uin.length.conjugative-even-digits-limit=3 - - - - -#----------------------- SMS Service-------------------------------------- -mosip.kernel.sms.country.code=91 -mosip.kernel.sms.number.length=10 - - -#------------------------Auth-Adapter----------------------------------------------- -auth.server.validate.url=${mosip.base.url}/v1/authmanager/authorize/validateToken -auth.jwt.secret=authjwtsecret -auth.jwt.base=Mosip-Token - - -#----------------------- Crypto -------------------------------------------------- -#Crypto asymmetric algorithm name -mosip.kernel.crypto.asymmetric-algorithm-name=RSA/ECB/OAEPWITHSHA-256ANDMGF1PADDING -#Crypto symmetric algorithm name -mosip.kernel.crypto.symmetric-algorithm-name=AES/GCM/PKCS5Padding -#Keygenerator asymmetric algorithm name -mosip.kernel.keygenerator.asymmetric-algorithm-name=RSA -#Keygenerator symmetric algorithm name -mosip.kernel.keygenerator.symmetric-algorithm-name=AES -#Asymmetric algorithm key length -mosip.kernel.keygenerator.asymmetric-key-length=2048 -#Symmetric algorithm key length -mosip.kernel.keygenerator.symmetric-key-length=256 - -#Encrypted data and encrypted symmetric key separator -mosip.kernel.data-key-splitter=#KEY_SPLITTER# -#GCM tag length -mosip.kernel.crypto.gcm-tag-length=128 -#Hash algo name -mosip.kernel.crypto.hash-algorithm-name=PBKDF2WithHmacSHA512 -#Symmtric key length used in hash -mosip.kernel.crypto.hash-symmetric-key-length=256 -#No of iterations in hash -mosip.kernel.crypto.hash-iteration=100000 -#Sign algo name -mosip.kernel.crypto.sign-algorithm-name=RS512 - -mosip.kernel.keymanager-service-publickey-url=${mosip.base.url}/v1/keymanager/publickey/{applicationId} -mosip.kernel.keymanager-service-decrypt-url=${mosip.base.url}/v1/keymanager/decrypt -mosip.kernel.keymanager-service-auth-decrypt-url=${mosip.base.url}/v1/keymanager/auth/decrypt -mosip.kernel.keymanager-service-sign-url=${mosip.base.url}/v1/keymanager/sign -mosip.sign.applicationid=KERNEL -mosip.sign.refid=SIGN -mosip.kernel.cryptomanager.request_id=CRYPTOMANAGER.REQUEST -mosip.kernel.cryptomanager.request_version=v1.0 -mosip.kernel.signature.signature-request-id=SIGNATURE.REQUEST -mosip.kernel.signature.signature-version-id=v1.0 - - - -#----------------------------------ID Repo------------------------------------------ -mosip.idrepo.identity.uin-status.registered=ACTIVATED -mosip.idrepo.identity.uin-status=ACTIVATED,BLOCKED,DEACTIVATED - -#---------------------------------------otp manager service------------------------------- -#the default length for otp(in number) -mosip.kernel.otp.default-length=6 -#the default crypto function -#It can be: HmacSHA512, HmacSHA256, HmacSHA1. -mosip.kernel.otp.mac-algorithm=HmacSHA512 -#the OTP expires after the given time(in seconds). -mosip.kernel.otp.expiry-time=180 -#the key is freezed for the given time(in seconds). -mosip.kernel.otp.key-freeze-time=1800 -#the number of validation attempts allowed(in number). -#mosip.kernel.otp.validation-attempt-threshold =3 means , the validation and generation will be blocked from 4th time. -mosip.kernel.otp.validation-attempt-threshold=10 -#minimum length of key(in number). -mosip.kernel.otp.min-key-length=3 -#maximum length of key(in number). -mosip.kernel.otp.max-key-length=64 - - -#--------------------------------------Licensekeymanager Service-------------------------------------- -#the license key length. -mosip.kernel.licensekey.length=16 -#List of permissions -# NOTE: ',' in the below list is used as splitter in the implementation. -# Use of ',' in the values for below key should be avoided. -# Use of spaces before and after ',' also should be avoided. -mosip.kernel.licensekey.permissions=OTP Trigger,OTP Authentication,Demo Authentication - Identity Data Match,Demo Authentication - Address Data Match,Demo Authentication - Full Address Data Match,Demo Authentication - Secondary Language Match,Biometric Authentication - FMR Data Match,Biometric Authentication - IIR Data Match,Biometric Authentication - FID Data Match,Static Pin Authentication,eKYC - limited,eKYC - Full,eKYC - No - - - -#-----------------------------Virus Scanner-------------------------------------- -#Virus Scanner server url -mosip.kernel.virus-scanner.host=10.0.2.7 -#Virus Scanner server port -mosip.kernel.virus-scanner.port=3310 - - - -#-------------------------------FS Adapter- HDFS ------------------------------- -# Name node url for HDFS - Non Secured -mosip.kernel.fsadapter.hdfs.name-node-url=hdfs://13.71.117.37:51000 -# Name node url for HDFS - Secured (auth enabled) -#mosip.kernel.fsadapter.hdfs.name-node-url=hdfs://13.71.117.37:51000 -# Enable if hadoop security authorization is 'true', default is false -mosip.kernel.fsadapter.hdfs.authentication-enabled=false -# HDFS log level. Change this to debug to see hdfs logs -logging.level.org.apache.hadoop=warn -# If HDFS is security is configured with Kerberos, Key Distribution Center domain -mosip.kernel.fsadapter.hdfs.kdc-domain=HDFSKERBEROS1.SOUTHINDIA.CLOUDAPP.AZURE.COM -# Username to access hdfs. Change this to application username (regprocessor,prereg or idrepo) -#mosip.kernel.fsadapter.hdfs.user-name=mosipuser -#keytab file path, must be set if authentication-enable is true -#read keytab file both classpath and physical path ,append appropriate prefix -#for classpath prefix classpath:mosip.keytab -#for physical path prefix file:/home/keys/mosip.keytab -mosip.kernel.fsadapter.hdfs.keytab-file=classpath:mosip.keytab - - - -#---------------Transliteration----------------------- -mosip.kernel.transliteration.arabic-language-code=ara -mosip.kernel.transliteration.franch-language-code=fra - - -#-------Registration processor Notification types------------ -mosip.registration.processor.notification.types=SMS|EMAIL - - -mosip.default.dob.month=01 -mosip.default.dob.day=01 -mosip.login.mode= email,mobile - - -#---Language orientation----- -mosip.right_to_left_orientation=ara -mosip.left_to_right_orientation=eng,fra - - -#**************** Notification Type ************* -mosip.notificationtype=SMS|EMAIL -#******** Notification lanugage types - either PRIMARY or BOTH ******** -mosip.notification.language-type=BOTH - - -#-------------------System--------------- -logging.level.org.springframework.web.filter.CommonsRequestLoggingFilter=INFO - -#-------------------Encryption and Decryption--------------------------- -mosip.kernel.encrypt.url=${mosip.base.url}/v1/keymanager/encrypt -mosip.kernel.decrypt.url=${mosip.base.url}/v1/keymanager/decrypt - -#------------------PDF Genration----------------------------------------- -mosip.kernel.pdf_owner_password=somepassword - -#-------UIN Alias------------------- -mosip.uin.alias= - - -#------------------Quality Check----------------------------------------- -#Quality threshold for applicant iris -mosip.iris_threshold=0 -#Quality threshold for applicant leftslap fingerprint -mosip.leftslap_fingerprint_threshold=0 -#Quality threshold for applicant rightslap fingerprint -mosip.rightslap_fingerprint_threshold=0 -#Quality threshold for applicant thumbs fingerprint -mosip.thumbs_fingerprint_threshold=0 -#Quality threshold for applicant face -mosip.facequalitythreshold=0 -#Bio SDK Integration -mosip.fingerprint.provider=ai.tech5.auth.service.T5AuthFingerImpl -mosip.face.provider=ai.tech5.auth.service.T5AuthFaceImpl -mosip.iris.provider=ai.tech5.auth.service.T5AuthIrisImpl - -#openapi properties to sort tag and operations of id-authentication services -springdoc.swagger-ui.tagsSorter=alpha -springdoc.swagger-ui.operationsSorter=alpha - diff --git a/authentication-demo-service/src/main/resources/application.properties b/authentication-demo-service/src/main/resources/application.properties deleted file mode 100644 index 435d631de7..0000000000 --- a/authentication-demo-service/src/main/resources/application.properties +++ /dev/null @@ -1,586 +0,0 @@ -subdomain=dev -mosip.api.public.host=api.${subdomain}.mosip.net -mosip.api.internal.host=api-internal.${subdomain}.mosip.net -mosip.api.internal.url=https://${mosip.api.internal.host} -mosip.base.url=${mosip.api.internal.url} - -websub.publisher.url=http://localhost:9191/websub/publish -websub.hub.url=http://localhost:9191/websub/hub -websub.secret=Kslk30SNF2AChs2 - -ida.internal.jwtSign.url=${mosip.base.url}/idauthentication/v1/internal/jwtSign - -mosip.kernel.partner.allowed.domains=Auth,FTM,Device - -# Biometric Validation - uncomment and provide data or pass as VM args -#bio.test.server.provider=com.identy.IdentyBioSDK - -# ********** IdRepo **************** -mosip.kernel.jsonvalidator.property-source=CONFIG_SERVER -mosip.kernel.jsonvalidator.file-storage-uri=http://104.211.212.28:51000/kernel-idrepo-service/dev/DEV/ -mosip.kernel.jsonvalidator.schema-name=mosip-identity-json-schema.json -# ********** Common Properties **************** -ida-demo.api.version=v1 -server.port = 8082 -ida.authRequest.template={"consentObtained":true,"id":"mosip.identity.$authType","individualId":"$id","keyIndex":"string","request":"$encRequest","requestHMAC":"$encHmac","requestSessionKey":"$encSessionKey","requestTime":"$timestamp","transactionID":"$txn","version":"$ver","domainUri":"$domainUri","env":"$env","specVersion":"1.0","thumbprint":"$thumbprint"} -ida.kycExchangeRequest.template={"consentObtained":["true"],"locales":["eng"],"id":"mosip.identity.$authType","individualId":"$id","individualIdType":"$individualIdType","kycToken":"$kycToken","respType":"$respType","metadata":"$request","requestTime":"$timestamp","transactionID":"$txn","version":"$ver"} -ida.vciExchangeRequest.template={"consentObtained":["true"],"locales":["eng"],"id":"mosip.identity.$authType","individualId":"$id","individualIdType":"$individualIdType","kycToken":"$kycToken","respType":"$respType","metadata":"$request","requestTime":"$timestamp","transactionID":"$txn","version":"$ver","vcAuthToken":"$vcAuthToken","credSubjectId":"$credSubjectId","vcAuthToken":"$vcAuthToken","vcFormat":"$vcFormat"} -otpRequestTemplate={\ - "id": "$reqId",\ - "individualId": "$id",\ - "otpChannel": [\ - $channels\ - ],\ - "requestTime": "$timestamp",\ - "transactionID": "$txn",\ - "version": "$ver"\ -} -server.servlet.context-path = /${ida-demo.api.version}/identity -logging.level.* = debug -# Application ID of IDA -application.id=IDA -#Application name of IDA -application.name=ID-Authentication - -# public key(Get public key using keymanager service and encode to base64) -publicKey.ida =TUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUFxWEpfMlZ1a0p0WWRtb0staGdqNkpJTlhraExheTBUT3MtNlZoTjF6Z1pEeTRVcXRqVzhoOFBpN09uaWdSRFRPak5QWXVvaTllUzlPZUoxVW13R3J0WkkzZ3pFRXprRmJWdVlqSjc0UElGeUVNaXc5WjRpdktNUTRLLXl4MExfOGVZLU9GNVc0Nlo4dms2aU1EZGdyNGNlNFdFUjJHOV9xU1BnNWx2YVc4aTZneE8taHZNZG5Mc09Hb25Qc18zdVZCeWhIVk51TWJ4YURXSnZhdlAwUl8zamdadkUyNXcySW4wY1dqU2tYbjFsWDgxVFliNllkZ29PTWNaT0xuZEN1YmZlMXJsRnpta3c0RXNPOWkwRThmYXBoZWlTQlVMSHQ4U3Z0U3VmUm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Y2Jac19XbjZScDROVjlza3pEM21EMXdJcTZnTjNUZnlpNWhFZzVLV3p3eUMtNVdrRFhiazJVak02UkdTbG1PaXh1VEN3YlFJREFRQUI= -publicKey.internal=TUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUF0a1NuaVRCY3VOaFFOdm82aEhSS0V1TENnZHQxTEpnQ3BfQko1eDRuMjM1QVpzaEUwcmx6d3kzdE1UcTBTWW13YUNncXN4WE1sUkFCdVNNZ0xJdnI1aGg2UHY2NUtTdXdHdlJMMzNuQS1SbWpnVEZqOEIzRExfMktHSlBKLTIxRG1tLW9WZUxZTWd2Qm1ZM1U5M3hnYk15NXl5QnBOX3AtMHlnS2k4aVdCVDlkMWp1cHRoUU5sU2tBQ3hPV3RpU0tvTGhhNE12OHA4OHp5RGRiWWl2azdzNnlGT0xUWDFpX011WFhRSW5jQkVfVkx0ZTVVMHNRblJ4cV9JX2FVeTU5NHloQjRFUmsxS3AtbnBqMWJEWHZMaXZyZlByRTVYZjFkR1RQeDBnMEFSaFN1R2N4bUh1b1A1WDBoQ25CSmpmc3Q4ekhyWGU0MWVraEZNNmIxbDNQMFFJREFRQUI - - -# Reference ID used for crypto manager in authentication -partner.reference.id=PARTNER -# Reference ID used for crypto manager in internal authentication -internal.reference.id=INTERNAL -# Reference ID used for crypto manager in authentication for biometrics -partner.biometric.reference.id=IDA-FIR -# Reference ID used for crypto manager in internal authentication for biometrics -internal.biometric.reference.id=INTERNAL - -keysplitter=#KEY_SPLITTER# - - -ida.api.version=1.0 - -# ********* Postgres Properties ************ -javax.persistence.jdbc.driver=org.postgresql.Driver -javax.persistence.jdbc.url=jdbc:postgresql://localhost:5432/ida_db -javax.persistence.jdbc.user=postgres -javax.persistence.jdbc.password=postgres - - -# ********* Hibernate Properties *********** -hibernate.dialect=org.hibernate.dialect.PostgreSQL95Dialect -hibernate.jdbc.lob.non_contextual_creation=true -#hibernate.hbm2ddl.auto=update -hibernate.show_sql=true -hibernate.format_sql=true -hibernate.connection.charSet=utf8 -hibernate.cache.use_second_level_cache=false -hibernate.cache.use_query_cache=false -hibernate.cache.use_structured_entries=false -hibernate.generate_statistics=false -spring.datasource.initialization-mode=never - - -# ******** Functional configurations ******** -datetime.pattern=yyyy-MM-dd'T'HH:mm:ss.SSS'Z' -date.pattern=yyyy-MM-dd -datetime.pattern.withzone=yyyy-MM-dd'T'HH:mm:ss.SSSXXX - - -demo.default.match.value=60 - -# ********* ADMIN Configurations ************ -authrequest.received-time-allowed.in-hours=24 - -#********* Store Private Key ********* -sample.privatekey.filepath={0}\Private_key - -mosip.kernel.encrypt-url=${mosip.base.url}/v1/keymanager/encrypt -mosip.kernel.decrypt-url=${mosip.base.url}/v1/keymanager/decrypt -mosip.kernel.publicKey-url=${mosip.base.url}/v1/keymanager/publickey/{appId} -kernel.validate.signature-url=${mosip.base.url}/v1/signature/validate - -mosip.ida.encrypt-url=${mosip.base.url}/idauthentication/v1/internal/encrypt -mosip.ida.decrypt-url=${mosip.base.url}/idauthentication/v1/internal/decrypt -mosip.ida.publicKey-url=${mosip.base.url}/idauthentication/v1/internal/getCertificate -mosip.ida.validate.signature-url=${mosip.base.url}/idauthentication/v1/internal/validate - -#Auth token -auth-token-generator.rest.uri=${mosip.base.url}/v1/authmanager/authenticate/clientidsecretkey -auth-token-generator.rest.clientId=mosip-resident-client -auth-token-generator.rest.secretKey=${mosip_resident_client_secret} -auth-token-generator.rest.appId=resident - - -auth-token-generator-user.rest.uri=${mosip.base.url}/v1/authmanager/authenticate/useridPwd -auth-token-generator-user.rest.userName=110006 -auth-token-generator-user.rest.password=mosip -auth-token-generator-user.rest.appId=ida - -add-device-provider-url=${mosip.base.url}/v1/masterdata/deviceprovider -add-device-provider-request-template={\ - "address": "test",\ - "certificateAlias": "added",\ - "contactNumber": "9663175928",\ - "email": "test@mosip.io",\ - "isActive": true,\ - "vendorName": "$DEVICE_PROVIDER_NAME"\ -} - -add-mds-request-url=${mosip.base.url}/v1/masterdata/mosipdeviceservice -add-mds-request-template={\ - "isActive": true,\ - "deviceProviderId": "$DEVICE_PROVIDER_ID",\ - "make": "$MAKE",\ - "model": "$MODEL",\ - "regDeviceSubCode": "$DEVICE_SUB_TYPE_CODE",\ - "regDeviceTypeCode": "$DEVICE_TYPE_CODE",\ - "swBinaryHash": "test",\ - "swCreateDateTime": "2019-11-19T07:00:13.375Z",\ - "swExpiryDateTime": "2019-11-30T07:00:13.375Z",\ - "swVersion": "$SERVICE_VERSION"\ -} - -add-device-request-url=${mosip.base.url}/v1/masterdata/registereddevices -add-device-request-template={\ - "deviceData": {\ - "deviceId": "70959dd5-e45f-438a-9ff8-9b263908e572",\ - "purpose": "$PURPOSE",\ - "deviceInfo": {\ - "deviceSubId": "$DEVICE_SUB_ID",\ - "certification": "L0",\ - "digitalId": {\ - "serialNo": "$SERIAL_NO",\ - "deviceProvider": "$DEVICE_PROVIDER_NAME",\ - "deviceProviderId": "$DEVICE_PROVIDER_ID",\ - "make": "$MAKE",\ - "model": "$MODEL",\ - "dateTime": "2020-01-13T07:20:42.195Z",\ - "type": "$DEVICE_TYPE_CODE",\ - "subType": "$DEVICE_SUB_TYPE_CODE"\ - },\ - "firmware": "firmware",\ - "deviceExpiry": "2020-01-13T12:50:42.196Z",\ - "timeStamp": "2020-01-13T12:50:42.208Z"\ - },\ - "foundationalTrustProviderId": ""\ - }\ -} - -validate-device-request-url=${mosip.base.url}/v1/masterdata/deviceprovidermanagement/validate -validate-device-request-template={\ - "deviceCode": "$DEVICE_CODE",\ - "digitalId": {\ - "serialNo": "$SERIAL_NO",\ - "dp": "$DEVICE_PROVIDER_NAME",\ - "dpId": "$DEVICE_PROVIDER_ID",\ - "make": "$MAKE",\ - "model": "$MODEL",\ - "type": "$DEVICE_TYPE",\ - "subType": "$DEVICE_SUB_TYPE",\ - "dateTime": "2019-12-05T10:41:15.052Z"\ - },\ - "deviceServiceVersion": "$SERVICE_VERSION"\ -} - -dev.master.db.url=jdbc:postgresql://104.211.208.136:9001/mosip_master -qa.master.db.url=jdbc:postgresql://52.172.54.231:9001/mosip_master -int.master.db.url=jdbc:postgresql://104.211.202.203:9001/mosip_master -ext-int.master.db.url=jdbc:postgresql://52.172.14.84:9001/mosip_master -preprod.master.db.url=jdbc:postgresql://150.10.40.12:9001/mosip_master - -master.db.user=bWFzdGVydXNlcg -master.db.pass=TW9zaXBAZGV2MTIz - -dev.ida.db.url=jdbc:postgresql://104.211.208.136:9001/mosip_ida -qa.ida.db.url=jdbc:postgresql://52.172.54.231:9001/mosip_ida -int.ida.db.url=jdbc:postgresql://104.211.202.203:9001/mosip_ida -ext-int.ida.db.url=jdbc:postgresql://52.172.14.84:9001/mosip_ida -preprod.ida.db.url=jdbc:postgresql://104.211.242.168:9001/mosip_ida - -ida.db.user=aWRhdXNlcg -ida.db.pass=TW9zaXBAZGV2MTIz - -mosip.ida.publickey=IDA - -#---------------Global Config----------------- - - -#Kernel-idobjectalidator -# Plug in property source as either 'LOCAL' or 'CONFIG_SERVER' or 'APPLICATION_CONTEXT' through this key -mosip.kernel.idobjectvalidator.property-source=APPLICATION_CONTEXT -mosip.kernel.idobjectvalidator.schema-name=mosip-identity-json-schema.json -mosip.kernel.idobjectvalidator.file-storage-uri=${spring.cloud.config.uri}/${spring.application.name}/${spring.profiles.active}/${spring.cloud.config.label}/ - -mosip.kernel.idobjectvalidator.masterdata.languages.rest.uri=${mosip.base.url}/v1/masterdata/languages -mosip.kernel.idobjectvalidator.masterdata.gendertypes.rest.uri=${mosip.base.url}/v1/masterdata/gendertypes -mosip.kernel.idobjectvalidator.masterdata.documentcategories.rest.uri=${mosip.base.url}/v1/masterdata/documentcategories -mosip.kernel.idobjectvalidator.masterdata.documenttypes.rest.uri=${mosip.base.url}/v1/masterdata/documenttypes/{documentcategorycode}/{langcode} -mosip.kernel.idobjectvalidator.masterdata.locations.rest.uri=${mosip.base.url}/v1/masterdata/locations/{langcode} -mosip.kernel.idobjectvalidator.masterdata.locationhierarchy.rest.uri=${mosip.base.url}/v1/masterdata/locations/locationhierarchy/{hierarchyname} - -mosip.kernel.idobjectvalidator.mandatory-attributes.id-repository.new-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus -mosip.kernel.idobjectvalidator.mandatory-attributes.pre-registration.new-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus -mosip.kernel.idobjectvalidator.mandatory-attributes.reg-client.new-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus -mosip.kernel.idobjectvalidator.mandatory-attributes.reg-processor.new-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus -mosip.kernel.idobjectvalidator.mandatory-attributes.pre-registration.child-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus -mosip.kernel.idobjectvalidator.mandatory-attributes.reg-client.child-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus,parentOrGuardianName,parentOrGuardianRID|parentOrGuardianUIN,parentOrGuardianBiometrics -mosip.kernel.idobjectvalidator.mandatory-attributes.reg-processor.child-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus,parentOrGuardianName,parentOrGuardianRID|parentOrGuardianUIN,parentOrGuardianBiometrics - -# Business Validation for ID Schema attributes - These should not be changed, as it impacts all modules -mosip.id.validation.identity.dateOfBirth=^(19\\d\\d|20\\d\\d)/([0][1-9]|1[0-2])/([0][1-9]|[1-2]\\d|3[01])$ -mosip.id.validation.identity.phone=^([6-9]{1})([0-9]{9})$ -mosip.id.validation.identity.email=^[\\w-\\+]+(\\.[\\w]+)*@[\\w-]+(\\.[\\w]+)*(\\.[a-zA-Z]{2,})$ -mosip.id.validation.identity.postalCode=^[(?i)A-Z0-9]{5}$ -mosip.id.validation.identity.age=^(150|1[0-4][0-9]|[1-9]?[0-9])$ -mosip.id.validation.identity.fullName.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.addressLine1.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.addressLine2.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.addressLine3.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.region.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.province.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.city.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.[*].[*].language=^[(?i)a-z]{3}$ -mosip.id.validation.identity.referenceIdentityNumber=^([0-9]{10,30})$ -mosip.country.code=MOR - -# Language Supported By Platform - ISO -mosip.supported-languages=eng,ara,fra - -mosip.primary-language=eng -mosip.secondary-language=ara - -# Application IDs -mosip.prereg.app-id=PRE_REGISTRATION -mosip.reg.app-id=REGISTRATION -mosip.regproc.app-id=REGISTRATION_PROCESSOR -mosip.ida.app-id=IDA -mosip.idrepo.app-id=ID_REPO - -# UTC ISO Date Time Pattern -mosip.utc-datetime-pattern=yyyy-MM-dd'T'HH:mm:ss.SSS'Z' - -mosip.signed.response.header=response-signature - - -#----------------------- CBEFF Util-------------------------------------------------- -# Cbeff URL where the files will be stored in git, change it accordingly in case of change of storage location. -mosip.kernel.xsdstorage-uri=${spring.cloud.config.uri}/${spring.application.name}/${spring.profiles.active}/${spring.cloud.config.label}/ -# Cbeff XSD file name in config server -mosip.kernel.xsdfile=mosip-cbeff-extint.xsd - -#----------------------------- Applicant Type -------------------------------------------------- -mosip.kernel.applicant.type.age.limit = 5 - -#----------------------------- Static PIN -------------------------------------------------- -mosip.kernel.pin.length=6 - -#-----------------------------TspId ----------------------------------------------- -#length of the Tsp id -mosip.kernel.tspid.length=4 - -#-----------------------------partnerId ----------------------------------------------- -#length of the partner id -mosip.kernel.partnerid.length=4 - -#-----------------------------TOKEN-ID Properties--------------------------------- -#lenght of the token id -mosip.kernel.tokenid.length=36 - -#-----------------------------Registration Center Id ----------------------------------------------- -#length of the registration center id -mosip.kernel.registrationcenterid.length=5 - -#-----------------------------Machine Id ----------------------------------------------- -#length of the machine id -mosip.kernel.machineid.length=5 - -#-----------------------------RID Properties--------------------------------------- -# length of the rid -mosip.kernel.rid.length=29 -# length of the timestamp -mosip.kernel.rid.timestamp-length=14 -# rid sequence max digits -mosip.kernel.rid.sequence-length=5 - -# Upper bound of number of digits in sequence allowed in id. For example if -# limit is 3, then 12 is allowed but 123 is not allowed in id (in both -# ascending and descending order) -mosip.kernel.tokenid.sequence-limit=3 - -#-----------------------------PRID Properties------------------------------------ - -#prid-length -mosip.kernel.prid.length=14 - -# Upper bound of number of digits in sequence allowed in id. For example if -# limit is 3, then 12 is allowed but 123 is not allowed in id (in both -# ascending and descending order) -#to disable validation assign zero or negative value -mosip.kernel.prid.sequence-limit=3 - -# Number of digits in repeating block allowed in id. For example if limit is 2, -# then 4xxx4 is allowed but 48xxx48 is not allowed in id (x is any digit) -#to disable validation assign zero or negative value -mosip.kernel.prid.repeating-block-limit=3 - - -# Lower bound of number of digits allowed in between two repeating digits in -# id. For example if limit is 2, then 11 and 1x1 is not allowed in id (x is any digit) to disable validation assign zero or negative value -mosip.kernel.prid.repeating-limit=2 - -# list of number that id should not be start with to disable null -mosip.kernel.prid.not-start-with=0,1 - -#restricted numbers for prid -mosip.kernel.prid.restricted-numbers=786,666 - - -#-----------------------------VID Properties-------------------------------------- -# length of the vid -mosip.kernel.vid.length=16 - -# Upper bound of number of digits in sequence allowed in id. For example if -# limit is 3, then 12 is allowed but 123 is not allowed in id (in both -# ascending and descending order) -# to disable sequence limit validation assign 0 or negative value -mosip.kernel.vid.length.sequence-limit=3 - -# Number of digits in repeating block allowed in id. For example if limit is 2, -# then 4xxx4 is allowed but 48xxx48 is not allowed in id (x is any digit) -# to disable repeating block validation assign 0 or negative value -mosip.kernel.vid.length.repeating-block-limit=2 - - -# Lower bound of number of digits allowed in between two repeating digits in -# id. For example if limit is 2, then 11 and 1x1 is not allowed in id (x is any digit) -# to disable repeating limit validation, assign 0 or negative value -mosip.kernel.vid.length.repeating-limit=2 - -# list of number that id should not be start with -# to disable null -mosip.kernel.vid.not-start-with=0,1 - -#restricted numbers for vid -mosip.kernel.vid.restricted-numbers=786,666 - -#-----------------------------UIN Properties-------------------------------------- -#length of the uin -mosip.kernel.uin.length=10 -#minimum threshold of unused uin -mosip.kernel.uin.min-unused-threshold=200000 -#number of uins to generate -mosip.kernel.uin.uins-to-generate=500000 -#restricted numbers for uin -mosip.kernel.uin.restricted-numbers=786,666 - -# Upper bound of number of digits in sequence allowed in id. For example if -# limit is 3, then 12 is allowed but 123 is not allowed in id (in both -# ascending and descending order) -# to disable sequence limit validation assign 0 or negative value -mosip.kernel.uin.length.sequence-limit=3 - -# Number of digits in repeating block allowed in id. For example if limit is 2, -# then 4xxx4 is allowed but 48xxx48 is not allowed in id (x is any digit) -#to disable validation assign zero or negative value -mosip.kernel.uin.length.repeating-block-limit=2 - -# Lower bound of number of digits allowed in between two repeating digits in -# id. For example if limit is 2, then 11 and 1x1 is not allowed in id (x is any digit) -# to disable repeating limit validation, assign 0 or negative value -mosip.kernel.uin.length.repeating-limit=2 - -#reverse group digit limit for uin filter -mosip.kernel.uin.length.reverse-digits-limit=5 - -#group digit limit for uin filter -mosip.kernel.uin.length.digits-limit=5 - -#should not start with -mosip.kernel.uin.not-start-with=0,1 - -#adjacent even digit limit for uin filter -mosip.kernel.uin.length.conjugative-even-digits-limit=3 - - - - -#----------------------- SMS Service-------------------------------------- -mosip.kernel.sms.country.code=91 -mosip.kernel.sms.number.length=10 - - -#------------------------Auth-Adapter----------------------------------------------- -auth.server.validate.url=${mosip.base.url}/v1/authmanager/authorize/validateToken -auth.jwt.secret=authjwtsecret -auth.jwt.base=Mosip-Token - - -#----------------------- Crypto -------------------------------------------------- -#Crypto asymmetric algorithm name -mosip.kernel.crypto.asymmetric-algorithm-name=RSA/ECB/OAEPWITHSHA-256ANDMGF1PADDING -#Crypto symmetric algorithm name -mosip.kernel.crypto.symmetric-algorithm-name=AES/GCM/PKCS5Padding -#Keygenerator asymmetric algorithm name -mosip.kernel.keygenerator.asymmetric-algorithm-name=RSA -#Keygenerator symmetric algorithm name -mosip.kernel.keygenerator.symmetric-algorithm-name=AES -#Asymmetric algorithm key length -mosip.kernel.keygenerator.asymmetric-key-length=2048 -#Symmetric algorithm key length -mosip.kernel.keygenerator.symmetric-key-length=256 - -#Encrypted data and encrypted symmetric key separator -mosip.kernel.data-key-splitter=#KEY_SPLITTER# -#GCM tag length -mosip.kernel.crypto.gcm-tag-length=128 -#Hash algo name -mosip.kernel.crypto.hash-algorithm-name=PBKDF2WithHmacSHA512 -#Symmtric key length used in hash -mosip.kernel.crypto.hash-symmetric-key-length=256 -#No of iterations in hash -mosip.kernel.crypto.hash-iteration=100000 -#Sign algo name -mosip.kernel.crypto.sign-algorithm-name=RS512 - -mosip.kernel.keymanager-service-publickey-url=${mosip.base.url}/v1/keymanager/publickey/{applicationId} -mosip.kernel.keymanager-service-decrypt-url=${mosip.base.url}/v1/keymanager/decrypt -mosip.kernel.keymanager-service-auth-decrypt-url=${mosip.base.url}/v1/keymanager/auth/decrypt -mosip.kernel.keymanager-service-sign-url=${mosip.base.url}/v1/keymanager/sign -mosip.sign.applicationid=KERNEL -mosip.sign.refid=SIGN -mosip.kernel.cryptomanager.request_id=CRYPTOMANAGER.REQUEST -mosip.kernel.cryptomanager.request_version=v1.0 -mosip.kernel.signature.signature-request-id=SIGNATURE.REQUEST -mosip.kernel.signature.signature-version-id=v1.0 - - - -#----------------------------------ID Repo------------------------------------------ -mosip.idrepo.identity.uin-status.registered=ACTIVATED -mosip.idrepo.identity.uin-status=ACTIVATED,BLOCKED,DEACTIVATED - -#---------------------------------------otp manager service------------------------------- -#the default length for otp(in number) -mosip.kernel.otp.default-length=6 -#the default crypto function -#It can be: HmacSHA512, HmacSHA256, HmacSHA1. -mosip.kernel.otp.mac-algorithm=HmacSHA512 -#the OTP expires after the given time(in seconds). -mosip.kernel.otp.expiry-time=180 -#the key is freezed for the given time(in seconds). -mosip.kernel.otp.key-freeze-time=1800 -#the number of validation attempts allowed(in number). -#mosip.kernel.otp.validation-attempt-threshold =3 means , the validation and generation will be blocked from 4th time. -mosip.kernel.otp.validation-attempt-threshold=10 -#minimum length of key(in number). -mosip.kernel.otp.min-key-length=3 -#maximum length of key(in number). -mosip.kernel.otp.max-key-length=64 - - -#--------------------------------------Licensekeymanager Service-------------------------------------- -#the license key length. -mosip.kernel.licensekey.length=16 -#List of permissions -# NOTE: ',' in the below list is used as splitter in the implementation. -# Use of ',' in the values for below key should be avoided. -# Use of spaces before and after ',' also should be avoided. -mosip.kernel.licensekey.permissions=OTP Trigger,OTP Authentication,Demo Authentication - Identity Data Match,Demo Authentication - Address Data Match,Demo Authentication - Full Address Data Match,Demo Authentication - Secondary Language Match,Biometric Authentication - FMR Data Match,Biometric Authentication - IIR Data Match,Biometric Authentication - FID Data Match,Static Pin Authentication,eKYC - limited,eKYC - Full,eKYC - No - - - -#-----------------------------Virus Scanner-------------------------------------- -#Virus Scanner server url -mosip.kernel.virus-scanner.host=10.0.2.7 -#Virus Scanner server port -mosip.kernel.virus-scanner.port=3310 - - - -#-------------------------------FS Adapter- HDFS ------------------------------- -# Name node url for HDFS - Non Secured -mosip.kernel.fsadapter.hdfs.name-node-url=hdfs://13.71.117.37:51000 -# Name node url for HDFS - Secured (auth enabled) -#mosip.kernel.fsadapter.hdfs.name-node-url=hdfs://13.71.117.37:51000 -# Enable if hadoop security authorization is 'true', default is false -mosip.kernel.fsadapter.hdfs.authentication-enabled=false -# HDFS log level. Change this to debug to see hdfs logs -logging.level.org.apache.hadoop=warn -# If HDFS is security is configured with Kerberos, Key Distribution Center domain -mosip.kernel.fsadapter.hdfs.kdc-domain=HDFSKERBEROS1.SOUTHINDIA.CLOUDAPP.AZURE.COM -# Username to access hdfs. Change this to application username (regprocessor,prereg or idrepo) -#mosip.kernel.fsadapter.hdfs.user-name=mosipuser -#keytab file path, must be set if authentication-enable is true -#read keytab file both classpath and physical path ,append appropriate prefix -#for classpath prefix classpath:mosip.keytab -#for physical path prefix file:/home/keys/mosip.keytab -mosip.kernel.fsadapter.hdfs.keytab-file=classpath:mosip.keytab - - - -#---------------Transliteration----------------------- -mosip.kernel.transliteration.arabic-language-code=ara -mosip.kernel.transliteration.franch-language-code=fra - - -#-------Registration processor Notification types------------ -mosip.registration.processor.notification.types=SMS|EMAIL - - -mosip.default.dob.month=01 -mosip.default.dob.day=01 -mosip.login.mode= email,mobile - - -#---Language orientation----- -mosip.right_to_left_orientation=ara -mosip.left_to_right_orientation=eng,fra - - -#**************** Notification Type ************* -mosip.notificationtype=SMS|EMAIL -#******** Notification lanugage types - either PRIMARY or BOTH ******** -mosip.notification.language-type=BOTH - - -#-------------------System--------------- -logging.level.org.springframework.web.filter.CommonsRequestLoggingFilter=INFO - -#-------------------Encryption and Decryption--------------------------- -mosip.kernel.encrypt.url=${mosip.base.url}/v1/keymanager/encrypt -mosip.kernel.decrypt.url=${mosip.base.url}/v1/keymanager/decrypt - -#------------------PDF Genration----------------------------------------- -mosip.kernel.pdf_owner_password=somepassword - -#-------UIN Alias------------------- -mosip.uin.alias= - - -#------------------Quality Check----------------------------------------- -#Quality threshold for applicant iris -mosip.iris_threshold=0 -#Quality threshold for applicant leftslap fingerprint -mosip.leftslap_fingerprint_threshold=0 -#Quality threshold for applicant rightslap fingerprint -mosip.rightslap_fingerprint_threshold=0 -#Quality threshold for applicant thumbs fingerprint -mosip.thumbs_fingerprint_threshold=0 -#Quality threshold for applicant face -mosip.facequalitythreshold=0 -#Bio SDK Integration -mosip.fingerprint.provider=ai.tech5.auth.service.T5AuthFingerImpl -mosip.face.provider=ai.tech5.auth.service.T5AuthFaceImpl -mosip.iris.provider=ai.tech5.auth.service.T5AuthIrisImpl - - -#openapi properties to sort tag and operations of id-authentication services -springdoc.swagger-ui.tagsSorter=alpha -springdoc.swagger-ui.operationsSorter=alpha -p12.key.alias=keyalias diff --git a/authentication-demo-service/src/main/resources/bootstrap.properties b/authentication-demo-service/src/main/resources/bootstrap.properties deleted file mode 100644 index a46f99a38b..0000000000 --- a/authentication-demo-service/src/main/resources/bootstrap.properties +++ /dev/null @@ -1,42 +0,0 @@ - -# Application name - the name appended at starting of file name to differentiate -# between different property files for different microservices -spring.application.name=id-authentication-demo - -#Active Profile - will relate to development properties file in the server. -#If this property is absent then default profile will be activated which is -#the property file without any environment name at the end. -spring.profiles.active=local - - -# defining current branch in which we are working as label -spring.cloud.config.label=master - - -# url where spring cloud config server is running -spring.cloud.config.uri=localhost - - -#management.security.enabled=false - -#exposing refresh endpoint so that whenevr configuration changes in git, -#post /actuator/refresh endpoint can be called for the client microservices -#to update the configuration -#management.endpoints.web.exposure.include=refresh,restart,env -management.endpoints.web.exposure.include=info,health,refresh,restart,env - -#disabling health check so that client doesnt try to load properties from sprint config server every -# 5 minutes (should not be done in production) -health.config.enabled=true - -#Swagger 3.0 -openapi.info.title=Authentication Service API documentation -openapi.info.description=Authentication Service API documentation -openapi.info.version=1.0 -openapi.info.license.name=Mosip -openapi.info.license.url=https://docs.mosip.io/platform/license - -#------OpenApi properties-------- -mosipbox.public.url=http://localhost:8082 -openapi.authDemoServiceServer.servers[0].url=${mosipbox.public.url}/v1/identity -openapi.authDemoServiceServer.servers[0].description=Authentication Demo Service \ No newline at end of file diff --git a/authentication-demo-service/src/main/resources/mosip-identity-json-schema.json b/authentication-demo-service/src/main/resources/mosip-identity-json-schema.json deleted file mode 100644 index 81b35dce1e..0000000000 --- a/authentication-demo-service/src/main/resources/mosip-identity-json-schema.json +++ /dev/null @@ -1,161 +0,0 @@ -{ - "$id": "http://mosip.io/id_object/1.0/id_object.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "MOSIP ID schema", - "description": "Sample ID schema", - "type": "object", - "additionalProperties": false, - "properties": { - "identity": { - "title": "identity", - "description": "This schema holds all the attributes of an Identity", - "type": "object", - "additionalProperties": false, - "properties": { - "IDSchemaVersion": { - "type": "number" - }, - "UIN": { - "type": "number" - }, - "fullName": { - "$ref": "#/definitions/simpleType" - }, - "dateOfBirth": { - "$ref": "#/definitions/dateOfBirthType" - }, - "age": { - "type": "number" - }, - "gender": { - "$ref": "#/definitions/simpleType" - }, - "addressLine1": { - "$ref": "#/definitions/simpleType" - }, - "addressLine2": { - "$ref": "#/definitions/simpleType" - }, - "addressLine3": { - "$ref": "#/definitions/simpleType" - }, - "region": { - "$ref": "#/definitions/simpleType" - }, - "province": { - "$ref": "#/definitions/simpleType" - }, - "city": { - "$ref": "#/definitions/simpleType" - }, - "postalCode": { - "$ref": "#/definitions/postalCodeType" - }, - "phone": { - "$ref": "#/definitions/phoneType" - }, - "email": { - "$ref": "#/definitions/emailType" - }, - "CNIENumber": { - "type": "number" - }, - "localAdministrativeAuthority": { - "$ref": "#/definitions/simpleType" - }, - "parentOrGuardianName": { - "$ref": "#/definitions/simpleType" - }, - "parentOrGuardianRIDOrUIN": { - "type": "number" - }, - "proofOfAddress": { - "$ref": "#/definitions/documentType" - }, - "proofOfIdentity": { - "$ref": "#/definitions/documentType" - }, - "proofOfRelationship": { - "$ref": "#/definitions/documentType" - }, - "proofOfDateOfBirth": { - "$ref": "#/definitions/documentType" - }, - "individualBiometrics": { - "$ref": "#/definitions/biometricsType" - }, - "parentOrGuardianBiometrics": { - "$ref": "#/definitions/biometricsType" - } - } - } - }, - "definitions": { - "simpleType": { - "type": "array", - "additionalItems": false, - "uniqueItems": true, - "items": { - "type": "object", - "required": [ - "language", - "value" - ], - "additionalProperties": false, - "properties": { - "language": { - "type": "string", - "pattern": "^[(?i)a-z]{3}$" - }, - "value": { - "type": "string" - } - } - } - }, - "dateOfBirthType": { - "type": "string", - "pattern": "^\\d{4}/([0]\\d|1[0-2])/([0-2]\\d|3[01])$" - }, - "phoneType": { - "type": "string", - "pattern": "^([9]{1})([234789]{1})([0-9]{8})$" - }, - "postalCodeType": { - "type": "string", - "pattern": "^[(?i)A-Z0-9]{6}$" - }, - "emailType": { - "type": "string", - "pattern": "^\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$" - }, - "documentType": { - "type": "object", - "properties": { - "format": { - "type": "string" - }, - "type": { - "type": "string" - }, - "fileReference": { - "type": "string" - } - } - }, - "biometricsType": { - "type": "object", - "properties": { - "format": { - "type": "string" - }, - "version": { - "type": "number" - }, - "fileReference": { - "type": "string" - } - } - } - } -} diff --git a/authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/AuthRequestControllerTest.java b/authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/AuthRequestControllerTest.java deleted file mode 100644 index 2de51cb1a6..0000000000 --- a/authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/AuthRequestControllerTest.java +++ /dev/null @@ -1,311 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.test; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.security.InvalidAlgorithmParameterException; -import java.security.InvalidKeyException; -import java.security.KeyManagementException; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.UnrecoverableEntryException; -import java.security.cert.CertificateException; -import java.security.spec.InvalidKeySpecException; -import java.util.Map; - -import javax.crypto.BadPaddingException; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.NoSuchPaddingException; -import jakarta.servlet.ReadListener; -import jakarta.servlet.ServletInputStream; - -import org.jose4j.lang.JoseException; -import org.json.JSONException; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.core.env.Environment; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.TestContext; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.util.ReflectionTestUtils; -import org.springframework.web.context.WebApplicationContext; - -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.mosip.authentication.core.exception.IdAuthenticationAppException; -import io.mosip.authentication.core.exception.IdAuthenticationBusinessException; -import io.mosip.kernel.templatemanager.velocity.impl.TemplateManagerImpl; -import io.mosip.testrig.authentication.demo.service.controller.AuthRequestController; -import io.mosip.testrig.authentication.demo.service.controller.Encrypt; -import io.mosip.testrig.authentication.demo.service.controller.JWSSignAndVerifyController; -import io.mosip.testrig.authentication.demo.service.controller.Encrypt.SplittedEncryptedData; -import io.mosip.testrig.authentication.demo.service.dto.EncryptionResponseDto; - -// -/** - * The Class AuthRequestControllerTest tests the creation of auth request - * - * @author Arun Bose S - */ -//@RunWith(SpringRunner.class) -//@WebMvcTest -//@ContextConfiguration(classes = { TestContext.class, WebApplicationContext.class }) -public class AuthRequestControllerTest { - -// -// private final class ServletInputStreamExtension extends ServletInputStream { -// private final ByteArrayInputStream bais; -// -// private ServletInputStreamExtension(ByteArrayInputStream bais) { -// this.bais = bais; -// } -// -// @Override -// public int read() throws IOException { -// return bais.read(); -// } -// -// @Override -// public void setReadListener(ReadListener listener) { -// -// } -// -// @Override -// public boolean isReady() { -// return bais.available() != 0; -// } -// -// @Override -// public boolean isFinished() { -// return bais.available() == 0; -// } -// } -// -// -// @Autowired -// private Environment environment; -// -// @Autowired -// private ObjectMapper mapper; -// -// @InjectMocks -// private AuthRequestController authReqController; -// -// @Mock -// private Encrypt encrypt; -// -// @Mock -// private TemplateManagerImpl templateManager; -// -// @Mock -// JWSSignAndVerifyController jWSSignAndVerifyController; -// -// @Before -// public void before() { -// ReflectionTestUtils.setField(authReqController, "environment", environment); -// ReflectionTestUtils.setField(authReqController, "mapper", mapper); -// ReflectionTestUtils.setField(authReqController, "templateManager", templateManager); -// ReflectionTestUtils.setField(authReqController, "encrypt", encrypt); -// ReflectionTestUtils.setField(authReqController, "jWSSignAndVerifyController", jWSSignAndVerifyController); -// } -// -// /** -// * Auth controller test. -// * @throws JSONException -// * @throws IOException -// * @throws BadPaddingException -// * @throws IllegalBlockSizeException -// * @throws InvalidAlgorithmParameterException -// * @throws NoSuchPaddingException -// * @throws InvalidKeySpecException -// * @throws NoSuchAlgorithmException -// * @throws IdAuthenticationBusinessException -// * @throws IdAuthenticationAppException -// * @throws InvalidKeyException -// * @throws KeyManagementException -// * @throws JoseException -// * @throws UnrecoverableEntryException -// * @throws CertificateException -// * @throws KeyStoreException -// */ -// @SuppressWarnings("unchecked") -// @Test -// public void authControllerTest() throws KeyManagementException, InvalidKeyException, IdAuthenticationAppException, IdAuthenticationBusinessException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException, IOException, JSONException, KeyStoreException, CertificateException, UnrecoverableEntryException, JoseException { -// EncryptionResponseDto encryptionResponse=new EncryptionResponseDto(); -// Mockito.when(encrypt.encrypt(Mockito.any(), Mockito.any(), Mockito.anyBoolean(), Mockito.anyBoolean())).thenReturn(encryptionResponse); -// String reqData="{\r\n" + -// " \"biometrics\": [{\r\n" + -// " \"data\": {\r\n" + -// " \"bioSubType\": \"UNKNOWN\",\r\n" + -// " \"bioType\": \"IIR\",\r\n" + -// " \"bioValue\": \"LEFT\",\r\n" + -// " \"deviceCode\": \"cogent\",\r\n" + -// " \"deviceProviderID\": \"cogent\",\r\n" + -// " \"timestamp\": \"2019-03-27T10:01:57.086+05:30\",\r\n" + -// " \"transactionID\": \"1234567890\"\r\n" + -// " }\r\n" + -// " },\r\n" + -// " {\r\n" + -// " \"data\": {\r\n" + -// " \"bioSubType\": \"UNKNOWN\",\r\n" + -// " \"bioType\": \"IIR\",\r\n" + -// " \"bioValue\": \"RIGHT\",\r\n" + -// " \"deviceCode\": \"cogent\",\r\n" + -// " \"deviceProviderID\": \"cogent\",\r\n" + -// " \"timestamp\": \"2019-03-27T10:01:57.086+05:30\",\r\n" + -// " \"transactionID\": \"1234567890\"\r\n" + -// " }\r\n" + -// " }\r\n" + -// " ],\r\n" + -// " \"timestamp\": \"2019-03-27T10:01:57.086+05:30\",\r\n" + -// " \"transactionID\": \"1234567890\"\r\n" + -// " }"; -// Map reqMap=mapper.readValue(reqData.getBytes(StandardCharsets.UTF_8), Map.class); -// Mockito.when(templateManager.merge(Mockito.any(), Mockito.any())).thenReturn(newServletInputStream()); -// SplittedEncryptedData value = new SplittedEncryptedData("123", "456"); -// Mockito.when(encrypt.encryptBiometrics(Mockito.any(), Mockito.any(), Mockito.anyBoolean())).thenReturn(value ); -// Mockito.when(jWSSignAndVerifyController.sign(Mockito.any())).thenReturn("1234"); -// -// authReqController.createAuthRequest("1234567890", "UIN", false, false, null, null, null, reqMap) ; -// -// -// } -// -// -// @SuppressWarnings("unchecked") -// @Test -// public void kycControllerTest() throws KeyManagementException, InvalidKeyException, IdAuthenticationAppException, IdAuthenticationBusinessException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException, IOException, JSONException, KeyStoreException, CertificateException, UnrecoverableEntryException, JoseException { -// EncryptionResponseDto encryptionResponse=new EncryptionResponseDto(); -// Mockito.when(encrypt.encrypt(Mockito.any(), Mockito.any(), Mockito.anyBoolean(), Mockito.anyBoolean())).thenReturn(encryptionResponse); -// String reqData="{\r\n" + -// " \"biometrics\": [{\r\n" + -// " \"data\": {\r\n" + -// " \"bioSubType\": \"UNKNOWN\",\r\n" + -// " \"bioType\": \"IIR\",\r\n" + -// " \"bioValue\": \"LEFT\",\r\n" + -// " \"deviceCode\": \"cogent\",\r\n" + -// " \"deviceProviderID\": \"cogent\",\r\n" + -// " \"timestamp\": \"2019-03-27T10:01:57.086+05:30\",\r\n" + -// " \"transactionID\": \"1234567890\"\r\n" + -// " }\r\n" + -// " },\r\n" + -// " {\r\n" + -// " \"data\": {\r\n" + -// " \"bioSubType\": \"UNKNOWN\",\r\n" + -// " \"bioType\": \"IIR\",\r\n" + -// " \"bioValue\": \"RIGHT\",\r\n" + -// " \"deviceCode\": \"cogent\",\r\n" + -// " \"deviceProviderID\": \"cogent\",\r\n" + -// " \"timestamp\": \"2019-03-27T10:01:57.086+05:30\",\r\n" + -// " \"transactionID\": \"1234567890\"\r\n" + -// " }\r\n" + -// " }\r\n" + -// " ],\r\n" + -// " \"timestamp\": \"2019-03-27T10:01:57.086+05:30\",\r\n" + -// " \"transactionID\": \"1234567890\"\r\n" + -// " }"; -// Map reqMap=mapper.readValue(reqData.getBytes(StandardCharsets.UTF_8), Map.class); -// Mockito.when(templateManager.merge(Mockito.any(), Mockito.any())).thenReturn(newServletInputStream()); -// SplittedEncryptedData value = new SplittedEncryptedData("123", "456"); -// Mockito.when(encrypt.encryptBiometrics(Mockito.any(), Mockito.any(), Mockito.anyBoolean())).thenReturn(value ); -// Mockito.when(jWSSignAndVerifyController.sign(Mockito.any())).thenReturn("1234"); -// -// authReqController.createAuthRequest("1234567890", "UIN", false, false, null, null, null, reqMap) ; -// -// -// } -// -// -// -// -// -// -// @SuppressWarnings("unchecked") -// @Test -// public void authControllerAuthTypeTest() throws KeyManagementException, InvalidKeyException, IdAuthenticationAppException, IdAuthenticationBusinessException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException, IOException, JSONException, KeyStoreException, CertificateException, UnrecoverableEntryException, JoseException { -// EncryptionResponseDto encryptionResponse=new EncryptionResponseDto(); -// Mockito.when(encrypt.encrypt(Mockito.any(), Mockito.any(), Mockito.anyBoolean(), Mockito.anyBoolean())).thenReturn(encryptionResponse); -// String reqData="{\r\n" + -// " \"biometrics\": [{\r\n" + -// " \"data\": {\r\n" + -// " \"bioSubType\": \"UNKNOWN\",\r\n" + -// " \"bioType\": \"IIR\",\r\n" + -// " \"bioValue\": \"LEFT\",\r\n" + -// " \"deviceCode\": \"cogent\",\r\n" + -// " \"deviceProviderID\": \"cogent\",\r\n" + -// " \"timestamp\": \"2019-03-27T10:01:57.086+05:30\",\r\n" + -// " \"transactionID\": \"1234567890\"\r\n" + -// " }\r\n" + -// " },\r\n" + -// " {\r\n" + -// " \"data\": {\r\n" + -// " \"bioSubType\": \"UNKNOWN\",\r\n" + -// " \"bioType\": \"IIR\",\r\n" + -// " \"bioValue\": \"RIGHT\",\r\n" + -// " \"deviceCode\": \"cogent\",\r\n" + -// " \"deviceProviderID\": \"cogent\",\r\n" + -// " \"timestamp\": \"2019-03-27T10:01:57.086+05:30\",\r\n" + -// " \"transactionID\": \"1234567890\"\r\n" + -// " }\r\n" + -// " }\r\n" + -// " ],\r\n" + -// " \"timestamp\": \"2019-03-27T10:01:57.086+05:30\",\r\n" + -// " \"transactionID\": \"1234567890\"\r\n" + -// " }"; -// Map reqMap=mapper.readValue(reqData.getBytes(StandardCharsets.UTF_8), Map.class); -// Mockito.when(templateManager.merge(Mockito.any(), Mockito.any())).thenReturn(newServletInputStream()); -// SplittedEncryptedData value = new SplittedEncryptedData("123", "456"); -// Mockito.when(encrypt.encryptBiometrics(Mockito.any(), Mockito.any(), Mockito.anyBoolean())).thenReturn(value ); -// Mockito.when(jWSSignAndVerifyController.sign(Mockito.any())).thenReturn("1234"); -// -// authReqController.createAuthRequest("1234567890", "UIN", true, false, "bio,otp,demo,pin", null, null, reqMap) ; -// } -// -// @Ignore -// @SuppressWarnings("unchecked") -// @Test(expected=IdAuthenticationBusinessException.class) -// public void noRequest() throws KeyManagementException, InvalidKeyException, IdAuthenticationAppException, IdAuthenticationBusinessException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException, IOException, JSONException, KeyStoreException, CertificateException, UnrecoverableEntryException, JoseException { -// EncryptionResponseDto encryptionResponse=new EncryptionResponseDto(); -// Mockito.when(encrypt.encrypt(Mockito.any(), Mockito.anyString(), Mockito.anyBoolean(), Mockito.anyBoolean())).thenReturn(encryptionResponse); -// String reqData="{}"; -// Map reqMap=mapper.readValue(reqData.getBytes(StandardCharsets.UTF_8), Map.class); -// Mockito.when(templateManager.merge(Mockito.any(), Mockito.any())).thenReturn(newServletInputStream()); -// authReqController.createAuthRequest("1234567890", "UIN", false, false, "bio", null, null, reqMap) ; -// } -// -// -// -// -// -// -// private ServletInputStreamExtension newServletInputStream() { -// String req = "{\r\n" + -// " \"consentObtained\": true,\r\n" + -// " \"id\": \"mosip.identity.auth\",\r\n" + -// " \"individualId\": \"6521768301\",\r\n" + -// " \"individualIdType\": \"UIN\",\r\n" + -// " \"request\": \"7sBCLgrrSNhB-6vNR_MKtzv0wgjaKzB6HCnf1mx0u0YH0IiUL0PaUDOqaQi1RuN4Ar0yAlhJsIJIW-uxWHNxFEoD6h-r75pzKyBoyefMdpLHboLbljUBrPHoqrJLfv1nkas9RS-fD6M5S4e0D5YbZ5c9toNpb4thjj-QbHkEsOKQsVv7R7g59wMzMYx49NHSWnYnB4Dphsks-EGdCkHYR6IUR_Ys4OB1aZTGwfHrnXw8iWRhkrkv2hJA7QkpA9TGG_I9_dQT3amIWB3cDISlW0tKnaG7EVMApuPkeKO5LaxwKhE6_0RWCCvr9LSzVl6b8l8tZ8zybcRnrNS22nGAxytuwkx_BeEFdqnGrht0Q7y23pMmjn5JPYN3mnfQbuENYXKU5f5LGslUZm48ouqa1_-oPktSIq6K0PrTEKGlSukkmitqBXApuSbS1VJJ6uqhpudMnWB7QyO37XDPfMqsJKQueGbdLObdq_wT81-c5PT3h1QhFBe16N5Sf3qg0AgzRxzZ6T3kNiFIy7CkLZD9B7dKCmuL4nV-ixSyjzNQUALvEbDeatSF2-wjlTVVewtwcYzByCJbet2agYqfG0hdiTR5LbyclO8E67E1k73pJT07OgBihlXb9oIw0ljIZo_9smN_shoJUfxy1f8UUKJVWg\",\r\n" + -// " \"requestHMAC\": \"OPDtwdW7bHnQ3d7T8pQURjIyNYBt3hkE8ZbY7H1cBFtufkjYKd9rpcE7w57hZg6xUGsN2QZM8PtbEUjWShjrZIezI7nmGnlPS2lhIE1F6pw4Nl9AJ3oabrN4D7sULeVs\",\r\n" + -// " \"requestSessionKey\": \"AmbpO_u3WC83w4emk0f8G4RDdwIhk8KablUfBw6OVy_3a4UrHxx8TE7mpHgRMp-M7V01qAoYguO3XwWKFQfWHTZNaVuXYMkf3biNHWQiPm4UKob3MZjhyLUXaacy0MPFj8OIRYoRcQ5uwtpknzUC6qyjfyh9CdGlvvREyCgjSOFaBalFW3pFPkeZK7J7BfHv0OF1BoncE5Z4ITgUFAwyCAHBp3RrU0Oy6DqJXsm5I2ICuZKqYzE-bCK85Gw2eq-ECllQzmTvE34ILWpAOgmcUwie62rJnNtGJTzFoLCuzOxo7qtJBpi2ida4rzd1_jWVWGwe2cW4l2jGSEtDMve-Og\",\r\n" + -// " \"requestTime\": \"2019-03-28T10:01:57.086+05:30\",\r\n" + -// " \"requestedAuth\": {\r\n" + -// " \"bio\": true,\r\n" + -// " \"demo\": false,\r\n" + -// " \"otp\": false,\r\n" + -// " \"pin\": false\r\n" + -// " },\r\n" + -// " \"transactionID\": \"1234567890\",\r\n" + -// " \"version\": \"0.9\"\r\n" + -// "}"; -// ByteArrayInputStream bais = new ByteArrayInputStream(req.getBytes()); -// return new ServletInputStreamExtension(bais); -// } - -} diff --git a/authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/DecryptTest.java b/authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/DecryptTest.java deleted file mode 100644 index bcabe1dee4..0000000000 --- a/authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/DecryptTest.java +++ /dev/null @@ -1,76 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.test; - -import java.io.IOException; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import java.security.spec.InvalidKeySpecException; - -import org.json.JSONException; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.TestContext; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.web.client.RestClientException; -import org.springframework.web.context.WebApplicationContext; - -import io.mosip.testrig.authentication.demo.service.controller.Decrypt; - -/** - * @author Arun Bose S The Class DecryptTest. - */ -@Ignore -@RunWith(SpringRunner.class) -@WebMvcTest -@ContextConfiguration(classes = { TestContext.class, WebApplicationContext.class }) -public class DecryptTest { - - /** The decrypt mock. */ - @InjectMocks - private Decrypt decryptMock; - - /** - * Before. - */ - @Before - public void before() { - } - - /** - * Decrypt test. - * - * @throws KeyManagementException the key management exception - * @throws RestClientException the rest client exception - * @throws NoSuchAlgorithmException the no such algorithm exception - * @throws IOException Signals that an I/O exception has occurred. - * @throws JSONException the JSON exception - * @throws InvalidKeySpecException the invalid key spec exception - */ - @Test - public void decryptTest() throws KeyManagementException, RestClientException, NoSuchAlgorithmException, IOException, - JSONException, InvalidKeySpecException { - String testData = "IXBo95Kc+8+OLBUdISp+tfY+uaa2UX2iBStyJ4T9KQB1f6qKOUdQevBl0bSEdMQCu/nSlX1HxTtXpbjH24vWUZuwM6V2HMmsSKYYcoPGQONojKTw214PB32pYbeHT0g8yXgPhn/wyBOEg3RaESOTXwujEmCmmHIEtbhMOmLv8M0MHNQHhx8gr+LUBovrm1Om5S/06VOHzli7BPjbMgN9tahYDDMVuTpkeMrrJhfI5aa/QCY0zhajd9SYYaqSe7Os5/jP/fBRkIXnNxttn5z7rCaNMGc4DosyNkt8ORttOxGcCNHscomA+eI79zm+BZS7+MY1aix/4qhssL0lWPokFg==rg3WqmbbFkhUTPQdKcvntxy5n7TjOHHsyZUyIfqJOXs1iBQNShfDD4bbjUnqI64l9v7grEm3s2el5bwwgibeK2eDhQzZNXQyN/fGmFWOwY8B6tySDQRZelc5ltRHUvHDfzSMyNK5PhMDP6S4LNCFPjuN/yrSxh2HMzGzcz2+MYpQ8ZASXmtWNgHt6mvYOEyUKwNB3OFyjtRPjZddbg4f/WqmJ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1/kH8kE01N8I8HYjfrEC1xdMxeuLoEMklOiBQNeyA9zAHE7Jgu8/FJceVqh5CsNgTCNvlEGEOgB18D2kw+H3a90z/doylhEWmWw+WdwWR7axNcDOUK3Xjoy0XkxBUMvPVbl7c5X0IwBY++vuHkJsmo+2BhODy6QHF/a9MXgow/zLp64o0gKreiR8GhpkaCO6ryMntfC2qORovEaUvPKIQ1yiuhbHIj9RN+DL2e1sik+aDrcDaC0ywPxQeLOJ17fb1J1/vWK0U5L3P8ZxlHk9p52jPrpQX6sfftDm4bw8agmFstq8Mv4Ufs7TeYgw3uk1xEdsK/dNJaOBrFKeE2/u+N+fNEO5WKcL4CDOMGa+rncMzV4ArkXfq1ZZyqM7/9qQslu9K87v1kLIyulB3lSd2hoUc/ByWtvbOU41lKU4gW+fDOkZz2xVS3ibWtD1ELXkXdoHoZCtV6MKLd2PxRl+Cykf2WMRIDiATFAkGqhvRxXySvwiYjPXPx04TUzLg=="; - decryptMock.decrypt(testData, "IDA", false, false, null, null); - } - - /** - * Old decrypt test. - * - * @throws InvalidKeySpecException the invalid key spec exception - * @throws NoSuchAlgorithmException the no such algorithm exception - * @throws IOException Signals that an I/O exception has occurred. - *//* - * @Test public void oldDecryptTest() throws InvalidKeySpecException, - * NoSuchAlgorithmException, IOException { String testData= - * "IXBo95Kc+8+OLBUdISp+tfY+uaa2UX2iBStyJ4T9KQB1f6qKOUdQevBl0bSEdMQCu/nSlX1HxTtXpbjH24vWUZuwM6V2HMmsSKYYcoPGQONojKTw214PB32pYbeHT0g8yXgPhn/wyBOEg3RaESOTXwujEmCmmHIEtbhMOmLv8M0MHNQHhx8gr+LUBovrm1Om5S/06VOHzli7BPjbMgN9tahYDDMVuTpkeMrrJhfI5aa/QCY0zhajd9SYYaqSe7Os5/jP/fBRkIXnNxttn5z7rCaNMGc4DosyNkt8ORttOxGcCNHscomA+eI79zm+BZS7+MY1aix/4qhssL0lWPokFg==rg3WqmbbFkhUTPQdKcvntxy5n7TjOHHsyZUyIf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NejVXIvHIMTw9X4kv/7F3fEFCcwuIs/s7U06ROGJ+zJOGPE7h48CRUXQUuyxehLB7w2JzcfCDAAxpBc0CJt8emUpVNXgHTV+D5M2m7E9NLNFuB5a1iLDr+Pa7vDS9IhSLuc/GX6KGFcoaJBVepiHZdBL9jD8ubfnX+1jaqq3nES25UXgnKW1/kH8kE01N8I8HYjfrEC1xdMxeuLoEMklOiBQNeyA9zAHE7Jgu8/FJceVqh5CsNgTCNvlEGEOgB18D2kw+H3a90z/doylhEWmWw+WdwWR7axNcDOUK3Xjoy0XkxBUMvPVbl7c5X0IwBY++vuHkJsmo+2BhODy6QHF/a9MXgow/zLp64o0gKreiR8GhpkaCO6ryMntfC2qORovEaUvPKIQ1yiuhbHIj9RN+DL2e1sik+aDrcDaC0ywPxQeLOJ17fb1J1/vWK0U5L3P8ZxlHk9p52jPrpQX6sfftDm4bw8agmFstq8Mv4Ufs7TeYgw3uk1xEdsK/dNJaOBrFKeE2/u+N+fNEO5WKcL4CDOMGa+rncMzV4ArkXfq1ZZyqM7/9qQslu9K87v1kLIyulB3lSd2hoUc/ByWtvbOU41lKU4gW+fDOkZz2xVS3ibWtD1ELXkXdoHoZCtV6MKLd2PxRl+Cykf2WMRIDiATFAkGqhvRxXySvwiYjPXPx04TUzLg=="; - * PrivateKey privateKey=decryptMock.fileReader(); String encodedKey = - * testData.substring(0, 343); String encodeData = testData.substring(344, - * testData.length()-1); byte[] finalValue=null; - * ReflectionTestUtils.invokeMethod(decryptMock, "oldDecrypt",finalValue, - * privateKey, encodedKey, encodeData); } - */ -} diff --git a/authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/DigitalSignatureTest.java b/authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/DigitalSignatureTest.java deleted file mode 100644 index 3635e89360..0000000000 --- a/authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/DigitalSignatureTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.test; - -import java.io.IOException; -import java.security.KeyManagementException; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.UnrecoverableEntryException; -import java.security.cert.CertificateException; -import java.security.spec.InvalidKeySpecException; - -import org.jose4j.lang.JoseException; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.TestContext; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.web.context.WebApplicationContext; - -import io.mosip.testrig.authentication.demo.service.controller.JWSSignAndVerifyController; - -/** - * @author Arun Bose S The Class DigitalSignatureTest. - */ -@Ignore -@RunWith(SpringRunner.class) -@WebMvcTest -@ContextConfiguration(classes = { TestContext.class, WebApplicationContext.class }) -public class DigitalSignatureTest { - - /** The digital sign mock. */ - @InjectMocks - private JWSSignAndVerifyController digitalSignMock; - - /** - * Digital sign test. - * - * @throws KeyStoreException the key store exception - * @throws NoSuchAlgorithmException the no such algorithm exception - * @throws CertificateException the certificate exception - * @throws UnrecoverableEntryException the unrecoverable entry exception - * @throws InvalidKeySpecException the invalid key spec exception - * @throws IOException Signals that an I/O exception has - * occurred. - * @throws JoseException the jose exception - * @throws KeyManagementException - */ - @Test - public void digitalSignTest() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, - UnrecoverableEntryException, InvalidKeySpecException, IOException, JoseException, KeyManagementException { - digitalSignMock.sign("sdfsdfsdfsdf", false); - } - -} diff --git a/authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/EncryptTest.java b/authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/EncryptTest.java deleted file mode 100644 index b6152110bd..0000000000 --- a/authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/EncryptTest.java +++ /dev/null @@ -1,152 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.test; - -import java.io.IOException; -import java.security.InvalidAlgorithmParameterException; -import java.security.InvalidKeyException; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import java.security.spec.InvalidKeySpecException; -import java.util.Map; - -import javax.crypto.BadPaddingException; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.NoSuchPaddingException; - -import org.json.JSONException; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.core.env.Environment; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.TestContext; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.util.ReflectionTestUtils; -import org.springframework.web.client.RestClientException; -import org.springframework.web.context.WebApplicationContext; - -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.mosip.testrig.authentication.demo.service.controller.Encrypt; -import io.mosip.testrig.authentication.demo.service.dto.EncryptionRequestDto; - - -/** - * @author Arun Bose S - * The Class EncryptTest. - */ -@Ignore -@RunWith(SpringRunner.class) -@WebMvcTest -@ContextConfiguration(classes = { TestContext.class, WebApplicationContext.class }) -public class EncryptTest { - - - - /** The encrypt mock. */ - @InjectMocks - private Encrypt encryptMock; - - /** The obj mapper. */ - @Autowired - private ObjectMapper objMapper; - - /** The environment. */ - @Autowired - private Environment environment; - - /** - * Before. - */ - @Before - public void before() { - ReflectionTestUtils.setField(encryptMock, "publicKeyURL", environment.getProperty("mosip.ida.publicKey-url")); - ReflectionTestUtils.setField(encryptMock, "appID", environment.getProperty("application.id")); - ReflectionTestUtils.setField(encryptMock, "keySplitter", environment.getProperty("mosip.kernel.data-key-splitter")); - ReflectionTestUtils.setField(encryptMock, "objMapper", objMapper); - - } - - //@Mock - - - /** - * Encrypt test. - * - * @throws KeyManagementException the key management exception - * @throws RestClientException the rest client exception - * @throws NoSuchAlgorithmException the no such algorithm exception - * @throws IOException Signals that an I/O exception has occurred. - * @throws JSONException the JSON exception - * @throws InvalidKeySpecException the invalid key spec exception - * @throws BadPaddingException - * @throws IllegalBlockSizeException - * @throws InvalidAlgorithmParameterException - * @throws NoSuchPaddingException - * @throws InvalidKeyException - */ - @SuppressWarnings("unchecked") - @Test - public void encryptTest() throws KeyManagementException, RestClientException, NoSuchAlgorithmException, IOException, JSONException, InvalidKeySpecException, InvalidKeyException, NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException { - String testData="{\r\n" + - " \"identityRequest\": {\r\n" + - " \"identity\": {\r\n" + - " \"leftEye\": [{\r\n" + - " \"value\": \"Rk1SACAyMAAAAAFcAAABPAFiAMUAxQEAAAAoNUB9AMF0V4CBAKBBPEC0AL68ZIC4AKjNZEBiAJvWXUBPANPWNUDSAK7RUIC2AQIfZEDJAPMxPEByAGwPXYCpARYPZECfAFjoZECGAEv9ZEBEAFmtV0BpAUGNXUC/AUEESUCUAVIEPEC2AVNxPICcALWuZICuALm3ZECNAJqxQ0CUAI3GQ0CXAPghV0BVAKDOZEBfAPqHXUBDAKe/ZIB9AG3xXUDPAIbZUEBcAGYhZECIASgHXYBJAGAnV0DjAR4jG0DKATqJIUCGADGSZEDSAUYGIUAxAD+nV0CXAK+oSUBoALr6Q4CSAOuKXUCiAIvNZEC9AJzQZIBNALbTXUBBAL68V0CeAHDZZECwAHPaZEBRAPwHUIBHAHW2XUDXARAUDUC4AS4HZEDXAS0CQ0CYADL4ZECsAUzuPEBkACgRZAAA\"\r\n" + - " }]\r\n" + - " }\r\n" + - " },\r\n" + - " \"tspID\": \"TEMP\"\r\n" + - "}"; - //EncryptionResponseDto encryptionResponseDTO=new EncryptionResponseDto(); - // testData=encryptMock.getEncryptedValue(testData,"TEMP"); - //ReflectionTestUtils.invokeMethod(encryptMock, "split", testData); - -// EncryptionRequestDto encryptionRequestDto=new EncryptionRequestDto(); -// encryptionRequestDto.setIdentityRequest(new ObjectMapper().readValue(testData.getBytes(), Map.class)); -// encryptMock.encrypt(encryptionRequestDto, null, false, false); - } - - - /** - * Old encrypt test. - * - * @throws JsonParseException the json parse exception - * @throws JsonMappingException the json mapping exception - * @throws IOException Signals that an I/O exception has occurred. - *//* - @Test - public void oldEncryptTest() throws JsonParseException, JsonMappingException, IOException { - String testData="{\r\n" + - " \"identityRequest\": {\r\n" + - " \"identity\": {\r\n" + - " \"leftEye\": [{\r\n" + - " \"value\": \"Rk1SACAyMAAAAAFcAAABPAFiAMUAxQEAAAAoNUB9AMF0V4CBAKBBPEC0AL68ZIC4AKjNZEBiAJvWXUBPANPWNUDSAK7RUIC2AQIfZEDJAPMxPEByAGwPXYCpARYPZECfAFjoZECGAEv9ZEBEAFmtV0BpAUGNXUC/AUEESUCUAVIEPEC2AVNxPICcALWuZICuALm3ZECNAJqxQ0CUAI3GQ0CXAPghV0BVAKDOZEBfAPqHXUBDAKe/ZIB9AG3xXUDPAIbZUEBcAGYhZECIASgHXYBJAGAnV0DjAR4jG0DKATqJIUCGADGSZEDSAUYGIUAxAD+nV0CXAK+oSUBoALr6Q4CSAOuKXUCiAIvNZEC9AJzQZIBNALbTXUBBAL68V0CeAHDZZECwAHPaZEBRAPwHUIBHAHW2XUDXARAUDUC4AS4HZEDXAS0CQ0CYADL4ZECsAUzuPEBkACgRZAAA\"\r\n" + - " }]\r\n" + - " }\r\n" + - " },\r\n" + - " \"tspID\": \"TEMP\"\r\n" + - "}"; - //EncryptionResponseDto encryptionResponseDTO=new EncryptionResponseDto(); - // testData=encryptMock.getEncryptedValue(testData,"TEMP"); - //ReflectionTestUtils.invokeMethod(encryptMock, "split", testData); - EncryptionRequestDto encryptionRequestDto=new EncryptionRequestDto(); - encryptionRequestDto.setTspID("TEMP"); - encryptionRequestDto.setIdentityRequest(new ObjectMapper().readValue(testData.getBytes(), Map.class)); - ReflectionTestUtils.invokeMethod(encryptMock, "oldEncrypt", encryptionRequestDto); - } - */ - /** - * Turnoff SSL check test. - * - * @throws KeyManagementException the key management exception - * @throws NoSuchAlgorithmException the no such algorithm exception - */ - @Test - public void turnoffSSLCheckTest() throws KeyManagementException, NoSuchAlgorithmException { - Encrypt.turnOffSslChecking(); - } -} diff --git a/authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/SignatureTest.java b/authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/SignatureTest.java deleted file mode 100644 index 6237af5a2e..0000000000 --- a/authentication-demo-service/src/test/java/io/mosip/testrig/authentication/demo/service/test/SignatureTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package io.mosip.testrig.authentication.demo.service.test; - -import java.security.cert.X509Certificate; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -import org.jose4j.jws.JsonWebSignature; -import org.jose4j.lang.JoseException; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.TestContext; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.web.context.WebApplicationContext; - -import io.mosip.kernel.crypto.jce.core.CryptoCore; - - -@RunWith(SpringRunner.class) -@WebMvcTest -@ContextConfiguration(classes = { TestContext.class, WebApplicationContext.class, CryptoCore.class }) - -public class SignatureTest { - - @Autowired - CryptoCore cryptoCore; - - @Test - public void testSign() throws JoseException { - String signatureTxt = "eyJhbGciOiJSUzI1NiIsInR5cCI6Imp3dCIsIng1YyI6WyJNSUlFSnpDQ0F3K2dBd0lCQWdJR0FXNGJwTTArTUEwR0NTcUdTSWIzRFFFQkN3VUFNSUhDTVNVd0l3WUpLb1pJaHZjTkFRa0JGaFp6ZFhKbGMyaGlZV0oxUUhONWJtTmllWFJsTG1sdU1SZ3dGZ1lEVlFRREV3OVRWVkpGVTBnZ1FrRkNWU0JOUTBzeEd6QVpCZ05WQkFzVEVsTnZablIzWVhKbElGTnZiSFYwYVc5dWN6RXRNQ3NHQTFVRUNoTWtVM2x1WTJKNWRHVWdTVzV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qfaaat16_Y2N738PAI1vZ1bXpXN1VUyohxmbFLoMc3BYND62qAyibzH1A3bswqyS4IhEN7ksCT-rMmJ9izkxKgjF4o3kZYWj1FvvseqKiOR54Q5WAWYRS_9pc0RqvTl0YV-Bu1kVsFORy-ELQ2-4p-qnm5KhLBve8vmVEx51JHTknIljEQzv7LuoJHxvy1he3hEKQIDZizqdzoo74NGznATgIWzqNBdmo1g"; - String[] payloadSignTxt = Arrays.stream(signatureTxt.split("\\.")).skip(3).toArray(s -> new String[s]); - String bioSign = Arrays.stream(payloadSignTxt).collect(Collectors.joining(".")); - JsonWebSignature jws = new JsonWebSignature(); - jws.setCompactSerialization(bioSign); - List certificateChainHeaderValue = jws.getCertificateChainHeaderValue(); - System.out.println(certificateChainHeaderValue.get(0)); - X509Certificate certificate = certificateChainHeaderValue.get(0); - //cryptoCore.sign(arg0, arg1) - } - -} diff --git a/authentication-demo-service/src/test/resources/application.properties b/authentication-demo-service/src/test/resources/application.properties deleted file mode 100644 index fbc302453d..0000000000 --- a/authentication-demo-service/src/test/resources/application.properties +++ /dev/null @@ -1,552 +0,0 @@ -mosip.base.url=https://qa-1201-b2.mosip.io - - -# Biometric Validation - uncomment and provide data or pass as VM args -#bio.test.server.provider=com.identy.IdentyBioSDK - -# ********** IdRepo **************** -mosip.kernel.jsonvalidator.property-source=CONFIG_SERVER -mosip.kernel.jsonvalidator.file-storage-uri=http://104.211.212.28:51000/kernel-idrepo-service/dev/DEV/ -mosip.kernel.jsonvalidator.schema-name=mosip-identity-json-schema.json -# ********** Common Properties **************** -ida-demo.api.version=v1 -server.port = 8081 -server.servlet.context-path = /${ida-demo.api.version}/identity -logging.level.* = debug -# Application ID of IDA -application.id=IDA -#Application name of IDA -application.name=ID-Authentication - -# public key -publicKey.ida =TUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUExQ09PMFVPRmxYem5tSXkybXJfYWVrMHhHYjh3WkQ1YjBTaHgwSTlVN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XJfYWVrMHhHYjh3WkQ1YjBTaHgwSTlVNHBEd0NnbldIRThONUlCX3NMNUpMX3NHdGdHUDJzNDZlTEJ0M2Nkc251eEhtbi1NNnV3cnlnX0tMSktSRUlZMEt0VkRxOTRVUlhBbXNIUWw5dmVIQUpqSE1GdVRQaEd0WDZtaU5JdGV5Y2d5Zi0tT3lEU3hPcXUzbUptVFNVbjhwUWdiWGJ1NVByblkwLVJ1YW5MRzFqSHZtQ0djMThqQUZITlB2a1RZUE90RVo4N3ItVng3N3J0MHhfdDM1eWpjZkJWb2s1dFMyaDB0a3EzdWY4alRHbGJSOVhSOGF1TWxmVnJPdWVjbkU0QVAyYjZWOUlENVFCV3hjaG45VUNqTi10Yl9LUm43QnVJZUhrdDJ3MW5xTlF2WjM4YmZYc2F5cU9vMTJEcENXNmFHUlFJREFRQUI= -publicKey.ida_fir =TUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUExQ09PMFVPRmxYem5tSXkybXJfYWVrMHhHYjh3WkQ1YjBTaHgwSTlVNHBEd0NnbldIRThONUlCX3NMNUpMX3NHdGdHUDJzNDZlTEJ0M2Nkc251eEhtbi1NNnV3cnlnX0tMSktSRUlZMEt0VkRxOTRVUlhBbXNIUWw5dmVIQUpqSE1GdVRQaEd0WDZtaU5JdGV5Y2d5Zi0tT3lEU3hPcXUzbUptVFNVbjhwUWdiWGJ1NVByblkwLVJ1YW5MRzFqSHZtQ0djMThqQUZITlB2a1RZUE90RVo4N3ItVng3N3J0MHhfdDM1eWpjZkJWb2s1dFMyaDB0a3EzdWY4alRHbGJSOVhSOGF1TWxmVnJPdWVjbkU0QVAyYjZWOUlENVFCV3hjaG45VUNqTi10Yl9LUm43QnVJZUhrdDJ3MW5xTlF2WjM4YmZYc2F5cU9vMTJEcENXNmFHUlFJREFRQUI= - -# Reference ID used for crypto manager in authentication -partner.reference.id=PARTNER -# Reference ID used for crypto manager in internal authentication -internal.reference.id=INTERNAL -# Reference ID used for crypto manager in authentication for biometrics -partner.biometric.reference.id=IDA-FIR -# Reference ID used for crypto manager in internal authentication for biometrics -internal.biometric.reference.id=INTERNAL - -keysplitter=#KEY_SPLITTER# - - -ida.api.version=1.0 - -# ********* Postgres Properties ************ -javax.persistence.jdbc.driver=org.postgresql.Driver -javax.persistence.jdbc.url=jdbc:postgresql://localhost:5432/ida_db -javax.persistence.jdbc.user=postgres -javax.persistence.jdbc.password=admin - - -# ********* Hibernate Properties *********** -hibernate.dialect=org.hibernate.dialect.PostgreSQL95Dialect -hibernate.jdbc.lob.non_contextual_creation=true -#hibernate.hbm2ddl.auto=update -hibernate.show_sql=true -hibernate.format_sql=true -hibernate.connection.charSet=utf8 -hibernate.cache.use_second_level_cache=false -hibernate.cache.use_query_cache=false -hibernate.cache.use_structured_entries=false -hibernate.generate_statistics=false -spring.datasource.initialization-mode=never - - -# ******** Functional configurations ******** -datetime.pattern=yyyy-MM-dd'T'HH:mm:ss.SSS'Z' -date.pattern=yyyy-MM-dd -datetime.pattern.withzone=yyyy-MM-dd'T'HH:mm:ss.SSSXXX - - -demo.default.match.value=60 - -# ********* ADMIN Configurations ************ -authrequest.received-time-allowed.in-hours=24 - -#********* Store Private Key ********* -sample.privatekey.filepath={0}\Private_key - -mosip.ida.encrypt-url=${mosip.base.url}/v1/keymanager/encrypt -mosip.ida.decrypt-url=${mosip.base.url}/v1/keymanager/decrypt -mosip.ida.publicKey-url=${mosip.base.url}/v1/keymanager/publickey/{appId} -mosip.ida.validate.signature-url=${mosip.base.url}/v1/keymanager/validate - -#Auth token -auth-token-generator.rest.uri=${mosip.base.url}/v1/authmanager/authenticate/clientidsecretkey -auth-token-generator.rest.clientId=ida -auth-token-generator.rest.secretKey=bad25866-e6a5-4f93-831a-08923ea6eee0 -auth-token-generator.rest.appId=ida - - -auth-token-generator-user.rest.uri=${mosip.base.url}/v1/authmanager/authenticate/useridPwd -auth-token-generator-user.rest.userName=110006 -auth-token-generator-user.rest.password=mosip -auth-token-generator-user.rest.appId=ida - -add-device-provider-url=${mosip.base.url}/v1/masterdata/deviceprovider -add-device-provider-request-template={\ - "address": "test",\ - "certificateAlias": "added",\ - "contactNumber": "9663175928",\ - "email": "test@mosip.io",\ - "isActive": true,\ - "vendorName": "$DEVICE_PROVIDER_NAME"\ -} - -add-mds-request-url=${mosip.base.url}/v1/masterdata/mosipdeviceservice -add-mds-request-template={\ - "isActive": true,\ - "deviceProviderId": "$DEVICE_PROVIDER_ID",\ - "make": "$MAKE",\ - "model": "$MODEL",\ - "regDeviceSubCode": "$DEVICE_SUB_TYPE_CODE",\ - "regDeviceTypeCode": "$DEVICE_TYPE_CODE",\ - "swBinaryHash": "test",\ - "swCreateDateTime": "2019-11-19T07:00:13.375Z",\ - "swExpiryDateTime": "2019-11-30T07:00:13.375Z",\ - "swVersion": "$SERVICE_VERSION"\ -} - -add-device-request-url=${mosip.base.url}/v1/masterdata/registereddevices -add-device-request-template={\ - "deviceData": {\ - "deviceId": "70959dd5-e45f-438a-9ff8-9b263908e572",\ - "purpose": "$PURPOSE",\ - "deviceInfo": {\ - "deviceSubId": "$DEVICE_SUB_ID",\ - "certification": "L0",\ - "digitalId": {\ - "serialNo": "$SERIAL_NO",\ - "deviceProvider": "$DEVICE_PROVIDER_NAME",\ - "deviceProviderId": "$DEVICE_PROVIDER_ID",\ - "make": "$MAKE",\ - "model": "$MODEL",\ - "dateTime": "2020-01-13T07:20:42.195Z",\ - "type": "$DEVICE_TYPE_CODE",\ - "subType": "$DEVICE_SUB_TYPE_CODE"\ - },\ - "firmware": "firmware",\ - "deviceExpiry": "2020-01-13T12:50:42.196Z",\ - "timeStamp": "2020-01-13T12:50:42.208Z"\ - },\ - "foundationalTrustProviderId": ""\ - }\ -} - -validate-device-request-url=${mosip.base.url}/v1/masterdata/deviceprovidermanagement/validate -validate-device-request-template={\ - "deviceCode": "$DEVICE_CODE",\ - "digitalId": {\ - "serialNo": "$SERIAL_NO",\ - "dp": "$DEVICE_PROVIDER_NAME",\ - "dpId": "$DEVICE_PROVIDER_ID",\ - "make": "$MAKE",\ - "model": "$MODEL",\ - "type": "$DEVICE_TYPE",\ - "subType": "$DEVICE_SUB_TYPE",\ - "dateTime": "2019-12-05T10:41:15.052Z"\ - },\ - "deviceServiceVersion": "$SERVICE_VERSION"\ -} - -dev.master.db.url=jdbc:postgresql://104.211.208.136:9001/mosip_master -qa.master.db.url=jdbc:postgresql://52.172.54.231:9001/mosip_master -int.master.db.url=jdbc:postgresql://104.211.202.203:9001/mosip_master -ext-int.master.db.url=jdbc:postgresql://52.172.14.84:9001/mosip_master -preprod.master.db.url=jdbc:postgresql://150.10.40.12:9001/mosip_master - -master.db.user=bWFzdGVydXNlcg -master.db.pass=TW9zaXBAZGV2MTIz - -dev.ida.db.url=jdbc:postgresql://104.211.208.136:9001/mosip_ida -qa.ida.db.url=jdbc:postgresql://52.172.54.231:9001/mosip_ida -int.ida.db.url=jdbc:postgresql://104.211.202.203:9001/mosip_ida -ext-int.ida.db.url=jdbc:postgresql://52.172.14.84:9001/mosip_ida -preprod.ida.db.url=jdbc:postgresql://104.211.242.168:9001/mosip_ida - -ida.db.user=aWRhdXNlcg -ida.db.pass=TW9zaXBAZGV2MTIz - -mosip.ida.publickey=IDA - -ida.authRequest.template={"consentObtained": true, "id": "mosip.identity.$authType", "individualId": "$id", "individualIdType": "$idType", "keyIndex": "string", "request":"$encRequest", "requestHMAC": "$encHmac", "requestSessionKey": "$encSessionKey", "requestTime": "$timestamp", "requestedAuth": { "bio": $bio, "demo": $demo, "otp": $otp, "pin": $pin }, "transactionID": "$txn", "version": "$ver" } - -#---------------Global Config----------------- - - -#Kernel-idobjectalidator -# Plug in property source as either 'LOCAL' or 'CONFIG_SERVER' or 'APPLICATION_CONTEXT' through this key -mosip.kernel.idobjectvalidator.property-source=APPLICATION_CONTEXT -mosip.kernel.idobjectvalidator.schema-name=mosip-identity-json-schema.json -mosip.kernel.idobjectvalidator.file-storage-uri=${spring.cloud.config.uri}/${spring.application.name}/${spring.profiles.active}/${spring.cloud.config.label}/ - -mosip.kernel.idobjectvalidator.masterdata.languages.rest.uri=${mosip.base.url}/v1/masterdata/languages -mosip.kernel.idobjectvalidator.masterdata.gendertypes.rest.uri=${mosip.base.url}/v1/masterdata/gendertypes -mosip.kernel.idobjectvalidator.masterdata.documentcategories.rest.uri=${mosip.base.url}/v1/masterdata/documentcategories -mosip.kernel.idobjectvalidator.masterdata.documenttypes.rest.uri=${mosip.base.url}/v1/masterdata/documenttypes/{documentcategorycode}/{langcode} -mosip.kernel.idobjectvalidator.masterdata.locations.rest.uri=${mosip.base.url}/v1/masterdata/locations/{langcode} -mosip.kernel.idobjectvalidator.masterdata.locationhierarchy.rest.uri=${mosip.base.url}/v1/masterdata/locations/locationhierarchy/{hierarchyname} - -mosip.kernel.idobjectvalidator.mandatory-attributes.id-repository.new-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus -mosip.kernel.idobjectvalidator.mandatory-attributes.pre-registration.new-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus -mosip.kernel.idobjectvalidator.mandatory-attributes.reg-client.new-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus -mosip.kernel.idobjectvalidator.mandatory-attributes.reg-processor.new-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus -mosip.kernel.idobjectvalidator.mandatory-attributes.pre-registration.child-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus -mosip.kernel.idobjectvalidator.mandatory-attributes.reg-client.child-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus,parentOrGuardianName,parentOrGuardianRID|parentOrGuardianUIN,parentOrGuardianBiometrics -mosip.kernel.idobjectvalidator.mandatory-attributes.reg-processor.child-registration=fullName,dateOfBirth|age,gender,addressLine1,region,province,city,zone,postalCode,referenceIdentityNumber,residenceStatus,parentOrGuardianName,parentOrGuardianRID|parentOrGuardianUIN,parentOrGuardianBiometrics - -# Business Validation for ID Schema attributes - These should not be changed, as it impacts all modules -mosip.id.validation.identity.dateOfBirth=^(19\\d\\d|20\\d\\d)/([0][1-9]|1[0-2])/([0][1-9]|[1-2]\\d|3[01])$ -mosip.id.validation.identity.phone=^([6-9]{1})([0-9]{9})$ -mosip.id.validation.identity.email=^[\\w-\\+]+(\\.[\\w]+)*@[\\w-]+(\\.[\\w]+)*(\\.[a-zA-Z]{2,})$ -mosip.id.validation.identity.postalCode=^[(?i)A-Z0-9]{5}$ -mosip.id.validation.identity.age=^(150|1[0-4][0-9]|[1-9]?[0-9])$ -mosip.id.validation.identity.fullName.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.addressLine1.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.addressLine2.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.addressLine3.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.region.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.province.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.city.[*].value=^(?=.{0,50}$).* -mosip.id.validation.identity.[*].[*].language=^[(?i)a-z]{3}$ -mosip.id.validation.identity.referenceIdentityNumber=^([0-9]{10,30})$ -mosip.country.code=MOR - -# Language Supported By Platform - ISO -mosip.supported-languages=eng,ara,fra - -mosip.primary-language=eng -mosip.secondary-language=ara - -# Application IDs -mosip.prereg.app-id=PRE_REGISTRATION -mosip.reg.app-id=REGISTRATION -mosip.regproc.app-id=REGISTRATION_PROCESSOR -mosip.ida.app-id=IDA -mosip.idrepo.app-id=ID_REPO - -# UTC ISO Date Time Pattern -mosip.utc-datetime-pattern=yyyy-MM-dd'T'HH:mm:ss.SSS'Z' - -mosip.signed.response.header=response-signature - - -#----------------------- CBEFF Util-------------------------------------------------- -# Cbeff URL where the files will be stored in git, change it accordingly in case of change of storage location. -mosip.kernel.xsdstorage-uri=${spring.cloud.config.uri}/${spring.application.name}/${spring.profiles.active}/${spring.cloud.config.label}/ -# Cbeff XSD file name in config server -mosip.kernel.xsdfile=mosip-cbeff-extint.xsd - -#----------------------------- Applicant Type -------------------------------------------------- -mosip.kernel.applicant.type.age.limit = 5 - -#----------------------------- Static PIN -------------------------------------------------- -mosip.kernel.pin.length=6 - -#-----------------------------TspId ----------------------------------------------- -#length of the Tsp id -mosip.kernel.tspid.length=4 - -#-----------------------------partnerId ----------------------------------------------- -#length of the partner id -mosip.kernel.partnerid.length=4 - -#-----------------------------TOKEN-ID Properties--------------------------------- -#lenght of the token id -mosip.kernel.tokenid.length=36 - -#-----------------------------Registration Center Id ----------------------------------------------- -#length of the registration center id -mosip.kernel.registrationcenterid.length=5 - -#-----------------------------Machine Id ----------------------------------------------- -#length of the machine id -mosip.kernel.machineid.length=5 - -#-----------------------------RID Properties--------------------------------------- -# length of the rid -mosip.kernel.rid.length=29 -# length of the timestamp -mosip.kernel.rid.timestamp-length=14 -# rid sequence max digits -mosip.kernel.rid.sequence-length=5 - -# Upper bound of number of digits in sequence allowed in id. For example if -# limit is 3, then 12 is allowed but 123 is not allowed in id (in both -# ascending and descending order) -mosip.kernel.tokenid.sequence-limit=3 - -#-----------------------------PRID Properties------------------------------------ - -#prid-length -mosip.kernel.prid.length=14 - -# Upper bound of number of digits in sequence allowed in id. For example if -# limit is 3, then 12 is allowed but 123 is not allowed in id (in both -# ascending and descending order) -#to disable validation assign zero or negative value -mosip.kernel.prid.sequence-limit=3 - -# Number of digits in repeating block allowed in id. For example if limit is 2, -# then 4xxx4 is allowed but 48xxx48 is not allowed in id (x is any digit) -#to disable validation assign zero or negative value -mosip.kernel.prid.repeating-block-limit=3 - - -# Lower bound of number of digits allowed in between two repeating digits in -# id. For example if limit is 2, then 11 and 1x1 is not allowed in id (x is any digit) to disable validation assign zero or negative value -mosip.kernel.prid.repeating-limit=2 - -# list of number that id should not be start with to disable null -mosip.kernel.prid.not-start-with=0,1 - -#restricted numbers for prid -mosip.kernel.prid.restricted-numbers=786,666 - - -#-----------------------------VID Properties-------------------------------------- -# length of the vid -mosip.kernel.vid.length=16 - -# Upper bound of number of digits in sequence allowed in id. For example if -# limit is 3, then 12 is allowed but 123 is not allowed in id (in both -# ascending and descending order) -# to disable sequence limit validation assign 0 or negative value -mosip.kernel.vid.length.sequence-limit=3 - -# Number of digits in repeating block allowed in id. For example if limit is 2, -# then 4xxx4 is allowed but 48xxx48 is not allowed in id (x is any digit) -# to disable repeating block validation assign 0 or negative value -mosip.kernel.vid.length.repeating-block-limit=2 - - -# Lower bound of number of digits allowed in between two repeating digits in -# id. For example if limit is 2, then 11 and 1x1 is not allowed in id (x is any digit) -# to disable repeating limit validation, assign 0 or negative value -mosip.kernel.vid.length.repeating-limit=2 - -# list of number that id should not be start with -# to disable null -mosip.kernel.vid.not-start-with=0,1 - -#restricted numbers for vid -mosip.kernel.vid.restricted-numbers=786,666 - -#-----------------------------UIN Properties-------------------------------------- -#length of the uin -mosip.kernel.uin.length=10 -#minimum threshold of unused uin -mosip.kernel.uin.min-unused-threshold=200000 -#number of uins to generate -mosip.kernel.uin.uins-to-generate=500000 -#restricted numbers for uin -mosip.kernel.uin.restricted-numbers=786,666 - -# Upper bound of number of digits in sequence allowed in id. For example if -# limit is 3, then 12 is allowed but 123 is not allowed in id (in both -# ascending and descending order) -# to disable sequence limit validation assign 0 or negative value -mosip.kernel.uin.length.sequence-limit=3 - -# Number of digits in repeating block allowed in id. For example if limit is 2, -# then 4xxx4 is allowed but 48xxx48 is not allowed in id (x is any digit) -#to disable validation assign zero or negative value -mosip.kernel.uin.length.repeating-block-limit=2 - -# Lower bound of number of digits allowed in between two repeating digits in -# id. For example if limit is 2, then 11 and 1x1 is not allowed in id (x is any digit) -# to disable repeating limit validation, assign 0 or negative value -mosip.kernel.uin.length.repeating-limit=2 - -#reverse group digit limit for uin filter -mosip.kernel.uin.length.reverse-digits-limit=5 - -#group digit limit for uin filter -mosip.kernel.uin.length.digits-limit=5 - -#should not start with -mosip.kernel.uin.not-start-with=0,1 - -#adjacent even digit limit for uin filter -mosip.kernel.uin.length.conjugative-even-digits-limit=3 - - - - -#----------------------- SMS Service-------------------------------------- -mosip.kernel.sms.country.code=91 -mosip.kernel.sms.number.length=10 - - -#------------------------Auth-Adapter----------------------------------------------- -auth.server.validate.url=${mosip.base.url}/v1/authmanager/authorize/validateToken -auth.jwt.secret=authjwtsecret -auth.jwt.base=Mosip-Token - - -#----------------------- Crypto -------------------------------------------------- -#Crypto asymmetric algorithm name -mosip.kernel.crypto.asymmetric-algorithm-name=RSA/ECB/OAEPWITHSHA-256ANDMGF1PADDING -#Crypto symmetric algorithm name -mosip.kernel.crypto.symmetric-algorithm-name=AES/GCM/PKCS5Padding -#Keygenerator asymmetric algorithm name -mosip.kernel.keygenerator.asymmetric-algorithm-name=RSA -#Keygenerator symmetric algorithm name -mosip.kernel.keygenerator.symmetric-algorithm-name=AES -#Asymmetric algorithm key length -mosip.kernel.keygenerator.asymmetric-key-length=2048 -#Symmetric algorithm key length -mosip.kernel.keygenerator.symmetric-key-length=256 - -#Encrypted data and encrypted symmetric key separator -mosip.kernel.data-key-splitter=#KEY_SPLITTER# -#GCM tag length -mosip.kernel.crypto.gcm-tag-length=128 -#Hash algo name -mosip.kernel.crypto.hash-algorithm-name=PBKDF2WithHmacSHA512 -#Symmtric key length used in hash -mosip.kernel.crypto.hash-symmetric-key-length=256 -#No of iterations in hash -mosip.kernel.crypto.hash-iteration=100000 -#Sign algo name -mosip.kernel.crypto.sign-algorithm-name=RS512 - -mosip.kernel.keymanager-service-publickey-url=${mosip.base.url}/v1/keymanager/publickey/{applicationId} -mosip.kernel.keymanager-service-decrypt-url=${mosip.base.url}/v1/keymanager/decrypt -mosip.kernel.keymanager-service-auth-decrypt-url=${mosip.base.url}/v1/keymanager/auth/decrypt -mosip.kernel.keymanager-service-sign-url=${mosip.base.url}/v1/keymanager/sign -mosip.sign.applicationid=KERNEL -mosip.sign.refid=SIGN -mosip.kernel.cryptomanager.request_id=CRYPTOMANAGER.REQUEST -mosip.kernel.cryptomanager.request_version=v1.0 -mosip.kernel.signature.signature-request-id=SIGNATURE.REQUEST -mosip.kernel.signature.signature-version-id=v1.0 - - - -#----------------------------------ID Repo------------------------------------------ -mosip.idrepo.identity.uin-status.registered=ACTIVATED -mosip.idrepo.identity.uin-status=ACTIVATED,BLOCKED,DEACTIVATED - -#---------------------------------------otp manager service------------------------------- -#the default length for otp(in number) -mosip.kernel.otp.default-length=6 -#the default crypto function -#It can be: HmacSHA512, HmacSHA256, HmacSHA1. -mosip.kernel.otp.mac-algorithm=HmacSHA512 -#the OTP expires after the given time(in seconds). -mosip.kernel.otp.expiry-time=180 -#the key is freezed for the given time(in seconds). -mosip.kernel.otp.key-freeze-time=1800 -#the number of validation attempts allowed(in number). -#mosip.kernel.otp.validation-attempt-threshold =3 means , the validation and generation will be blocked from 4th time. -mosip.kernel.otp.validation-attempt-threshold=10 -#minimum length of key(in number). -mosip.kernel.otp.min-key-length=3 -#maximum length of key(in number). -mosip.kernel.otp.max-key-length=64 - - -#--------------------------------------Licensekeymanager Service-------------------------------------- -#the license key length. -mosip.kernel.licensekey.length=16 -#List of permissions -# NOTE: ',' in the below list is used as splitter in the implementation. -# Use of ',' in the values for below key should be avoided. -# Use of spaces before and after ',' also should be avoided. -mosip.kernel.licensekey.permissions=OTP Trigger,OTP Authentication,Demo Authentication - Identity Data Match,Demo Authentication - Address Data Match,Demo Authentication - Full Address Data Match,Demo Authentication - Secondary Language Match,Biometric Authentication - FMR Data Match,Biometric Authentication - IIR Data Match,Biometric Authentication - FID Data Match,Static Pin Authentication,eKYC - limited,eKYC - Full,eKYC - No - - - -#-----------------------------Virus Scanner-------------------------------------- -#Virus Scanner server url -mosip.kernel.virus-scanner.host=10.0.2.7 -#Virus Scanner server port -mosip.kernel.virus-scanner.port=3310 - - - -#-------------------------------FS Adapter- HDFS ------------------------------- -# Name node url for HDFS - Non Secured -mosip.kernel.fsadapter.hdfs.name-node-url=hdfs://13.71.117.37:51000 -# Name node url for HDFS - Secured (auth enabled) -#mosip.kernel.fsadapter.hdfs.name-node-url=hdfs://13.71.117.37:51000 -# Enable if hadoop security authorization is 'true', default is false -mosip.kernel.fsadapter.hdfs.authentication-enabled=false -# HDFS log level. Change this to debug to see hdfs logs -logging.level.org.apache.hadoop=warn -# If HDFS is security is configured with Kerberos, Key Distribution Center domain -mosip.kernel.fsadapter.hdfs.kdc-domain=HDFSKERBEROS1.SOUTHINDIA.CLOUDAPP.AZURE.COM -# Username to access hdfs. Change this to application username (regprocessor,prereg or idrepo) -#mosip.kernel.fsadapter.hdfs.user-name=mosipuser -#keytab file path, must be set if authentication-enable is true -#read keytab file both classpath and physical path ,append appropriate prefix -#for classpath prefix classpath:mosip.keytab -#for physical path prefix file:/home/keys/mosip.keytab -mosip.kernel.fsadapter.hdfs.keytab-file=classpath:mosip.keytab - - - -#---------------Transliteration----------------------- -mosip.kernel.transliteration.arabic-language-code=ara -mosip.kernel.transliteration.franch-language-code=fra - - -#-------Registration processor Notification types------------ -mosip.registration.processor.notification.types=SMS|EMAIL - - -mosip.default.dob.month=01 -mosip.default.dob.day=01 -mosip.login.mode= email,mobile - - -#---Language orientation----- -mosip.right_to_left_orientation=ara -mosip.left_to_right_orientation=eng,fra - - -#**************** Notification Type ************* -mosip.notificationtype=SMS|EMAIL -#******** Notification lanugage types - either PRIMARY or BOTH ******** -mosip.notification.language-type=BOTH - - -#-------------------System--------------- -logging.level.org.springframework.web.filter.CommonsRequestLoggingFilter=INFO - -#-------------------Encryption and Decryption--------------------------- -mosip.kernel.encrypt.url=${mosip.base.url}/v1/keymanager/encrypt -mosip.kernel.decrypt.url=${mosip.base.url}/v1/keymanager/decrypt - -#------------------PDF Genration----------------------------------------- -mosip.kernel.pdf_owner_password=somepassword - -#-------UIN Alias------------------- -mosip.uin.alias= - - -#------------------Quality Check----------------------------------------- -#Quality threshold for applicant iris -mosip.iris_threshold=0 -#Quality threshold for applicant leftslap fingerprint -mosip.leftslap_fingerprint_threshold=0 -#Quality threshold for applicant rightslap fingerprint -mosip.rightslap_fingerprint_threshold=0 -#Quality threshold for applicant thumbs fingerprint -mosip.thumbs_fingerprint_threshold=0 -#Quality threshold for applicant face -mosip.facequalitythreshold=0 -#Bio SDK Integration -mosip.fingerprint.provider=ai.tech5.auth.service.T5AuthFingerImpl -mosip.face.provider=ai.tech5.auth.service.T5AuthFaceImpl -mosip.iris.provider=ai.tech5.auth.service.T5AuthIrisImpl \ No newline at end of file diff --git a/authentication-demo-service/src/test/resources/bootstrap.properties b/authentication-demo-service/src/test/resources/bootstrap.properties deleted file mode 100644 index 40812aa5f0..0000000000 --- a/authentication-demo-service/src/test/resources/bootstrap.properties +++ /dev/null @@ -1,5 +0,0 @@ -spring.cloud.config.enabled=false - -#disabling health check so that client doesnt try to load properties from sprint config server every -# 5 minutes (should not be done in production) -health.config.enabled=false \ No newline at end of file diff --git a/authentication-demo-service/src/test/resources/errormessages.properties b/authentication-demo-service/src/test/resources/errormessages.properties deleted file mode 100644 index 4924e33426..0000000000 --- a/authentication-demo-service/src/test/resources/errormessages.properties +++ /dev/null @@ -1,47 +0,0 @@ -IDA-OTA-001=Phone no and e-mail not registered. Individual has to register and try again -IDA-OTA-002=Request received at MOSIP is {0} min post the initiation at TSP -IDA-OTA-003=Innumerous OTP requests received -IDA-OTA-004=Could not generate/send OTP -IDA-OTA-005=OTP has expired -IDA-OTA-006=OTP is invalid -IDA-OTA-007=Input txnID does not match txnID of OTP Request -IDA-OTA-009=Missing OTP value -IDA-OTA-010=Request could not be processed. Please try again -IDA-OTA-101=Key is Null or Invalid -IDA-OTA-102=Kernel Validate OTP request failed -IDA-OTA-103=Kernel Generate OTP request failed - -IDA-MLC-001=Request to be received at MOSIP within {0} hrs/min -IDA-MLC-002=Invalid UIN -IDA-MLC-003=UIN has been deactivated -IDA-MLC-004=Invalid VID -IDA-MLC-005=Expired VID -IDA-MLC-101=Unknown error occured - -IDA-IDV-001=Input Data Validation Failed -IDA-IDV-002=Invalid Input Parameter - {0} _EN -IDA-IDV-003=Missing Input Parameter - {0} -IDA-IDV-005=Inactive VID -IDA-IDV-101=VID is not present or not matched -IDA-IDV-102=Invalid Id-Type - -IDA-AUT-501=Authentication failed - -IDA-RST-001=URI should not be empty -IDA-RST-002=httpMethod is empty or invalid -IDA-RST-003=returnType is empty -IDA-RST-004=Rest service name is empty or invalid -IDA-RST-005=Timeout is invalid -IDA-RST-006=4XX - Client Error occured -IDA-RST-007=5XX - Server Error occured -IDA-RST-008=Connection timed out - -IDA-RQV-101=Invalid Auth Request - -IDA-DEA-014=Required Address(ad) attribute is missing -IDA-DEA-015=Required Full Address(fad) attribute is missing -IDA-DEA-033=Demographic data DOB Type (pi) did not match - -IDA-AD-RQV-003=Full Address and Address are mutually exclusive -IDA-PRSNL-RQV-001=Atleast one valid attribute should be present -IDA-PRSNL-RQV-001=Atleat one valid attribute should be present \ No newline at end of file diff --git a/authentication-demo-service/src/test/resources/ida-mapping.json b/authentication-demo-service/src/test/resources/ida-mapping.json deleted file mode 100644 index a83d942340..0000000000 --- a/authentication-demo-service/src/test/resources/ida-mapping.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "ida-mapping" : - { - "name" : - [ - "firstName", - "middleName", - "lastName" - ], - "dob" : - [ - "dateOfBirth" - ], - "dobType": - [ - "dateOfBirthType" - ], - "age" : - [ - "age" - ], - "gender" : - [ - "gender" - ], - "phoneNumber" : - [ - "mobileNumber" - ], - "emailId" : - [ - "emailId" - ], - "addressLine1" : - [ - "addressLine1" - ], - "addressLine2" : - [ - "addressLine2" - ], - "addressLine3" : - [ - "addressLine3" - ], - "location1" : - [ - "city" - ], - "location2" : [ - "region" - ], - "location3" : [ - "province" - ], - "pinCode" : - [ - "pinCode" - ], - "fullAddress" : - [ - "addressLine1", - "addressLine2", - "addressLine3", - "location1", - "location2", - "location3", - "pinCode" - ], - "otp" : - [ - "otp" - ], - "pin" : - [ - "pin" - ], - "iris" : - [ - "leftEye", - "rightEye" - ], - "fingerprint" : - [ - "leftIndex", - "leftLittle", - "leftMiddle", - "leftRing", - "leftThumb", - "rightIndex", - "rightLittle", - "rightMiddle", - "rightRing", - "rightThumb" - ], - "face" : - [ - "face" - ] - } -} \ No newline at end of file diff --git a/authentication-demo-service/src/test/resources/idaLogger.xml b/authentication-demo-service/src/test/resources/idaLogger.xml deleted file mode 100644 index 45bc626f5d..0000000000 --- a/authentication-demo-service/src/test/resources/idaLogger.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - true - logs/id-auth.log - true - true - logs/id-auth-%d{yyyy-MM-dd}-%i.log - 1mb - 3 - 10mb - \ No newline at end of file From d30077f421ded4cde4172971e540e7391c0c72a6 Mon Sep 17 00:00:00 2001 From: Mohanachandran S Date: Wed, 26 Mar 2025 15:19:58 +0530 Subject: [PATCH 3/5] MOSIP-40951 - Added method for creating expiry timestamp Signed-off-by: Mohanachandran S --- .../io/mosip/testrig/apirig/utils/AdminTestUtil.java | 10 ++++++++++ .../src/main/resources/config/Kernel.properties | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/AdminTestUtil.java b/apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/AdminTestUtil.java index d433b6254b..57c03dc1e9 100644 --- a/apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/AdminTestUtil.java +++ b/apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/AdminTestUtil.java @@ -2787,6 +2787,8 @@ public String inputJsonKeyWordHandeler(String jsonString, String testCaseName) { } if (jsonString.contains(GlobalConstants.TIMESTAMP)) jsonString = replaceKeywordWithValue(jsonString, GlobalConstants.TIMESTAMP, generateCurrentUTCTimeStamp()); + if (jsonString.contains("$EXPIRYTIMESTAMP$")) + jsonString = replaceKeywordWithValue(jsonString, "$EXPIRYTIMESTAMP$", generateExpiryUTCTimeStamp()); if (jsonString.contains(GlobalConstants.TRANSACTION_ID)) jsonString = replaceKeywordWithValue(jsonString, GlobalConstants.TRANSACTION_ID, TRANSACTION_ID); if (jsonString.contains("$DATESTAMP$")) @@ -3276,6 +3278,14 @@ public static String generateCurrentUTCTimeStamp() { dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); return dateFormat.format(date); } + + public static String generateExpiryUTCTimeStamp() { + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.SECOND, Integer.parseInt(ConfigManager.getproperty("expirationTime"))); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); + dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + return dateFormat.format(calendar.getTime()); + } public static String generateCurrentUTCDateStamp() { Date date = new Date(); diff --git a/apitest-commons/src/main/resources/config/Kernel.properties b/apitest-commons/src/main/resources/config/Kernel.properties index ea4cc1d5e1..303b9d1a4d 100644 --- a/apitest-commons/src/main/resources/config/Kernel.properties +++ b/apitest-commons/src/main/resources/config/Kernel.properties @@ -129,7 +129,7 @@ admin_password=mosip123 admin_userName=220005 admin_zone_password=mosip123 admin_zone_userName=globaladmin - +expirationTime=120 #------------------------- Need to check if these are used or not ------------------------# From f6623fc2df1e0993e3663d6e70fab85e71eca2b1 Mon Sep 17 00:00:00 2001 From: Chandra Keshav Mishra Date: Thu, 27 Mar 2025 16:42:38 +0530 Subject: [PATCH 4/5] [DSD-7717] apitest commons 1.3.2 release (#1758) * Updated Pom versions for release changes Signed-off-by: GitHub * [DSD-7717] apitest commons 1.3.2 release Signed-off-by: techno-467 * [DSD-7717] apitest commons 1.3.2 release Signed-off-by: techno-467 --------- Signed-off-by: GitHub Signed-off-by: techno-467 Co-authored-by: Prafulrakhade Co-authored-by: techno-467 --- .github/workflows/apitest-push-trigger.yml | 2 +- apitest-commons/pom.xml | 4 +- deploy/apitestrig/install.sh | 2 +- deploy/apitestrig/values.yaml | 70 ++++++++++++---------- deploy/uitestrig/copy_cm.sh | 0 deploy/uitestrig/copy_secrets.sh | 0 deploy/uitestrig/delete.sh | 0 deploy/uitestrig/install.sh | 4 +- deploy/uitestrig/values.yaml | 4 +- helm/apitestrig/Chart.yaml | 2 +- helm/apitestrig/values.yaml | 42 ++++++------- helm/uitestrig/Chart.yaml | 2 +- helm/uitestrig/values.yaml | 4 +- 13 files changed, 71 insertions(+), 65 deletions(-) mode change 100644 => 100755 deploy/uitestrig/copy_cm.sh mode change 100644 => 100755 deploy/uitestrig/copy_secrets.sh mode change 100644 => 100755 deploy/uitestrig/delete.sh mode change 100644 => 100755 deploy/uitestrig/install.sh diff --git a/.github/workflows/apitest-push-trigger.yml b/.github/workflows/apitest-push-trigger.yml index c3f27d1a17..e8bfef92a1 100644 --- a/.github/workflows/apitest-push-trigger.yml +++ b/.github/workflows/apitest-push-trigger.yml @@ -44,7 +44,7 @@ jobs: secrets: OSSRH_USER: ${{ secrets.OSSRH_USER }} OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }} - OSSRH_URL: ${{ secrets.OSSRH_SNAPSHOT_URL }} + OSSRH_URL: ${{ secrets.RELEASE_URL }} OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} GPG_SECRET: ${{ secrets.GPG_SECRET }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} diff --git a/apitest-commons/pom.xml b/apitest-commons/pom.xml index dcbcb4a276..3a02c1f806 100644 --- a/apitest-commons/pom.xml +++ b/apitest-commons/pom.xml @@ -8,7 +8,7 @@ apitest-commons Parent project of MOSIP functional tests https://github.com/mosip/mosip-functional-tests - 1.3.2-SNAPSHOT + 1.3.2 @@ -66,7 +66,7 @@ 3.3.9 7.11.0 1.13 - apitest-commons-1.3.2-SNAPSHOT-jar-with-dependencies + apitest-commons-1.3.2-jar-with-dependencies diff --git a/deploy/apitestrig/install.sh b/deploy/apitestrig/install.sh index cfaed8c31e..2ff0fa80d2 100755 --- a/deploy/apitestrig/install.sh +++ b/deploy/apitestrig/install.sh @@ -7,7 +7,7 @@ if [ $# -ge 1 ] ; then fi NS=apitestrig -CHART_VERSION=0.0.1-develop +CHART_VERSION=1.3.2 echo Create $NS namespace kubectl create ns $NS diff --git a/deploy/apitestrig/values.yaml b/deploy/apitestrig/values.yaml index c72ff991cd..937169416c 100644 --- a/deploy/apitestrig/values.yaml +++ b/deploy/apitestrig/values.yaml @@ -1,69 +1,75 @@ modules: prereg: - enabled: true + enabled: false image: - repository: mosipqa/apitest-prereg - tag: develop + repository: mosipid/apitest-prereg + tag: 1.3.0-beta.1 pullPolicy: Always masterdata: - enabled: true + enabled: false image: - repository: mosipqa/apitest-masterdata - tag: develop + repository: mosipid/apitest-masterdata + tag: 1.3.0-beta.1 pullPolicy: Always idrepo: - enabled: true + enabled: false image: - repository: mosipqa/apitest-idrepo - tag: develop + repository: mosipid/apitest-idrepo + tag: 1.3.0-beta.1 pullPolicy: Always partner: - enabled: true + enabled: false image: - repository: mosipqa/apitest-pms - tag: develop + repository: mosipid/apitest-pms + tag: 1.2.2.0 pullPolicy: Always pms: - enabled: true + enabled: false image: - repository: mosipdev/apitest-pms - tag: develop + repository: mosipid/apitest-pms + tag: 1.2.2.0 pullPolicy: Always resident: - enabled: true + enabled: false image: - repository: mosipqa/apitest-resident - tag: develop + repository: mosipid/apitest-resident + tag: 1.3.0-beta.2 pullPolicy: Always auth: - enabled: true + enabled: false image: - repository: mosipqa/apitest-auth - tag: develop + repository: mosipid/apitest-auth + tag: 1.3.0-beta.1 pullPolicy: Always esignet: - enabled: true + enabled: false image: - repository: mosipqa/apitest-esignet - tag: develop + repository: mosipid/apitest-esignet + tag: 1.5.1 pullPolicy: Always mimoto: - enabled: true + enabled: false image: - repository: mosipqa/apitest-mimoto - tag: develop + repository: mosipid/apitest-mimoto + tag: 0.15.2 pullPolicy: Always injicertify: - enabled: true + enabled: false image: - repository: mosipqa/apitest-injicertify + repository: mosipid/apitest-inji-certify + tag: 0.10.2 + pullPolicy: Always + injiverify: + enabled: false + image: + repository: mosipqa/apitest-inji-verify tag: develop pullPolicy: Always esignet-signup: - enabled: true + enabled: false image: - repository: mosipqa/apitest-esignet-signup - tag: develop + repository: mosipid/apitest-esignet-signup + tag: 1.1.1 pullPolicy: Always variables: push_reports_to_s3: "yes" diff --git a/deploy/uitestrig/copy_cm.sh b/deploy/uitestrig/copy_cm.sh old mode 100644 new mode 100755 diff --git a/deploy/uitestrig/copy_secrets.sh b/deploy/uitestrig/copy_secrets.sh old mode 100644 new mode 100755 diff --git a/deploy/uitestrig/delete.sh b/deploy/uitestrig/delete.sh old mode 100644 new mode 100755 diff --git a/deploy/uitestrig/install.sh b/deploy/uitestrig/install.sh old mode 100644 new mode 100755 index 98c0577ff1..c7127a99cf --- a/deploy/uitestrig/install.sh +++ b/deploy/uitestrig/install.sh @@ -7,7 +7,7 @@ if [ $# -ge 1 ] ; then fi NS=uitestrig -CHART_VERSION=0.0.1-develop +CHART_VERSION=1.3.2 echo Create $NS namespace kubectl create ns $NS @@ -88,4 +88,4 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true set -o nounset ## set -u : exit the script if you try to use an uninitialised variable set -o errtrace # trace ERR through 'time command' and other functions set -o pipefail # trace ERR through pipes -installing_uitestrig # calling function \ No newline at end of file +installing_uitestrig # calling function diff --git a/deploy/uitestrig/values.yaml b/deploy/uitestrig/values.yaml index 014727441d..9724f500cc 100644 --- a/deploy/uitestrig/values.yaml +++ b/deploy/uitestrig/values.yaml @@ -10,8 +10,8 @@ modules: enabled: false image: registry: docker.io - repository: mosipqa/uitest-pmp - tag: develop + repository: mosipid/uitest-pmp + tag: 1.2.2.0 pullPolicy: Always - name: resident-ui enabled: false diff --git a/helm/apitestrig/Chart.yaml b/helm/apitestrig/Chart.yaml index ffa48e31d3..cc3a008d09 100644 --- a/helm/apitestrig/Chart.yaml +++ b/helm/apitestrig/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: apitestrig description: A Helm chart to deploy APITESTRIG for MOSIP modules type: application -version: 0.0.1-develop +version: 1.3.2 appVersion: "" dependencies: - name: common diff --git a/helm/apitestrig/values.yaml b/helm/apitestrig/values.yaml index 21dfef9a97..5cb528f5cd 100644 --- a/helm/apitestrig/values.yaml +++ b/helm/apitestrig/values.yaml @@ -443,62 +443,62 @@ modules: prereg: enabled: false image: - repository: mosipqa/apitest-prereg - tag: develop + repository: mosipid/apitest-prereg + tag: 1.3.0-beta.1 pullPolicy: Always masterdata: enabled: false image: - repository: mosipqa/apitest-masterdata - tag: develop + repository: mosipid/apitest-masterdata + tag: 1.3.0-beta.1 pullPolicy: Always idrepo: enabled: false image: repository: mosipqa/apitest-idrepo - tag: develop + tag: 1.3.0-beta.1 pullPolicy: Always partner: enabled: false image: - repository: mosipqa/apitest-pms - tag: develop + repository: mosipid/apitest-pms + tag: 1.2.2.0 pullPolicy: Always pms: enabled: false image: - repository: mosipdev/apitest-pms - tag: develop + repository: mosipid/apitest-pms + tag: 1.2.2.0 pullPolicy: Always resident: enabled: false image: - repository: mosipqa/apitest-resident - tag: develop + repository: mosipid/apitest-resident + tag: 1.3.0-beta.1 pullPolicy: Always auth: enabled: false image: - repository: mosipqa/apitest-auth - tag: develop + repository: mosipid/apitest-auth + tag: 1.3.0-beta.1 pullPolicy: Always esignet: enabled: false image: - repository: mosipqa/apitest-esignet - tag: develop + repository: mosipid/apitest-esignet + tag: 1.5.1 pullPolicy: Always mimoto: enabled: false image: - repository: mosipqa/apitest-mimoto - tag: develop + repository: mosipid/apitest-mimoto + tag: 0.15.2 pullPolicy: Always injicertify: enabled: false image: - repository: mosipqa/apitest-injicertify - tag: develop + repository: mosipid/apitest-inji-certify + tag: 0.10.2 pullPolicy: Always injiverify: enabled: false @@ -509,8 +509,8 @@ modules: esignet-signup: enabled: false image: - repository: mosipqa/apitest-esignet-signup - tag: develop + repository: mosipid/apitest-esignet-signup + tag: 1.1.1 pullPolicy: Always crontime: "0 3 * * *" ## run cronjob every day at 3 AM (time hr: 0-23 ) diff --git a/helm/uitestrig/Chart.yaml b/helm/uitestrig/Chart.yaml index 8763cc302a..62c0201856 100644 --- a/helm/uitestrig/Chart.yaml +++ b/helm/uitestrig/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: uitestrig description: A Helm chart to deploy uitestrig to test working of MOSIP modules type: application -version: 0.0.1-develop +version: 1.3.2 appVersion: "" dependencies: - name: common diff --git a/helm/uitestrig/values.yaml b/helm/uitestrig/values.yaml index 75e39c80a1..8f7e328195 100644 --- a/helm/uitestrig/values.yaml +++ b/helm/uitestrig/values.yaml @@ -449,8 +449,8 @@ modules: enabled: true image: registry: docker.io - repository: mosipqa/uitest-pmp - tag: develop + repository: mosipid/uitest-pmp + tag: 1.2.2.0 pullPolicy: Always - name: resident-ui enabled: true From 0a9a040a9a676f19907e1d99b9fb59d9815a8dac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Mar 2025 11:34:32 +0000 Subject: [PATCH 5/5] Bump org.hibernate:hibernate-core in /apitest-commons Bumps [org.hibernate:hibernate-core](https://github.com/hibernate/hibernate-orm) from 5.2.17.Final to 5.3.20.Final. - [Release notes](https://github.com/hibernate/hibernate-orm/releases) - [Changelog](https://github.com/hibernate/hibernate-orm/blob/5.3.20/changelog.txt) - [Commits](https://github.com/hibernate/hibernate-orm/compare/5.2.17...5.3.20) --- updated-dependencies: - dependency-name: org.hibernate:hibernate-core dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- apitest-commons/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apitest-commons/pom.xml b/apitest-commons/pom.xml index 3a02c1f806..800eaad45c 100644 --- a/apitest-commons/pom.xml +++ b/apitest-commons/pom.xml @@ -55,7 +55,7 @@ 1.11.368 - 5.2.17.Final + 5.3.20.Final 1.1.2-incubating