From ae39ebdee943fca95fec3f0b9996a8694dc8837d Mon Sep 17 00:00:00 2001 From: Mohan E Date: Mon, 7 Oct 2024 17:47:37 +0530 Subject: [PATCH 01/33] [MOSIP-35421] Moved installtion scripts of esignet apitestrig. Signed-off-by: Mohanraj209 --- deploy/esignet-apitestrig/README.md | 28 ++++++++++++++ deploy/esignet-apitestrig/install.sh | 52 +++++++++++++++++++++++++ deploy/esignet-apitestrig/values.yaml | 55 +++++++++++++++++++++++++++ 3 files changed, 135 insertions(+) create mode 100644 deploy/esignet-apitestrig/README.md create mode 100644 deploy/esignet-apitestrig/install.sh create mode 100644 deploy/esignet-apitestrig/values.yaml diff --git a/deploy/esignet-apitestrig/README.md b/deploy/esignet-apitestrig/README.md new file mode 100644 index 000000000..e93fc1e8f --- /dev/null +++ b/deploy/esignet-apitestrig/README.md @@ -0,0 +1,28 @@ +# ESIGNET APITESTRIG + +# INSTALL + +This `install.sh` script automates the process of cloning `mosip-functional-tests` repository from a user-defined specific branch from a Git repository, running an installation script to deploy esignet apitestrig within the cluster, and cleaning up the repository afterward. + +Note: This directory contains `values.yaml` file which contains the latest esignet apitestrig release changes with latest released Docker image and tag. The above install script uses this `values.yaml` by default to deploy apitestrig with latest changes. + +## Prerequisites + +- Ensure you have **git** installed on your machine. +- You need access to the Kubernetes cluster configuration file (`kubeconfig`). +- Ensure you have the necessary permissions to execute shell scripts. + +## Script Usage + +1. **Clone this script to your local machine**. +2. **Run the script using the following command**: + ```bash + ./script.sh + ``` + +## TL;DR + +```console +$ helm repo add mosip https://mosip.github.io +$ helm install my-release mosip/apitestrig -f values.yaml +``` diff --git a/deploy/esignet-apitestrig/install.sh b/deploy/esignet-apitestrig/install.sh new file mode 100644 index 000000000..6f6d77859 --- /dev/null +++ b/deploy/esignet-apitestrig/install.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# Prompt the user for the branch name +read -p "Enter the Git branch (default is 'develop'): " GIT_BRANCH +GIT_BRANCH=${GIT_BRANCH:-develop} # Default to 'develop' if no input is provided + +echo "set kubeconfig" +export KUBECONFIG=$1 + +# Set variables +REPO_URL="https://github.com/mosip/mosip-functional-tests.git" +INSTALL_SCRIPT="install.sh" +VALUES_FILE="../../../values.yaml" # Path to your custom values.yaml file + +# Clone the repository +echo "Cloning repository from $REPO_URL on branch $GIT_BRANCH..." +if git clone -b "$GIT_BRANCH" "$REPO_URL" ; then + echo "Repository cloned successfully." +else + echo "Failed to clone repository." + exit 1 +fi + +# Navigate to the deployment directory +echo "Navigating to deploy directory..." +git_repo_name="$(basename "$REPO_URL" .git)" + +cd $git_repo_name + +git sparse-checkout init --cone && git sparse-checkout set deploy/apitestrig + +find . -type f ! -path "./deploy/*" -exec rm -f {} \; + +cd deploy/apitestrig || { echo "apitestrig directory not found."; exit 1; } +cp $VALUES_FILE values.yaml + +# Check if the install script exists and is executable +if [ -x "$INSTALL_SCRIPT" ]; then + echo "Running install script with values file $VALUES_FILE..." + source ./"$INSTALL_SCRIPT" + echo "Install script executed successfully." +else + echo "Install script not found or not executable." + exit 1 +fi + +# Cleanup cloned repository +echo "Cleaning up..." +cd ../../.. +rm -rf $git_repo_name + +echo "Deployment complete!" diff --git a/deploy/esignet-apitestrig/values.yaml b/deploy/esignet-apitestrig/values.yaml new file mode 100644 index 000000000..2dbf68cd5 --- /dev/null +++ b/deploy/esignet-apitestrig/values.yaml @@ -0,0 +1,55 @@ +modules: + masterdata: + enabled: false + image: + repository: mosipqa/apitest-masterdata + tag: develop + pullPolicy: Always + prereg: + enabled: false + image: + repository: mosipqa/apitest-prereg + tag: develop + pullPolicy: Always + idrepo: + enabled: false + image: + repository: mosipqa/apitest-idrepo + tag: develop + pullPolicy: Always + partner: + enabled: false + image: + repository: mosipqa/apitest-partner + tag: develop + pullPolicy: Always + resident: + enabled: false + image: + repository: mosipqa/apitest-resident + tag: develop + pullPolicy: Always + auth: + enabled: false + image: + repository: mosipqa/apitest-auth + tag: develop + pullPolicy: Always + esignet: + enabled: true + image: + repository: mosipqa/apitest-esignet + tag: develop + pullPolicy: Always + mimoto: + enabled: false + image: + repository: mosipqa/apitest-mimoto + tag: develop + pullPolicy: Always + pms: + enabled: false + image: + repository: mosipqa/apitest-pms + tag: develop + pullPolicy: Always From 46e754223d6b793126c9108a1d795a7de29da986 Mon Sep 17 00:00:00 2001 From: Mohan E Date: Wed, 16 Oct 2024 09:48:38 +0530 Subject: [PATCH 02/33] [MOSIP-36541] Added a documentation to expose an additional port. Signed-off-by: Mohanraj209 --- docs/design/enable-new-port.md | 77 ++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 docs/design/enable-new-port.md diff --git a/docs/design/enable-new-port.md b/docs/design/enable-new-port.md new file mode 100644 index 000000000..f9f995803 --- /dev/null +++ b/docs/design/enable-new-port.md @@ -0,0 +1,77 @@ +# Expose an additional port, such as 5433 or any other, for a service in a specific namespace. + +### steps: + +1. Update the configuration as given below within the `stream` block of the nginx.conf file of nginx node. + ``` + upstream { + server :; + server :; + server :; + server :; + server :; + server :; + server :; + server :; + + } + + Note: The upstream block is usually followed by a server block where the traffic from clients is forwarded to the backend upstream group. + server{ + listen :; + proxy_pass ; + } + ``` + +2. Expose the port and nodePort from the AWS cloud and UFW firewall. + * < port >: needs to be exposed for the nginx node. + * < nodeport >: needs to be exposed for all the k8's cluster nodes. + +3. Update the IstioOperator (IOP) configuration as given below by editing the IOP in the istio-system namespace. + + ``` + $ kubectl -n istio-system edit istiooperator istio-operators-mosip + ``` + + ``` + k8s: + service: + ports: + - name: + nodePort: + port: + protocol: TCP + targetPort: + ``` + +4. Add the Istio Gateway and Virtual service by deploying the istio-addons and update the configuration as given below. + + * Gateway: + ``` + spec: + selector: + istio: ingressgateway-internal + servers: + - hosts: + - ## hostname will be checked only if "protocol" is set to HTTP, not for TCP protocol + port: + name: + number: + protocol: TCP + ``` + + * Virtual-service: + ``` + gateways: + - + hosts: + - '*' + tcp: + - match: + - port: ## ingress gateway container port + route: + - destination: + host: + port: + number: 5432 ## pod's service port + ``` \ No newline at end of file From 134e6800f9524f202545c5f0fc3805dfe0d7c251 Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Thu, 17 Oct 2024 10:39:03 +0530 Subject: [PATCH 03/33] ES-1425 Signed-off-by: Nandhukumar --- .../esignet/AddIdentityMock/AddIdentity.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/api-test/src/main/resources/esignet/AddIdentityMock/AddIdentity.yml b/api-test/src/main/resources/esignet/AddIdentityMock/AddIdentity.yml index 32b89e64d..65deba9db 100644 --- a/api-test/src/main/resources/esignet/AddIdentityMock/AddIdentity.yml +++ b/api-test/src/main/resources/esignet/AddIdentityMock/AddIdentity.yml @@ -415,4 +415,23 @@ AddIdentity: }' output: '{ "status":"mock identity data created successfully" +}' + + ESignet_AddIdentity_L2_Valid_Parameters_smoke_Pos: + endPoint: /v1/mock-identity-system/identity + description: Add identity with password authentication + role: idrepo + restMethod: post + inputTemplate: esignet/AddIdentityMock/AddIdentity + outputTemplate: esignet/AddIdentityMock/addIdentityResult + input: '{ + "requesttime": "$TIMESTAMP$", + "individualId": "$RANDOMINDIVIDUALIDFORMOCKIDENTITY$", + "pin": "545411", + "email": "$EMAILIDFORMOCKIDENTITY$", + "password": "$PASSWORDFORMOCKIDENTITY$", + "phone": "$PHONEFORMOCKIDENTITY$" +}' + output: '{ + "status":"mock identity data created successfully" }' \ No newline at end of file From 164756ad2a1825df31883e3c051f48456d61ae18 Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Thu, 17 Oct 2024 11:37:24 +0530 Subject: [PATCH 04/33] MOSIP-36485 Signed-off-by: Nandhukumar --- .../Consent/AuthenticateUserConsent/AuthenticateUserConsent.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-test/src/main/resources/esignet/Consent/AuthenticateUserConsent/AuthenticateUserConsent.yml b/api-test/src/main/resources/esignet/Consent/AuthenticateUserConsent/AuthenticateUserConsent.yml index 8cc7c1174..7db08ce5f 100644 --- a/api-test/src/main/resources/esignet/Consent/AuthenticateUserConsent/AuthenticateUserConsent.yml +++ b/api-test/src/main/resources/esignet/Consent/AuthenticateUserConsent/AuthenticateUserConsent.yml @@ -186,7 +186,7 @@ AuthenticateUserConsent: restMethod: post checkErrorsOnlyInResponse: true validityCheckRequired: true - allowedErrorCodes: IDA-MLC-009,invalid_individual_id, + allowedErrorCodes: IDA-MLC-009,invalid_individual_id, inputTemplate: esignet/Consent/AuthenticateUserConsent/AuthenticateUserConsent outputTemplate: esignet/error input: '{ From 133943e9e1274e65f0933959095642ea8b1e5aa0 Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Thu, 17 Oct 2024 11:59:30 +0530 Subject: [PATCH 05/33] MOSIP-36505 Signed-off-by: Nandhukumar --- .../apirig/testrunner/MosipTestRunner.java | 29 ++- .../testrig/apirig/utils/EsignetUtil.java | 7 + .../main/resources/config/esignet.properties | 5 +- .../esignetPrerequisiteSuite.xml | 195 ++++++++++++++++++ api-test/testNgXmlFiles/esignetSuite.xml | 189 +---------------- 5 files changed, 230 insertions(+), 195 deletions(-) create mode 100644 api-test/testNgXmlFiles/esignetPrerequisiteSuite.xml diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java b/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java index be5eee346..986c4242c 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java @@ -24,6 +24,7 @@ import io.mosip.testrig.apirig.dataprovider.BiometricDataProvider; import io.mosip.testrig.apirig.dbaccess.DBManager; +import io.mosip.testrig.apirig.report.EmailableReport; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthTestsUtil; import io.mosip.testrig.apirig.utils.CertificateGenerationUtil; @@ -51,6 +52,7 @@ public class MosipTestRunner { public static String jarUrl = MosipTestRunner.class.getProtectionDomain().getCodeSource().getLocation().getPath(); public static List languageList = new ArrayList<>(); + public static boolean skipAll = false; /** * C Main method to start mosip test execution @@ -157,7 +159,7 @@ public static void suiteSetup(String runType) { DBManager.executeDBQueries(EsignetConfigManager.getMASTERDbUrl(), EsignetConfigManager.getMasterDbUser(), EsignetConfigManager.getMasterDbPass(), EsignetConfigManager.getMasterDbSchema(), getGlobalResourcePath() + "/" + "config/masterDataDeleteQueriesForEsignet.txt"); - BaseTestCase.setReportName(GlobalConstants.ESIGNET); +// BaseTestCase.setReportName(GlobalConstants.ESIGNET); AdminTestUtil.initiateesignetTest(); BaseTestCase.otpListener = new OTPListener(); BaseTestCase.otpListener.run(); @@ -180,8 +182,6 @@ private static void setLogLevels() { */ public static void startTestRunner() { File homeDir = null; - TestNG runner = new TestNG(); - List suitefiles = new ArrayList<>(); String os = System.getProperty("os.name"); LOGGER.info(os); if (getRunType().contains("IDE") || os.toLowerCase().contains("windows")) { @@ -193,14 +193,29 @@ public static void startTestRunner() { LOGGER.info("ELSE :" + homeDir); } for (File file : homeDir.listFiles()) { + TestNG runner = new TestNG(); + List suitefiles = new ArrayList<>(); + if (file.getName().toLowerCase().contains(GlobalConstants.ESIGNET)) { + if (file.getName().toLowerCase().contains("prerequisite")) { + BaseTestCase.setReportName(GlobalConstants.ESIGNET + "-prerequisite"); + } else { + // if the prerequisite total skipped/failed count is greater than zero + + if (EmailableReport.getFailedCount() > 0 || EmailableReport.getSkippedCount() > 0) { + skipAll = true; + } + + BaseTestCase.setReportName(GlobalConstants.ESIGNET); + } suitefiles.add(file.getAbsolutePath()); + runner.setTestSuites(suitefiles); + System.getProperties().setProperty("testng.outpur.dir", "testng-report"); + runner.setOutputDirectory("testng-report"); + runner.run(); } } - runner.setTestSuites(suitefiles); - System.getProperties().setProperty("testng.outpur.dir", "testng-report"); - runner.setOutputDirectory("testng-report"); - runner.run(); + } public static String getGlobalResourcePath() { diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/utils/EsignetUtil.java b/api-test/src/main/java/io/mosip/testrig/apirig/utils/EsignetUtil.java index 9307d3809..13cc78917 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/utils/EsignetUtil.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/utils/EsignetUtil.java @@ -13,6 +13,7 @@ import io.mosip.testrig.apirig.dto.TestCaseDTO; import io.mosip.testrig.apirig.testrunner.BaseTestCase; +import io.mosip.testrig.apirig.testrunner.MosipTestRunner; import io.restassured.response.Response; public class EsignetUtil extends AdminTestUtil { @@ -78,11 +79,17 @@ public static String getValueFromEsignetActuator(String section, String key) { } } + public static final String PRE_REQUISITE_FAILED_MESSAGE = "pre requisite failed. Hence skipping the testcase"; public static String isTestCaseValidForExecution(TestCaseDTO testCaseDTO) { String testCaseName = testCaseDTO.getTestCaseName(); + if (MosipTestRunner.skipAll == true) { + throw new SkipException(PRE_REQUISITE_FAILED_MESSAGE); + } + + if (getIdentityPluginNameFromEsignetActuator().toLowerCase().contains("mockauthenticationservice")) { // TO DO - need to conform whether esignet distinguishes between UIN and VID. BAsed on that need to remove VID test case from YAML. diff --git a/api-test/src/main/resources/config/esignet.properties b/api-test/src/main/resources/config/esignet.properties index 2b4a48245..b327f31d4 100644 --- a/api-test/src/main/resources/config/esignet.properties +++ b/api-test/src/main/resources/config/esignet.properties @@ -5,7 +5,10 @@ validateBindingEndpoint=ida-binding esignetWellKnownEndPoint=/v1/esignet/oidc/.well-known/openid-configuration signupSettingsEndPoint=/v1/signup/settings esignetActuatorPropertySection=esignet-default.properties -servicesNotDeployed=resident,ridgenerator,admin,hotlist,preregistration,registrationprocessor,hub,print,packetcreator,packetmanager,mock-abis-service,mockmv,sunbirdrc +# uncomment below property while executing on camdgc env locally +#servicesNotDeployed=resident,ridgenerator,admin,hotlist,preregistration,registrationprocessor,hub,print,packetcreator,packetmanager,mock-abis-service,mockmv,sunbirdrc +# uncomment below property while executing on non camdgc env locally +servicesNotDeployed= esignetMockBaseURL=esignet-insurance. sunBirdBaseURL=https://registry.dev1.mosip.net #Once sunbird registry is pointing to specific env, remove the above line and uncomment below line diff --git a/api-test/testNgXmlFiles/esignetPrerequisiteSuite.xml b/api-test/testNgXmlFiles/esignetPrerequisiteSuite.xml new file mode 100644 index 000000000..7ca15540b --- /dev/null +++ b/api-test/testNgXmlFiles/esignetPrerequisiteSuite.xml @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/api-test/testNgXmlFiles/esignetSuite.xml b/api-test/testNgXmlFiles/esignetSuite.xml index 1a6cecd68..3adbb9e85 100644 --- a/api-test/testNgXmlFiles/esignetSuite.xml +++ b/api-test/testNgXmlFiles/esignetSuite.xml @@ -8,15 +8,6 @@ - - - - - - - - @@ -129,164 +120,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1083,7 +898,7 @@ - + @@ -1092,4 +907,4 @@ - + \ No newline at end of file From ec4464a158d117074b73b60dce93098bd78d726f Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Thu, 17 Oct 2024 12:21:12 +0530 Subject: [PATCH 06/33] MOSIP-36505 Signed-off-by: Nandhukumar --- .../main/java/io/mosip/testrig/apirig/utils/EsignetUtil.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/utils/EsignetUtil.java b/api-test/src/main/java/io/mosip/testrig/apirig/utils/EsignetUtil.java index 13cc78917..de6b2c186 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/utils/EsignetUtil.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/utils/EsignetUtil.java @@ -79,14 +79,13 @@ public static String getValueFromEsignetActuator(String section, String key) { } } - public static final String PRE_REQUISITE_FAILED_MESSAGE = "pre requisite failed. Hence skipping the testcase"; public static String isTestCaseValidForExecution(TestCaseDTO testCaseDTO) { String testCaseName = testCaseDTO.getTestCaseName(); if (MosipTestRunner.skipAll == true) { - throw new SkipException(PRE_REQUISITE_FAILED_MESSAGE); + throw new SkipException(GlobalConstants.PRE_REQUISITE_FAILED_MESSAGE); } From e0b505b513b66ef4547fe906ac6f2019f7075d0b Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Thu, 17 Oct 2024 12:49:46 +0530 Subject: [PATCH 07/33] MOSIP-36505 Signed-off-by: Nandhukumar --- .../io/mosip/testrig/apirig/testrunner/MosipTestRunner.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java b/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java index 986c4242c..2d25f461d 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java @@ -159,7 +159,6 @@ public static void suiteSetup(String runType) { DBManager.executeDBQueries(EsignetConfigManager.getMASTERDbUrl(), EsignetConfigManager.getMasterDbUser(), EsignetConfigManager.getMasterDbPass(), EsignetConfigManager.getMasterDbSchema(), getGlobalResourcePath() + "/" + "config/masterDataDeleteQueriesForEsignet.txt"); -// BaseTestCase.setReportName(GlobalConstants.ESIGNET); AdminTestUtil.initiateesignetTest(); BaseTestCase.otpListener = new OTPListener(); BaseTestCase.otpListener.run(); @@ -203,7 +202,7 @@ public static void startTestRunner() { // if the prerequisite total skipped/failed count is greater than zero if (EmailableReport.getFailedCount() > 0 || EmailableReport.getSkippedCount() > 0) { - skipAll = true; +// skipAll = true; } BaseTestCase.setReportName(GlobalConstants.ESIGNET); From 85df584d076cec38e878ef280281c09d7d54c91d Mon Sep 17 00:00:00 2001 From: Rakshithb1 Date: Fri, 18 Oct 2024 19:12:30 +0530 Subject: [PATCH 08/33] [MOSIP-35892] Updated helm charts to add range Signed-off-by: Rakshithb1 --- helm/oidc-ui/templates/deployment.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helm/oidc-ui/templates/deployment.yaml b/helm/oidc-ui/templates/deployment.yaml index 126eab535..b4e32c9d1 100644 --- a/helm/oidc-ui/templates/deployment.yaml +++ b/helm/oidc-ui/templates/deployment.yaml @@ -116,8 +116,10 @@ spec: {{- end }} {{- end }} {{- if .Values.extraEnvVarsSecret }} + {{- range .Values.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + name: {{ . }} + {{- end }} {{- end }} volumeMounts: - name: nginx-config From b7174cfe9d12391952032c59b50563fb3b099710 Mon Sep 17 00:00:00 2001 From: Gk <76690271+gk-4VII@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:15:44 +0530 Subject: [PATCH 09/33] [ES-1553] Hidden the language dropdown in the navbar in claim-details screen. (#969) Signed-off-by: GurukiranP --- oidc-ui/src/components/NavHeader.js | 252 ++++++++++++++-------------- 1 file changed, 127 insertions(+), 125 deletions(-) diff --git a/oidc-ui/src/components/NavHeader.js b/oidc-ui/src/components/NavHeader.js index d3208752a..10fc41184 100644 --- a/oidc-ui/src/components/NavHeader.js +++ b/oidc-ui/src/components/NavHeader.js @@ -129,134 +129,136 @@ export default function NavHeader({ langOptions, i18nKeyPrefix = "header" }) {
brand_logo
-
-
- - +
+ - - - - - -
- {config["outline_dropdown"] ? ( - + ) : ( + + + + {selectedLang?.label} + chevron down + + + + + {langOptions.map((key, idx) => ( + changeLanguageHandler(key)} + > + {key.label} +
+ {i18n.language === key.value && ( + + + + )} +
+
+ ))} + + + + + + +
+
+
+ )} +
+ )}
); From 111efe036347217408fb6c84a008f44b4e6ae2d5 Mon Sep 17 00:00:00 2001 From: Gk <76690271+gk-4VII@users.noreply.github.com> Date: Tue, 22 Oct 2024 16:22:20 +0530 Subject: [PATCH 10/33] [ES-1553] Hidden the language dropdown in the navbar in claim-details screen. (#970) Signed-off-by: GurukiranP --- oidc-ui/src/components/ClaimDetails.js | 3 + oidc-ui/src/components/NavHeader.js | 252 ++++++++++++------------- 2 files changed, 128 insertions(+), 127 deletions(-) diff --git a/oidc-ui/src/components/ClaimDetails.js b/oidc-ui/src/components/ClaimDetails.js index e83d81caa..86f114a8e 100644 --- a/oidc-ui/src/components/ClaimDetails.js +++ b/oidc-ui/src/components/ClaimDetails.js @@ -155,6 +155,9 @@ const ClaimDetails = ({ useEffect(() => { getAllClaimDetails(); + if (document.getElementById("language_dropdown") !== null) { + document.getElementById("language_dropdown").style.display = "none"; + } }, []); const handleProceed = async () => { diff --git a/oidc-ui/src/components/NavHeader.js b/oidc-ui/src/components/NavHeader.js index 10fc41184..38d92ab27 100644 --- a/oidc-ui/src/components/NavHeader.js +++ b/oidc-ui/src/components/NavHeader.js @@ -129,136 +129,134 @@ export default function NavHeader({ langOptions, i18nKeyPrefix = "header" }) {
brand_logo
- {window.location.pathname !== "/claim-details" && ( -
-
- +
+ + - + + + + +
+ {config["outline_dropdown"] ? ( + - ) : ( - - - - {selectedLang?.label} - chevron down - - - - - {langOptions.map((key, idx) => ( - changeLanguageHandler(key)} - > - {key.label} -
- {i18n.language === key.value && ( - - - - )} -
-
- ))} - - - - - - -
-
-
- )} -
- )} + + + + + {langOptions.map((key, idx) => ( + changeLanguageHandler(key)} + > + {key.label} +
+ {i18n.language === key.value && ( + + + + )} +
+
+ ))} + + + + + + +
+
+ + )} +
); From d61f4ca0c922cca040f8bd5d346db103a05723ef Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Tue, 22 Oct 2024 17:45:28 +0530 Subject: [PATCH 11/33] MOSIP-36505 Signed-off-by: Nandhukumar --- .../apirig/testrunner/MosipTestRunner.java | 56 ++++++++++++------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java b/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java index 2d25f461d..66e2f8f10 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java @@ -10,6 +10,7 @@ import java.security.PublicKey; import java.security.interfaces.RSAPublicKey; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Properties; @@ -191,30 +192,45 @@ public static void startTestRunner() { homeDir = new File(dir.getParent() + "/mosip/testNgXmlFiles"); LOGGER.info("ELSE :" + homeDir); } - for (File file : homeDir.listFiles()) { - TestNG runner = new TestNG(); - List suitefiles = new ArrayList<>(); - - if (file.getName().toLowerCase().contains(GlobalConstants.ESIGNET)) { - if (file.getName().toLowerCase().contains("prerequisite")) { - BaseTestCase.setReportName(GlobalConstants.ESIGNET + "-prerequisite"); - } else { - // if the prerequisite total skipped/failed count is greater than zero - - if (EmailableReport.getFailedCount() > 0 || EmailableReport.getSkippedCount() > 0) { -// skipAll = true; + // List and sort the files + File[] files = homeDir.listFiles(); + if (files != null) { + Arrays.sort(files, (f1, f2) -> { + // Customize the comparison based on file names + if (f1.getName().toLowerCase().contains("prerequisite")) { + return -1; // f1 should come before f2 + } else if (f2.getName().toLowerCase().contains("prerequisite")) { + return 1; // f2 comes before f1 + } + return f1.getName().compareTo(f2.getName()); // default alphabetical order + }); + + for (File file : files) { + TestNG runner = new TestNG(); + List suitefiles = new ArrayList<>(); + + if (file.getName().toLowerCase().contains(GlobalConstants.ESIGNET)) { + if (file.getName().toLowerCase().contains("prerequisite")) { + BaseTestCase.setReportName(GlobalConstants.ESIGNET + "-prerequisite"); + } else { + // if the prerequisite total skipped/failed count is greater than zero + if (EmailableReport.getFailedCount() > 0 || EmailableReport.getSkippedCount() > 0) { + // skipAll = true; + } + + BaseTestCase.setReportName(GlobalConstants.ESIGNET); } - - BaseTestCase.setReportName(GlobalConstants.ESIGNET); + suitefiles.add(file.getAbsolutePath()); + runner.setTestSuites(suitefiles); + System.getProperties().setProperty("testng.outpur.dir", "testng-report"); + runner.setOutputDirectory("testng-report"); + runner.run(); } - suitefiles.add(file.getAbsolutePath()); - runner.setTestSuites(suitefiles); - System.getProperties().setProperty("testng.outpur.dir", "testng-report"); - runner.setOutputDirectory("testng-report"); - runner.run(); } + } else { + LOGGER.error("No files found in directory: " + homeDir); } - + } public static String getGlobalResourcePath() { From cac5d70722dd0bb49e831d6cd51eba1a9e0e74b1 Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Wed, 23 Oct 2024 14:03:14 +0530 Subject: [PATCH 12/33] ES-1872 Signed-off-by: Nandhukumar --- .../apirig/testscripts/AddIdentity.java | 4 +++ .../testscripts/SimplePostForAutoGenId.java | 5 ++++ .../AuthenticateUserPasswordNegTC.yml | 2 +- .../RegisterUserNegTC/RegisterUserNegTC.yml | 6 ++-- .../ResetPasswordNegTC/ResetPasswordNegTC.yml | 2 +- .../VerifyChallengeForResetPasswordNegTC.yml | 4 +-- .../VerifyChallengeNegTC.yml | 30 +++++++++++++++++++ 7 files changed, 46 insertions(+), 7 deletions(-) diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/AddIdentity.java b/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/AddIdentity.java index 4127caaa5..7874d1b8f 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/AddIdentity.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/AddIdentity.java @@ -135,6 +135,10 @@ public void test(TestCaseDTO testCaseDTO) throws Exception { writeAutoGeneratedId("Esignet_PartnerSelfRegistration_All_Valid_Smoke_sid", "partnerId", generateRandomNumberString(20)); + + writeAutoGeneratedId("Esignet_PartnerSelfRegistration_Kyc_Valid_Smoke_sid", "partnerId", + generateRandomNumberString(20)); + isvalueReplaced = true; } } else { diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenId.java b/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenId.java index 7439b679a..12303eef1 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenId.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenId.java @@ -104,7 +104,12 @@ public void test(TestCaseDTO testCaseDTO) String[] templateFields = testCaseDTO.getTemplateFields(); String inputJson = ""; + if (BaseTestCase.currentModule.equals(GlobalConstants.MASTERDATA) + && testCaseName.startsWith("Esignet_CreateOIDCClient")) { + inputJson = testCaseDTO.getInput(); + } else { inputJson = getJsonFromTemplate(testCaseDTO.getInput(), testCaseDTO.getInputTemplate()); + } String outputJson = getJsonFromTemplate(testCaseDTO.getOutput(), testCaseDTO.getOutputTemplate()); diff --git a/api-test/src/main/resources/esignet/AuthenticateUserPasswordNegTC/AuthenticateUserPasswordNegTC.yml b/api-test/src/main/resources/esignet/AuthenticateUserPasswordNegTC/AuthenticateUserPasswordNegTC.yml index a25730326..270831a0f 100644 --- a/api-test/src/main/resources/esignet/AuthenticateUserPasswordNegTC/AuthenticateUserPasswordNegTC.yml +++ b/api-test/src/main/resources/esignet/AuthenticateUserPasswordNegTC/AuthenticateUserPasswordNegTC.yml @@ -1146,7 +1146,7 @@ AuthenticateUserPasswordNegTC: "encodedHash": "$ID:OAuthDetailsRequest_Password_NegTC_Scen1_Valid_Smoke_sid_encodedResp$", "requestTime": "$TIMESTAMP$", "transactionId": "$ID:OAuthDetailsRequest_Password_NegTC_Scen1_Valid_Smoke_sid_transactionId$", - "individualId": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_PHONE$", + "individualId": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_PHONE$", "authFactorType" : "PWD", "challenge" : "$RESETPASSWORDFORAUTHENTICATION$", "format": "alpha-numeric" diff --git a/api-test/src/main/resources/esignet/RegisterUserNegTC/RegisterUserNegTC.yml b/api-test/src/main/resources/esignet/RegisterUserNegTC/RegisterUserNegTC.yml index caca27aa2..bf9718ab9 100644 --- a/api-test/src/main/resources/esignet/RegisterUserNegTC/RegisterUserNegTC.yml +++ b/api-test/src/main/resources/esignet/RegisterUserNegTC/RegisterUserNegTC.yml @@ -1589,13 +1589,13 @@ RegisterUserNegTC: inputTemplate: esignet/RegisterUser/RegisterUser outputTemplate: esignet/RegisterUser/RegisterUserResult input: '{ - "verifiedTransactionID": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_VTransactionID$", - "username": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_PHONE$", + "verifiedTransactionID": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_VTransactionID$", + "username": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_PHONE$", "password": "$PASSWORDFORAUTHENTICATION$", "consent": "AGREE", "fullName": "$FULLNAMETOREGISTERUSER$", "requestTime": "$TIMESTAMP$", - "phone": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_PHONE$", + "phone": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_PHONE$", "preferredLang": "khm" }' output: '{ diff --git a/api-test/src/main/resources/esignet/ResetPasswordNegTC/ResetPasswordNegTC.yml b/api-test/src/main/resources/esignet/ResetPasswordNegTC/ResetPasswordNegTC.yml index dafbc318d..9961a20b7 100644 --- a/api-test/src/main/resources/esignet/ResetPasswordNegTC/ResetPasswordNegTC.yml +++ b/api-test/src/main/resources/esignet/ResetPasswordNegTC/ResetPasswordNegTC.yml @@ -585,7 +585,7 @@ ResetPasswordNegTC: outputTemplate: esignet/ResetPasswordNegTC/ResetPasswordNegTCResult input: '{ "verifiedTransactionID": "$ID:VerifyChallengeForResetPasswordNegTC_STransId_smoke_Pos_VTransactionID$", - "identifier": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_PHONE$", + "identifier": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_PHONE$", "password": "$PASSWORDTORESET$", "requestTime": "$TIMESTAMP$" }' diff --git a/api-test/src/main/resources/esignet/VerifyChallengeForResetPasswordNegTC/VerifyChallengeForResetPasswordNegTC.yml b/api-test/src/main/resources/esignet/VerifyChallengeForResetPasswordNegTC/VerifyChallengeForResetPasswordNegTC.yml index 933da27fd..0d91b6a10 100644 --- a/api-test/src/main/resources/esignet/VerifyChallengeForResetPasswordNegTC/VerifyChallengeForResetPasswordNegTC.yml +++ b/api-test/src/main/resources/esignet/VerifyChallengeForResetPasswordNegTC/VerifyChallengeForResetPasswordNegTC.yml @@ -599,7 +599,7 @@ VerifyChallengeForResetPasswordNegTC: outputTemplate: esignet/VerifyChallengeForResetPasswordNegTC/VerifyChallengeForResetPasswordNegTCResult input: '{ "headerTransactionID": "$ID:VerifyChallengeForResetPasswordNegTC_STransId_smoke_Pos_TransactionID$", - "identifier": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_PHONE$", + "identifier": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_PHONE$", "challenge": "111111", "format": "alpha-numeric", "type": "OTP", @@ -608,7 +608,7 @@ VerifyChallengeForResetPasswordNegTC: "type2": "KBI", "requestTime": "$TIMESTAMP$", "sendOtp":{ - "identifier": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_PHONE$", + "identifier": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_PHONE$", "captchaToken": "", "purpose": "RESET_PASSWORD", "requestTime": "$TIMESTAMP$", diff --git a/api-test/src/main/resources/esignet/VerifyChallengeNegTC/VerifyChallengeNegTC.yml b/api-test/src/main/resources/esignet/VerifyChallengeNegTC/VerifyChallengeNegTC.yml index 81cffef49..4b6ebcc26 100644 --- a/api-test/src/main/resources/esignet/VerifyChallengeNegTC/VerifyChallengeNegTC.yml +++ b/api-test/src/main/resources/esignet/VerifyChallengeNegTC/VerifyChallengeNegTC.yml @@ -1528,4 +1528,34 @@ VerifyChallengeNegTC: "status":"SUCCESS", "sendOtpResTemplate":"esignet/GenerateChallenge/GenerateChallengeResult" } +}' + + ESignet_VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication: + endPoint: /v1/signup/registration/verify-challenge + role: resident + restMethod: post + inputTemplate: esignet/VerifyChallengeNegTC/VerifyChallengeNegTC + outputTemplate: esignet/VerifyChallengeNegTC/VerifyChallengeNegTCResult + input: '{ + "headerTransactionID": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_TransactionID$", + "identifier": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_PHONE$", + "challenge": "111111", + "format": "alpha-numeric", + "type": "OTP", + "requestTime": "$TIMESTAMP$", + "sendOtp":{ + "identifier": "$PHONENUMBERFROMREGEXFORSIGNUP$", + "captchaToken": "", + "purpose": "REGISTRATION", + "requestTime": "$TIMESTAMP$", + "sendOtpReqTemplate": "esignet/GenerateChallenge/GenerateChallenge", + "sendOtpEndPoint": "/v1/signup/registration/generate-challenge" + } +}' + output: '{ + "status":"SUCCESS", + "sendOtpResp":{ + "status":"SUCCESS", + "sendOtpResTemplate":"esignet/GenerateChallenge/GenerateChallengeResult" + } }' \ No newline at end of file From 314ec32190da8a439de8c6d6e55c59726a2d7903 Mon Sep 17 00:00:00 2001 From: Mohan E Date: Wed, 23 Oct 2024 14:38:29 +0530 Subject: [PATCH 13/33] [MOSIP-35421] Moved installtion scripts of esignet apitestrig. Signed-off-by: Mohanraj209 --- deploy/esignet-apitestrig/README.md | 66 +++++++---- deploy/esignet-apitestrig/delete.sh | 30 +++++ deploy/esignet-apitestrig/install.sh | 160 +++++++++++++++++++------- deploy/esignet-apitestrig/values.yaml | 48 -------- 4 files changed, 190 insertions(+), 114 deletions(-) create mode 100755 deploy/esignet-apitestrig/delete.sh mode change 100644 => 100755 deploy/esignet-apitestrig/install.sh diff --git a/deploy/esignet-apitestrig/README.md b/deploy/esignet-apitestrig/README.md index e93fc1e8f..a5e277981 100644 --- a/deploy/esignet-apitestrig/README.md +++ b/deploy/esignet-apitestrig/README.md @@ -1,28 +1,44 @@ -# ESIGNET APITESTRIG +# APITESTRIG -# INSTALL +## Introduction +ApiTestRig will test the working of APIs of the MOSIP modules. -This `install.sh` script automates the process of cloning `mosip-functional-tests` repository from a user-defined specific branch from a Git repository, running an installation script to deploy esignet apitestrig within the cluster, and cleaning up the repository afterward. - -Note: This directory contains `values.yaml` file which contains the latest esignet apitestrig release changes with latest released Docker image and tag. The above install script uses this `values.yaml` by default to deploy apitestrig with latest changes. - -## Prerequisites - -- Ensure you have **git** installed on your machine. -- You need access to the Kubernetes cluster configuration file (`kubeconfig`). -- Ensure you have the necessary permissions to execute shell scripts. - -## Script Usage - -1. **Clone this script to your local machine**. -2. **Run the script using the following command**: - ```bash - ./script.sh - ``` - -## TL;DR - -```console -$ helm repo add mosip https://mosip.github.io -$ helm install my-release mosip/apitestrig -f values.yaml +## Install +* Review `values.yaml` and, Make sure to enable required modules for apitestrig operation. +* Install +```sh +./install.sh ``` +* During the execution of the `install.sh` script, a prompt appears requesting information regarding the presence of a public domain and a valid SSL certificate on the server. +* If the server lacks a public domain and a valid SSL certificate, it is advisable to select the `n` option. Opting it will enable the `init-container` with an `emptyDir` volume and include it in the deployment process. +* The init-container will proceed to download the server's self-signed SSL certificate and mount it to the specified location within the container's Java keystore (i.e., `cacerts`) file. +* This particular functionality caters to scenarios where the script needs to be employed on a server utilizing self-signed SSL certificates. + +## Uninstall +* To uninstall ApiTestRig, run `delete.sh` script. +```sh +./delete.sh +``` + +## Run apitestrig manually + +#### Rancher UI +* Run apitestrig manually via Rancher UI. + ![apitestrig-2.png](../../docs/apitestrig-2.png) +* There are two modes of apitestrig `smoke` & `smokeAndRegression`. +* By default, apitestrig will execute with `smokeAndRegression`.
+ If you want to run apitestrig with only `smoke`.
+ You have to update the `apitestrig` configmap and rerun the specific apitestrig job. + +#### CLI +* Download Kubernetes cluster `kubeconfig` file from `rancher dashboard` to your local. + ![apitestrig-1.png](../../docs/apitestrig-1.png) +* Install `kubectl` package to your local machine. +* Run apitestrig manually via CLI by creating a new job from an existing k8s cronjob. + ``` + kubectl --kubeconfig= -n apitestrig create job --from=cronjob/ + ``` + example: + ``` + kubectl --kubeconfig=/home/xxx/Downloads/qa4.config -n apitestrig create job --from=cronjob/cronjob-apitestrig-masterdata cronjob-apitestrig-masterdata + ``` \ No newline at end of file diff --git a/deploy/esignet-apitestrig/delete.sh b/deploy/esignet-apitestrig/delete.sh new file mode 100755 index 000000000..38c79022c --- /dev/null +++ b/deploy/esignet-apitestrig/delete.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Uninstalls apitestrig +## Usage: ./delete.sh [kubeconfig] + +if [ $# -ge 1 ] ; then + export KUBECONFIG=$1 +fi + +function deleting_apitestrig() { + NS=esignet + while true; do + read -p "Are you sure you want to delete apitestrig helm charts?(Y/n) " yn + if [ $yn = "Y" ] + then + helm -n $NS delete esignet-apitestrig + break + else + break + fi + done + return 0 +} + +# set commands for error handling. +set -e +set -o errexit ## set -e : exit the script if any statement returns a non-true return value +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 +deleting_apitestrig # calling function \ No newline at end of file diff --git a/deploy/esignet-apitestrig/install.sh b/deploy/esignet-apitestrig/install.sh old mode 100644 new mode 100755 index 6f6d77859..7fed643b6 --- a/deploy/esignet-apitestrig/install.sh +++ b/deploy/esignet-apitestrig/install.sh @@ -1,52 +1,130 @@ #!/bin/bash +# Installs apitestrig +## Usage: ./install.sh [kubeconfig] -# Prompt the user for the branch name -read -p "Enter the Git branch (default is 'develop'): " GIT_BRANCH -GIT_BRANCH=${GIT_BRANCH:-develop} # Default to 'develop' if no input is provided - -echo "set kubeconfig" -export KUBECONFIG=$1 - -# Set variables -REPO_URL="https://github.com/mosip/mosip-functional-tests.git" -INSTALL_SCRIPT="install.sh" -VALUES_FILE="../../../values.yaml" # Path to your custom values.yaml file - -# Clone the repository -echo "Cloning repository from $REPO_URL on branch $GIT_BRANCH..." -if git clone -b "$GIT_BRANCH" "$REPO_URL" ; then - echo "Repository cloned successfully." -else - echo "Failed to clone repository." - exit 1 +if [ $# -ge 1 ] ; then + export KUBECONFIG=$1 fi -# Navigate to the deployment directory -echo "Navigating to deploy directory..." -git_repo_name="$(basename "$REPO_URL" .git)" +NS=esignet +CHART_VERSION=0.0.1-develop +COPY_UTIL=../copy_cm_func.sh -cd $git_repo_name +echo Create $NS namespace +kubectl create ns $NS -git sparse-checkout init --cone && git sparse-checkout set deploy/apitestrig +function installing_apitestrig() { + echo Istio label + kubectl label ns $NS istio-injection=disabled --overwrite + helm repo update -find . -type f ! -path "./deploy/*" -exec rm -f {} \; + echo Copy Configmaps + $COPY_UTIL configmap global default $NS + $COPY_UTIL configmap keycloak-host keycloak $NS + $COPY_UTIL configmap artifactory-share artifactory $NS + $COPY_UTIL configmap config-server-share config-server $NS -cd deploy/apitestrig || { echo "apitestrig directory not found."; exit 1; } -cp $VALUES_FILE values.yaml + echo echo Copy Secrtes + $COPY_UTIL secret keycloak-client-secrets keycloak $NS + $COPY_UTIL secret s3 s3 $NS + $COPY_UTIL secret postgres-postgresql postgres $NS -# Check if the install script exists and is executable -if [ -x "$INSTALL_SCRIPT" ]; then - echo "Running install script with values file $VALUES_FILE..." - source ./"$INSTALL_SCRIPT" - echo "Install script executed successfully." -else - echo "Install script not found or not executable." - exit 1 -fi + echo "Delete s3, db, & apitestrig configmap if exists" + kubectl -n $NS delete --ignore-not-found=true configmap s3 + kubectl -n $NS delete --ignore-not-found=true configmap db + kubectl -n $NS delete --ignore-not-found=true configmap apitestrig + + DB_HOST=$( kubectl -n default get cm global -o json |jq -r '.data."mosip-api-internal-host"' ) + API_INTERNAL_HOST=$( kubectl -n default get cm global -o json |jq -r '.data."mosip-api-internal-host"' ) + ENV_USER=$( kubectl -n default get cm global -o json |jq -r '.data."mosip-api-internal-host"' | awk -F '.' '/api-internal/{print $1"."$2}') + + read -p "Please enter the time(hr) to run the cronjob every day (time: 0-23) : " time + if [ -z "$time" ]; then + echo "ERROT: Time cannot be empty; EXITING;"; + exit 1; + fi + if ! [ $time -eq $time ] 2>/dev/null; then + echo "ERROR: Time $time is not a number; EXITING;"; + exit 1; + fi + if [ $time -gt 23 ] || [ $time -lt 0 ] ; then + echo "ERROR: Time should be in range ( 0-23 ); EXITING;"; + exit 1; + fi + + echo "Do you have public domain & valid SSL? (Y/n) " + echo "Y: if you have public domain & valid ssl certificate" + echo "n: If you don't have a public domain and a valid SSL certificate. Note: It is recommended to use this option only in development environments." + read -p "" flag + + if [ -z "$flag" ]; then + echo "'flag' was provided; EXITING;" + exit 1; + fi + ENABLE_INSECURE='' + if [ "$flag" = "n" ]; then + ENABLE_INSECURE='--set enable_insecure=true'; + fi + + read -p "Please provide the retention days to remove old reports ( Default: 3 )" reportExpirationInDays + + if [[ -z $reportExpirationInDays ]]; then + reportExpirationInDays=3 + fi + if ! [[ $reportExpirationInDays =~ ^[0-9]+$ ]]; then + echo "The variable \"reportExpirationInDays\" should contain only number; EXITING"; + exit 1; + fi + + read -p "Please provide slack webhook URL to notify server end issues on your slack channel : " slackWebhookUrl + + if [ -z $slackWebhookUrl ]; then + echo "slack webhook URL not provided; EXITING;" + exit 1; + fi + + valid_inputs=("yes" "no") + eSignetDeployed="" + + while [[ ! " ${valid_inputs[@]} " =~ " ${eSignetDeployed} " ]]; do + read -p "Is the eSignet service deployed? (yes/no): " eSignetDeployed + eSignetDeployed=${eSignetDeployed,,} # Convert input to lowercase + done + + if [[ $eSignetDeployed == "yes" ]]; then + echo "eSignet service is deployed. Proceeding with installation..." + else + echo "eSignet service is not deployed. hence will be skipping esignet related test-cases..." + fi + + echo Installing esignet apitestrig + helm -n $NS install esignet-apitestrig mosip/apitestrig \ + --set crontime="0 $time * * *" \ + -f values.yaml \ + --version $CHART_VERSION \ + --set apitestrig.configmaps.s3.s3-host='http://minio.minio:9000' \ + --set apitestrig.configmaps.s3.s3-user-key='admin' \ + --set apitestrig.configmaps.s3.s3-region='' \ + --set apitestrig.configmaps.db.db-server="$DB_HOST" \ + --set apitestrig.configmaps.db.db-su-user="postgres" \ + --set apitestrig.configmaps.db.db-port="5432" \ + --set apitestrig.configmaps.apitestrig.ENV_USER="$ENV_USER" \ + --set apitestrig.configmaps.apitestrig.ENV_ENDPOINT="https://$API_INTERNAL_HOST" \ + --set apitestrig.configmaps.apitestrig.ENV_TESTLEVEL="smokeAndRegression" \ + --set apitestrig.configmaps.apitestrig.reportExpirationInDays="$reportExpirationInDays" \ + --set apitestrig.configmaps.apitestrig.slack-webhook-url="$slackWebhookUrl" \ + --set apitestrig.configmaps.apitestrig.eSignetDeployed="$eSignetDeployed" \ + --set apitestrig.configmaps.apitestrig.NS="$NS" \ + $ENABLE_INSECURE -# Cleanup cloned repository -echo "Cleaning up..." -cd ../../.. -rm -rf $git_repo_name + echo Installed esignet apitestrig. + return 0 +} -echo "Deployment complete!" +# set commands for error handling. +set -e +set -o errexit ## set -e : exit the script if any statement returns a non-true return value +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_apitestrig # calling function \ No newline at end of file diff --git a/deploy/esignet-apitestrig/values.yaml b/deploy/esignet-apitestrig/values.yaml index 2dbf68cd5..0d4623d75 100644 --- a/deploy/esignet-apitestrig/values.yaml +++ b/deploy/esignet-apitestrig/values.yaml @@ -1,55 +1,7 @@ modules: - masterdata: - enabled: false - image: - repository: mosipqa/apitest-masterdata - tag: develop - pullPolicy: Always - prereg: - enabled: false - image: - repository: mosipqa/apitest-prereg - tag: develop - pullPolicy: Always - idrepo: - enabled: false - image: - repository: mosipqa/apitest-idrepo - tag: develop - pullPolicy: Always - partner: - enabled: false - image: - repository: mosipqa/apitest-partner - tag: develop - pullPolicy: Always - resident: - enabled: false - image: - repository: mosipqa/apitest-resident - tag: develop - pullPolicy: Always - auth: - enabled: false - image: - repository: mosipqa/apitest-auth - tag: develop - pullPolicy: Always esignet: enabled: true image: repository: mosipqa/apitest-esignet tag: develop pullPolicy: Always - mimoto: - enabled: false - image: - repository: mosipqa/apitest-mimoto - tag: develop - pullPolicy: Always - pms: - enabled: false - image: - repository: mosipqa/apitest-pms - tag: develop - pullPolicy: Always From 17b3ccbe855e923897124d73632b46b29b851618 Mon Sep 17 00:00:00 2001 From: Nandhukumar <100744358+nandhu-kumar@users.noreply.github.com> Date: Wed, 23 Oct 2024 16:15:01 +0530 Subject: [PATCH 14/33] MOSIP-36505 | Split the Testng report into pre-requisite and functional test rig- core (#971) * ES-1425 Signed-off-by: Nandhukumar * MOSIP-36485 Signed-off-by: Nandhukumar * MOSIP-36505 Signed-off-by: Nandhukumar * MOSIP-36505 Signed-off-by: Nandhukumar * MOSIP-36505 Signed-off-by: Nandhukumar * MOSIP-36505 Signed-off-by: Nandhukumar * ES-1872 Signed-off-by: Nandhukumar --------- Signed-off-by: Nandhukumar --- .../apirig/testrunner/MosipTestRunner.java | 55 ++++++++++++------- .../apirig/testscripts/AddIdentity.java | 4 ++ .../testscripts/SimplePostForAutoGenId.java | 5 ++ .../AuthenticateUserPasswordNegTC.yml | 2 +- .../RegisterUserNegTC/RegisterUserNegTC.yml | 6 +- .../ResetPasswordNegTC/ResetPasswordNegTC.yml | 2 +- .../VerifyChallengeForResetPasswordNegTC.yml | 4 +- .../VerifyChallengeNegTC.yml | 30 ++++++++++ 8 files changed, 81 insertions(+), 27 deletions(-) diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java b/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java index 2d25f461d..2a767053e 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java @@ -10,6 +10,7 @@ import java.security.PublicKey; import java.security.interfaces.RSAPublicKey; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Properties; @@ -191,30 +192,44 @@ public static void startTestRunner() { homeDir = new File(dir.getParent() + "/mosip/testNgXmlFiles"); LOGGER.info("ELSE :" + homeDir); } - for (File file : homeDir.listFiles()) { - TestNG runner = new TestNG(); - List suitefiles = new ArrayList<>(); - - if (file.getName().toLowerCase().contains(GlobalConstants.ESIGNET)) { - if (file.getName().toLowerCase().contains("prerequisite")) { - BaseTestCase.setReportName(GlobalConstants.ESIGNET + "-prerequisite"); - } else { - // if the prerequisite total skipped/failed count is greater than zero - - if (EmailableReport.getFailedCount() > 0 || EmailableReport.getSkippedCount() > 0) { -// skipAll = true; + // List and sort the files + File[] files = homeDir.listFiles(); + if (files != null) { + Arrays.sort(files, (f1, f2) -> { + // Customize the comparison based on file names + if (f1.getName().toLowerCase().contains("prerequisite")) { + return -1; // f1 should come before f2 + } else if (f2.getName().toLowerCase().contains("prerequisite")) { + return 1; // f2 comes before f1 + } + return f1.getName().compareTo(f2.getName()); // default alphabetical order + }); + + for (File file : files) { + TestNG runner = new TestNG(); + List suitefiles = new ArrayList<>(); + + if (file.getName().toLowerCase().contains(GlobalConstants.ESIGNET)) { + if (file.getName().toLowerCase().contains("prerequisite")) { + BaseTestCase.setReportName(GlobalConstants.ESIGNET + "-prerequisite"); + } else { + // if the prerequisite total skipped/failed count is greater than zero + if (EmailableReport.getFailedCount() > 0 || EmailableReport.getSkippedCount() > 0) { + // skipAll = true; + } + + BaseTestCase.setReportName(GlobalConstants.ESIGNET); } - - BaseTestCase.setReportName(GlobalConstants.ESIGNET); + suitefiles.add(file.getAbsolutePath()); + runner.setTestSuites(suitefiles); + System.getProperties().setProperty("testng.outpur.dir", "testng-report"); + runner.setOutputDirectory("testng-report"); + runner.run(); } - suitefiles.add(file.getAbsolutePath()); - runner.setTestSuites(suitefiles); - System.getProperties().setProperty("testng.outpur.dir", "testng-report"); - runner.setOutputDirectory("testng-report"); - runner.run(); } + } else { + LOGGER.error("No files found in directory: " + homeDir); } - } public static String getGlobalResourcePath() { diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/AddIdentity.java b/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/AddIdentity.java index 4127caaa5..7874d1b8f 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/AddIdentity.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/AddIdentity.java @@ -135,6 +135,10 @@ public void test(TestCaseDTO testCaseDTO) throws Exception { writeAutoGeneratedId("Esignet_PartnerSelfRegistration_All_Valid_Smoke_sid", "partnerId", generateRandomNumberString(20)); + + writeAutoGeneratedId("Esignet_PartnerSelfRegistration_Kyc_Valid_Smoke_sid", "partnerId", + generateRandomNumberString(20)); + isvalueReplaced = true; } } else { diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenId.java b/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenId.java index 7439b679a..12303eef1 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenId.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenId.java @@ -104,7 +104,12 @@ public void test(TestCaseDTO testCaseDTO) String[] templateFields = testCaseDTO.getTemplateFields(); String inputJson = ""; + if (BaseTestCase.currentModule.equals(GlobalConstants.MASTERDATA) + && testCaseName.startsWith("Esignet_CreateOIDCClient")) { + inputJson = testCaseDTO.getInput(); + } else { inputJson = getJsonFromTemplate(testCaseDTO.getInput(), testCaseDTO.getInputTemplate()); + } String outputJson = getJsonFromTemplate(testCaseDTO.getOutput(), testCaseDTO.getOutputTemplate()); diff --git a/api-test/src/main/resources/esignet/AuthenticateUserPasswordNegTC/AuthenticateUserPasswordNegTC.yml b/api-test/src/main/resources/esignet/AuthenticateUserPasswordNegTC/AuthenticateUserPasswordNegTC.yml index a25730326..270831a0f 100644 --- a/api-test/src/main/resources/esignet/AuthenticateUserPasswordNegTC/AuthenticateUserPasswordNegTC.yml +++ b/api-test/src/main/resources/esignet/AuthenticateUserPasswordNegTC/AuthenticateUserPasswordNegTC.yml @@ -1146,7 +1146,7 @@ AuthenticateUserPasswordNegTC: "encodedHash": "$ID:OAuthDetailsRequest_Password_NegTC_Scen1_Valid_Smoke_sid_encodedResp$", "requestTime": "$TIMESTAMP$", "transactionId": "$ID:OAuthDetailsRequest_Password_NegTC_Scen1_Valid_Smoke_sid_transactionId$", - "individualId": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_PHONE$", + "individualId": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_PHONE$", "authFactorType" : "PWD", "challenge" : "$RESETPASSWORDFORAUTHENTICATION$", "format": "alpha-numeric" diff --git a/api-test/src/main/resources/esignet/RegisterUserNegTC/RegisterUserNegTC.yml b/api-test/src/main/resources/esignet/RegisterUserNegTC/RegisterUserNegTC.yml index caca27aa2..bf9718ab9 100644 --- a/api-test/src/main/resources/esignet/RegisterUserNegTC/RegisterUserNegTC.yml +++ b/api-test/src/main/resources/esignet/RegisterUserNegTC/RegisterUserNegTC.yml @@ -1589,13 +1589,13 @@ RegisterUserNegTC: inputTemplate: esignet/RegisterUser/RegisterUser outputTemplate: esignet/RegisterUser/RegisterUserResult input: '{ - "verifiedTransactionID": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_VTransactionID$", - "username": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_PHONE$", + "verifiedTransactionID": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_VTransactionID$", + "username": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_PHONE$", "password": "$PASSWORDFORAUTHENTICATION$", "consent": "AGREE", "fullName": "$FULLNAMETOREGISTERUSER$", "requestTime": "$TIMESTAMP$", - "phone": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_PHONE$", + "phone": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_PHONE$", "preferredLang": "khm" }' output: '{ diff --git a/api-test/src/main/resources/esignet/ResetPasswordNegTC/ResetPasswordNegTC.yml b/api-test/src/main/resources/esignet/ResetPasswordNegTC/ResetPasswordNegTC.yml index dafbc318d..9961a20b7 100644 --- a/api-test/src/main/resources/esignet/ResetPasswordNegTC/ResetPasswordNegTC.yml +++ b/api-test/src/main/resources/esignet/ResetPasswordNegTC/ResetPasswordNegTC.yml @@ -585,7 +585,7 @@ ResetPasswordNegTC: outputTemplate: esignet/ResetPasswordNegTC/ResetPasswordNegTCResult input: '{ "verifiedTransactionID": "$ID:VerifyChallengeForResetPasswordNegTC_STransId_smoke_Pos_VTransactionID$", - "identifier": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_PHONE$", + "identifier": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_PHONE$", "password": "$PASSWORDTORESET$", "requestTime": "$TIMESTAMP$" }' diff --git a/api-test/src/main/resources/esignet/VerifyChallengeForResetPasswordNegTC/VerifyChallengeForResetPasswordNegTC.yml b/api-test/src/main/resources/esignet/VerifyChallengeForResetPasswordNegTC/VerifyChallengeForResetPasswordNegTC.yml index 933da27fd..0d91b6a10 100644 --- a/api-test/src/main/resources/esignet/VerifyChallengeForResetPasswordNegTC/VerifyChallengeForResetPasswordNegTC.yml +++ b/api-test/src/main/resources/esignet/VerifyChallengeForResetPasswordNegTC/VerifyChallengeForResetPasswordNegTC.yml @@ -599,7 +599,7 @@ VerifyChallengeForResetPasswordNegTC: outputTemplate: esignet/VerifyChallengeForResetPasswordNegTC/VerifyChallengeForResetPasswordNegTCResult input: '{ "headerTransactionID": "$ID:VerifyChallengeForResetPasswordNegTC_STransId_smoke_Pos_TransactionID$", - "identifier": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_PHONE$", + "identifier": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_PHONE$", "challenge": "111111", "format": "alpha-numeric", "type": "OTP", @@ -608,7 +608,7 @@ VerifyChallengeForResetPasswordNegTC: "type2": "KBI", "requestTime": "$TIMESTAMP$", "sendOtp":{ - "identifier": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_PHONE$", + "identifier": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_PHONE$", "captchaToken": "", "purpose": "RESET_PASSWORD", "requestTime": "$TIMESTAMP$", diff --git a/api-test/src/main/resources/esignet/VerifyChallengeNegTC/VerifyChallengeNegTC.yml b/api-test/src/main/resources/esignet/VerifyChallengeNegTC/VerifyChallengeNegTC.yml index 81cffef49..4b6ebcc26 100644 --- a/api-test/src/main/resources/esignet/VerifyChallengeNegTC/VerifyChallengeNegTC.yml +++ b/api-test/src/main/resources/esignet/VerifyChallengeNegTC/VerifyChallengeNegTC.yml @@ -1528,4 +1528,34 @@ VerifyChallengeNegTC: "status":"SUCCESS", "sendOtpResTemplate":"esignet/GenerateChallenge/GenerateChallengeResult" } +}' + + ESignet_VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication: + endPoint: /v1/signup/registration/verify-challenge + role: resident + restMethod: post + inputTemplate: esignet/VerifyChallengeNegTC/VerifyChallengeNegTC + outputTemplate: esignet/VerifyChallengeNegTC/VerifyChallengeNegTCResult + input: '{ + "headerTransactionID": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_TransactionID$", + "identifier": "$ID:VerifyChallengeNegTC_STransId_Valid_Smoke_Pos_For_Authentication_PHONE$", + "challenge": "111111", + "format": "alpha-numeric", + "type": "OTP", + "requestTime": "$TIMESTAMP$", + "sendOtp":{ + "identifier": "$PHONENUMBERFROMREGEXFORSIGNUP$", + "captchaToken": "", + "purpose": "REGISTRATION", + "requestTime": "$TIMESTAMP$", + "sendOtpReqTemplate": "esignet/GenerateChallenge/GenerateChallenge", + "sendOtpEndPoint": "/v1/signup/registration/generate-challenge" + } +}' + output: '{ + "status":"SUCCESS", + "sendOtpResp":{ + "status":"SUCCESS", + "sendOtpResTemplate":"esignet/GenerateChallenge/GenerateChallengeResult" + } }' \ No newline at end of file From 67c979b08d809023f2898752a51625d46a13001b Mon Sep 17 00:00:00 2001 From: MeghaMaledar Date: Wed, 23 Oct 2024 18:51:42 +0530 Subject: [PATCH 15/33] MOSIP-35937 Negative Test cases for L2 flow Signed-off-by: MeghaMaledar --- .../AuthenticateUserNegTC.hbs | 15 + .../AuthenticateUserNegTC.yml | 33 + .../AuthenticateUserNegTCResult.hbs | 1 + .../ClaimDetailsNegTC/ClaimDetailsNegTC.hbs | 4 + .../ClaimDetailsNegTC/ClaimDetailsNegTC.yml | 224 ++++ .../ClaimDetailsResultNegTC.hbs | 1 + .../OAuthDetailsRequestNegResultTC.hbs | 1 + .../OAuthDetailsRequestNegTC.hbs | 39 + .../OAuthDetailsRequestNegTC.yml | 973 ++++++++++++++++++ ...OAuthDetailsWithClaimValueRequestNegTC.hbs | 62 ++ api-test/testNgXmlFiles/esignetSuite.xml | 26 + 11 files changed, 1379 insertions(+) create mode 100644 api-test/src/main/resources/esignet/AuthenticateUserV3NegTC/AuthenticateUserNegTC.hbs create mode 100644 api-test/src/main/resources/esignet/AuthenticateUserV3NegTC/AuthenticateUserNegTC.yml create mode 100644 api-test/src/main/resources/esignet/AuthenticateUserV3NegTC/AuthenticateUserNegTCResult.hbs create mode 100644 api-test/src/main/resources/esignet/ClaimDetailsNegTC/ClaimDetailsNegTC.hbs create mode 100644 api-test/src/main/resources/esignet/ClaimDetailsNegTC/ClaimDetailsNegTC.yml create mode 100644 api-test/src/main/resources/esignet/ClaimDetailsNegTC/ClaimDetailsResultNegTC.hbs create mode 100644 api-test/src/main/resources/esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegResultTC.hbs create mode 100644 api-test/src/main/resources/esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC.hbs create mode 100644 api-test/src/main/resources/esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC.yml create mode 100644 api-test/src/main/resources/esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsWithClaimValueRequestNegTC.hbs diff --git a/api-test/src/main/resources/esignet/AuthenticateUserV3NegTC/AuthenticateUserNegTC.hbs b/api-test/src/main/resources/esignet/AuthenticateUserV3NegTC/AuthenticateUserNegTC.hbs new file mode 100644 index 000000000..43ef2d127 --- /dev/null +++ b/api-test/src/main/resources/esignet/AuthenticateUserV3NegTC/AuthenticateUserNegTC.hbs @@ -0,0 +1,15 @@ +{ + "encodedHash": "{{encodedHash}}", + "requestTime": "{{requestTime}}", + "request": { + "transactionId": "{{transactionId}}", + "individualId": "{{individualId}}", + "challengeList" : [ + { + "authFactorType" : "{{authFactorType}}", + "challenge" : "{{challenge}}", + "format": "alpha-numeric" + } + ] + } +} \ No newline at end of file diff --git a/api-test/src/main/resources/esignet/AuthenticateUserV3NegTC/AuthenticateUserNegTC.yml b/api-test/src/main/resources/esignet/AuthenticateUserV3NegTC/AuthenticateUserNegTC.yml new file mode 100644 index 000000000..42042646c --- /dev/null +++ b/api-test/src/main/resources/esignet/AuthenticateUserV3NegTC/AuthenticateUserNegTC.yml @@ -0,0 +1,33 @@ +AuthenticateUserV3NegTC: + ESignet_AuthenticateUserNegTC_V3_AuthToken_Xsrf__uin_Otp_Valid_Smoke: + endPoint: /v1/esignet/authorization/v3/authenticate + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/AuthenticateUserV3NegTC/AuthenticateUserNegTC + outputTemplate: esignet/AuthenticateUserV3/AuthenticateUserResult + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid_transactionId$", + "individualId": "$ID:AddIdentity_L2_Valid_Parameters_smoke_Neg_Pos_UIN$", + "authFactorType" : "OTP", + "challenge" : "$ID:AddIdentity_L2_Valid_Parameters_smoke_Neg_Pos_EMAIL$", + "sendOtp":{ + "encodedHash": "$ID:OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid_transactionId$", + "individualId": "$ID:AddIdentity_L2_Valid_Parameters_smoke_Neg_Pos_UIN$", + "otpChannels": [{channel: "email"},{channel: "phone"}], + "sendOtpReqTemplate": "esignet/SendOtp/SendOtp", + "sendOtpEndPoint": "/v1/esignet/authorization/send-otp" + } + }' + output: '{ + "sendOtpResp":{ + "maskedMobile": "$IGNORE$", + "sendOtpResTemplate":"esignet/SendOtp/SendOtpResult", + "maskedEmail": "$IGNORE$" + } +}' \ No newline at end of file diff --git a/api-test/src/main/resources/esignet/AuthenticateUserV3NegTC/AuthenticateUserNegTCResult.hbs b/api-test/src/main/resources/esignet/AuthenticateUserV3NegTC/AuthenticateUserNegTCResult.hbs new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/api-test/src/main/resources/esignet/AuthenticateUserV3NegTC/AuthenticateUserNegTCResult.hbs @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/api-test/src/main/resources/esignet/ClaimDetailsNegTC/ClaimDetailsNegTC.hbs b/api-test/src/main/resources/esignet/ClaimDetailsNegTC/ClaimDetailsNegTC.hbs new file mode 100644 index 000000000..ead77da28 --- /dev/null +++ b/api-test/src/main/resources/esignet/ClaimDetailsNegTC/ClaimDetailsNegTC.hbs @@ -0,0 +1,4 @@ +{ + "encodedHash": "{{encodedHash}}", + "transactionId": "{{transactionId}}" +} \ No newline at end of file diff --git a/api-test/src/main/resources/esignet/ClaimDetailsNegTC/ClaimDetailsNegTC.yml b/api-test/src/main/resources/esignet/ClaimDetailsNegTC/ClaimDetailsNegTC.yml new file mode 100644 index 000000000..83ca588df --- /dev/null +++ b/api-test/src/main/resources/esignet/ClaimDetailsNegTC/ClaimDetailsNegTC.yml @@ -0,0 +1,224 @@ +ClaimDetailsNegTC: + ESignet_ClaimDetailsNegTC_Invalid_EncodedHash: + endPoint: /v1/esignet/authorization/claim-details + role: resident + restMethod: get + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/ClaimDetailsNegTC/ClaimDetailsNegTC + outputTemplate: esignet/error + input: '{ + "encodedHash": "ggfhjkhgyydiytf", + "transactionId": "$ID:OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid_transactionId$" + }' + output: '{ + "errors": [ + { + "errorCode": "invalid_transaction", + "errorMessage": "invalid_transaction" + } + ] +}' + + ESignet_ClaimDetailsNegTC_Null_EncodedHash: + endPoint: /v1/esignet/authorization/claim-details + role: resident + restMethod: get + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/ClaimDetailsNegTC/ClaimDetailsNegTC + outputTemplate: esignet/error + input: '{ + "encodedHash": null, + "transactionId": "$ID:OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid_transactionId$" + }' + output: '{ + "errors": [ + { + "errorCode": "invalid_transaction", + "errorMessage": "invalid_transaction" + } + ] +}' + + ESignet_ClaimDetailsNegTC_Empty_EncodedHash: + endPoint: /v1/esignet/authorization/claim-details + role: resident + restMethod: get + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/ClaimDetailsNegTC/ClaimDetailsNegTC + outputTemplate: esignet/error + input: '{ + "encodedHash": "", + "transactionId": "$ID:OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid_transactionId$" + }' + output: '{ + "errors": [ + { + "errorCode": "invalid_transaction", + "errorMessage": "invalid_transaction" + } + ] +}' + + ESignet_ClaimDetailsNegTC_Space_Val_EncodedHash: + endPoint: /v1/esignet/authorization/claim-details + role: resident + restMethod: get + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/ClaimDetailsNegTC/ClaimDetailsNegTC + outputTemplate: esignet/error + input: '{ + "encodedHash": " ", + "transactionId": "$ID:OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid_transactionId$" + }' + output: '{ + "errors": [ + { + "errorCode": "invalid_transaction", + "errorMessage": "invalid_transaction" + } + ] +}' + + ESignet_ClaimDetailsNegTC_Missing_EncodedHash: + endPoint: /v1/esignet/authorization/claim-details + role: resident + restMethod: get + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/ClaimDetailsNegTC/ClaimDetailsNegTC + outputTemplate: esignet/error + input: '{ + "encodedHash": "$REMOVE$", + "transactionId": "$ID:OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid_transactionId$" + }' + output: '{ + "errors": [ + { + "errorCode": "invalid_transaction", + "errorMessage": "invalid_transaction" + } + ] +}' + + ESignet_ClaimDetailsNegTC_invalid_TransactionId: + endPoint: /v1/esignet/authorization/claim-details + role: resident + restMethod: get + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/ClaimDetailsNegTC/ClaimDetailsNegTC + outputTemplate: esignet/error + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid_encodedResp$", + "transactionId": "aojoidncpoailf" + }' + output: '{ + "errors": [ + { + "errorCode": "invalid_transaction", + "errorMessage": "invalid_transaction" + } + ] +}' + + ESignet_ClaimDetailsNegTC_Null_Val_TransactionId: + endPoint: /v1/esignet/authorization/claim-details + role: resident + restMethod: get + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/ClaimDetailsNegTC/ClaimDetailsNegTC + outputTemplate: esignet/error + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid_encodedResp$", + "transactionId": null + }' + output: '{ + "errors": [ + { + "errorCode": "invalid_transaction", + "errorMessage": "invalid_transaction" + } + ] +}' + + ESignet_ClaimDetailsNegTC_Empty_TransactionId: + endPoint: /v1/esignet/authorization/claim-details + role: resident + restMethod: get + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/ClaimDetailsNegTC/ClaimDetailsNegTC + outputTemplate: esignet/error + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid_encodedResp$", + "transactionId": "" + }' + output: '{ + "errors": [ + { + "errorCode": "invalid_transaction", + "errorMessage": "invalid_transaction" + } + ] +}' + + ESignet_ClaimDetailsNegTC_Space_Val_TransactionId: + endPoint: /v1/esignet/authorization/claim-details + role: resident + restMethod: get + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/ClaimDetailsNegTC/ClaimDetailsNegTC + outputTemplate: esignet/error + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid_encodedResp$", + "transactionId": " " + }' + output: '{ + "errors": [ + { + "errorCode": "invalid_transaction", + "errorMessage": "invalid_transaction" + } + ] +}' + + ESignet_ClaimDetailsNegTC_Missing_TransactionId: + endPoint: /v1/esignet/authorization/claim-details + role: resident + restMethod: get + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/ClaimDetailsNegTC/ClaimDetailsNegTC + outputTemplate: esignet/error + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid_encodedResp$", + "transactionId": "$REMOVE$" + }' + output: '{ + "errors": [ + { + "errorCode": "invalid_transaction", + "errorMessage": "invalid_transaction" + } + ] +}' + ESignet_ClaimDetailsNegTC_AuthToken_Xsrf_uin_Valid_Smoke: + endPoint: /v1/esignet/authorization/claim-details + role: resident + restMethod: get + checkErrorsOnlyInResponse: true + validityCheckRequired: true + inputTemplate: esignet/ClaimDetailsNegTC/ClaimDetailsNegTC + outputTemplate: esignet/ClaimDetailsNegTC/ClaimDetailsResultNegTC + input: '{ + "encodedHash": "$ID:OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid_encodedResp$", + "transactionId": "$ID:OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid_transactionId$" + }' + output: '{ +}' \ No newline at end of file diff --git a/api-test/src/main/resources/esignet/ClaimDetailsNegTC/ClaimDetailsResultNegTC.hbs b/api-test/src/main/resources/esignet/ClaimDetailsNegTC/ClaimDetailsResultNegTC.hbs new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/api-test/src/main/resources/esignet/ClaimDetailsNegTC/ClaimDetailsResultNegTC.hbs @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/api-test/src/main/resources/esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegResultTC.hbs b/api-test/src/main/resources/esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegResultTC.hbs new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/api-test/src/main/resources/esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegResultTC.hbs @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/api-test/src/main/resources/esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC.hbs b/api-test/src/main/resources/esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC.hbs new file mode 100644 index 000000000..18abb612e --- /dev/null +++ b/api-test/src/main/resources/esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC.hbs @@ -0,0 +1,39 @@ +{ + "requestTime": "{{requestTime}}", + "request": { + "clientId": "{{clientId}}", + "scope": "{{scope}}", + "responseType": "{{responseType}}", + "redirectUri": "{{redirectUri}}", + "display": "{{display}}", + "prompt": "{{prompt}}", + "acrValues": "{{acrValues}}", + "claims": { + "userinfo": { + "name": { + "essential": false + }, + "phone_number": { + "essential": true + }, + "verified_claims": [ + { + "verification": { + "trust_framework": {"value": "de_aml"} + }, + "claims": { + "email": { + "essential": true + } + } + } + ] + }, + "id_token": {} + }, + "nonce" : "{{nonce}}", + "state" : "{{state}}", + "claimsLocales" : "{{claimsLocales}}", + "uiLocales" : "{{uiLocales}}" + } +} \ No newline at end of file diff --git a/api-test/src/main/resources/esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC.yml b/api-test/src/main/resources/esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC.yml new file mode 100644 index 000000000..b58094c71 --- /dev/null +++ b/api-test/src/main/resources/esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC.yml @@ -0,0 +1,973 @@ +OAuthDetailsRequestV3Neg: + ESignet_OAuthDetailsRequestNegTC_V3_with_invalid_RequestTime: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "apknktokd", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US", + "trust_framework": "jp_aml" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_request", + "errorMessage": "requestTime: invalid_request" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_Null_value_RequestTime: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": null, + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_request", + "errorMessage": "requestTime: invalid_request" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_empty_RequestTime: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_request", + "errorMessage": "requestTime: invalid_request" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_Space_value_RequestTime: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": " ", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_request", + "errorMessage": "requestTime: invalid_request" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_missing_RequestTime: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$REMOVE$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_request", + "errorMessage": "requestTime: invalid_request" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_invalid_ClientID: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "jkjdangjfkdjnlkfkgjdsfnlkfjdkf", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_client_id", + "errorMessage": "invalid_client_id" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_Null_ClientID: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": $TIMESTAMP$, + "clientId": null, + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_client_id", + "errorMessage": "request.clientId: invalid_client_id" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_empty_ClientID: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": $TIMESTAMP$, + "clientId": "", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_client_id", + "errorMessage": "request.clientId: invalid_client_id" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_Space_value_ClientID: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": " ", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_client_id", + "errorMessage": "request.clientId: invalid_client_id" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_missing_ClientID: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "$REMOVE$", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_client_id", + "errorMessage": "request.clientId: invalid_client_id" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_invalid_Scope: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "aegaegegadd", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_scope", + "errorMessage": "request.scope: invalid_scope" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_Null_Scope_value: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": $TIMESTAMP$, + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": null, + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_scope", + "errorMessage": "request.scope: invalid_scope" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_empty_Scope: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": $TIMESTAMP$, + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_scope", + "errorMessage": "request.scope: invalid_scope" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_Space_value_Scope: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": " ", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_scope", + "errorMessage": "request.scope: invalid_scope" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_missing_Scope: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "$REMOVE$", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_scope", + "errorMessage": "request.scope: invalid_scope" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_invalid_ResponseType: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "tfyjii", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_response_type", + "errorMessage": "request.responseType: invalid_response_type" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_Null_ResponseType_value: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": $TIMESTAMP$, + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": null, + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_response_type", + "errorMessage": "request.responseType: invalid_response_type" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_empty_ResponseType: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": $TIMESTAMP$, + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_response_type", + "errorMessage": "request.responseType: invalid_response_type" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_Space_value_ResponseType: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": " ", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_response_type", + "errorMessage": "request.responseType: invalid_response_type" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_missing_ResponseType: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "$REMOVE$", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_response_type", + "errorMessage": "request.responseType: invalid_response_type" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_invalid_RedirectURI: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "adaklfjfods", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_redirect_uri", + "errorMessage": "request.redirectUri: invalid_redirect_uri" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_Null_RedirectURI_value: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": $TIMESTAMP$, + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": null, + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_redirect_uri", + "errorMessage": "request.redirectUri: invalid_redirect_uri" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_empty_RedirectURI: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": $TIMESTAMP$, + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_redirect_uri", + "errorMessage": "request.redirectUri: invalid_redirect_uri" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_Space_value_RedirectURI: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": " ", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_redirect_uri", + "errorMessage": "request.redirectUri: invalid_redirect_uri" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_missing_RedirectURI: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$REMOVE$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_redirect_uri", + "errorMessage": "request.redirectUri: invalid_redirect_uri" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_invalid_Display: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "ajodinvalidoaoi", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_display", + "errorMessage": "request.display: invalid_display" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_invalid_Prompt: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "oaidnoadi", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_prompt", + "errorMessage": "request.prompt: invalid_prompt" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_invalid_acrValues: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "malslinakjol", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_acr", + "errorMessage": "request.acr: invalid_acr" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_invalid_nonce: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "aod;ofald", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_nonce", + "errorMessage": "request.nonce: invalid_nonce" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_invalid_state: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "aodfjlf", + "claimsLocales": "en", + "uiLocales": "en-US" +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_state", + "errorMessage": "request.state: invalid_state" + } + ] +}' + + ESignet_OAuthDetailsRequestNegTC_V3_with_invalid_uiLocales: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "adfa", +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_ui_locales", + "errorMessage": "request.ui_locales: invalid_ui_locales" + } + ] +}' + + ESignet_OAuthDetailsRequest_V3_WithClaimValues_AuthToken_with_invalid_email_essential: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsWithClaimValueRequestNegTC + outputTemplate: esignet/error + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US", + "trust_framework": "de_aml", + "max_age": 63113852, + "given_name": ["automation", "test"], + "purpose": "Name given by user", + "name_value": "automation", + "name_values": ["ab","cd"], + "phone_number": "1234567890", + "essential": 10 +}' + output: '{ + "errors": [ + { + "errorCode": "invalid_essential", + "errorMessage": "request.invalid_essential: invalid_essential" + } + ] +}' + + ESignet_OAuthDetailsRequest_V3_Neg_AuthToken_Xsrf_uin_all_Valid_Smoke_sid: + endPoint: /v1/esignet/authorization/v3/oauth-details + role: resident + restMethod: post + checkErrorsOnlyInResponse: true + inputTemplate: esignet/OAuthDetailsRequestV3/OAuthDetailsWithClaimValueRequest + input: '{ + "requestTime": "$TIMESTAMP$", + "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "scope": "openid profile", + "responseType": "code", + "redirectUri": "$IDPREDIRECTURI$", + "display": "popup", + "prompt": "login", + "acrValues": "mosip:idp:acr:generated-code", + "nonce": "973eieljzng", + "state": "urlInfo1724138417665", + "claimsLocales": "en", + "uiLocales": "en-US", + "trust_framework": ["de_aml","jp_aml"], + "assurance_level": "high", + "max_age": 63113852, + "evidence_type": "document", + "evidence_method": "test", + "given_name": ["automation", "test"], + "purpose": "Name given by user", + "name_value": "automation", + "name_values": ["ab","cd"], + "phone_number": "1234567890", + "email_essential": true +}' + output: '{ + +}' \ No newline at end of file diff --git a/api-test/src/main/resources/esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsWithClaimValueRequestNegTC.hbs b/api-test/src/main/resources/esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsWithClaimValueRequestNegTC.hbs new file mode 100644 index 000000000..eeafba6f8 --- /dev/null +++ b/api-test/src/main/resources/esignet/OAuthDetailsRequestV3NegTC/OAuthDetailsWithClaimValueRequestNegTC.hbs @@ -0,0 +1,62 @@ +{ + "requestTime": "{{requestTime}}", + "request": { + "clientId": "{{clientId}}", + "scope": "{{scope}}", + "responseType": "{{responseType}}", + "redirectUri": "{{redirectUri}}", + "display": "{{display}}", + "prompt": "{{prompt}}", + "acrValues": "{{acrValues}}", + "claims": { + "userinfo": { + "name": { + "essential": false + }, + "phone_number": { + "essential": true + }, + "verified_claims": [ + { + "verification": { + "trust_framework": { + "values": "{{trust_framework}}" + }, + "assurance-level": { + "value": "high" + }, + "time": { + "max_age": "{{max_age}}" + }, + "evidence": [ + {"type": { "value": "document"}}, + {"method": { "value": "test" }} + ] + }, + "claims": { + "given_name": { + "values":"manual", + "purpose":"{{purpose}}", + "essential": true + }, + "name": { + "value": "{{name_value}}" + }, + "phone_number": { + "value": "{{phone_number}}" + }, + "email": { + "essential": {{essential}} + } + } + } + ] + }, + "id_token": {} + }, + "nonce" : "{{nonce}}", + "state" : "{{state}}", + "claimsLocales" : "{{claimsLocales}}", + "uiLocales" : "{{uiLocales}}" + } +} \ No newline at end of file diff --git a/api-test/testNgXmlFiles/esignetSuite.xml b/api-test/testNgXmlFiles/esignetSuite.xml index 3adbb9e85..0c08237f5 100644 --- a/api-test/testNgXmlFiles/esignetSuite.xml +++ b/api-test/testNgXmlFiles/esignetSuite.xml @@ -907,4 +907,30 @@
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 94222ada58c2f9f72d390e77d1a02818c3444c4a Mon Sep 17 00:00:00 2001 From: Mohan E Date: Mon, 28 Oct 2024 10:15:40 +0530 Subject: [PATCH 16/33] [MOSIP-36541] Updated enable-new-port.md Signed-off-by: Mohan E --- docs/design/enable-new-port.md | 94 ++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 44 deletions(-) diff --git a/docs/design/enable-new-port.md b/docs/design/enable-new-port.md index f9f995803..709f42fc2 100644 --- a/docs/design/enable-new-port.md +++ b/docs/design/enable-new-port.md @@ -2,49 +2,7 @@ ### steps: -1. Update the configuration as given below within the `stream` block of the nginx.conf file of nginx node. - ``` - upstream { - server :; - server :; - server :; - server :; - server :; - server :; - server :; - server :; - - } - - Note: The upstream block is usually followed by a server block where the traffic from clients is forwarded to the backend upstream group. - server{ - listen :; - proxy_pass ; - } - ``` - -2. Expose the port and nodePort from the AWS cloud and UFW firewall. - * < port >: needs to be exposed for the nginx node. - * < nodeport >: needs to be exposed for all the k8's cluster nodes. - -3. Update the IstioOperator (IOP) configuration as given below by editing the IOP in the istio-system namespace. - - ``` - $ kubectl -n istio-system edit istiooperator istio-operators-mosip - ``` - - ``` - k8s: - service: - ports: - - name: - nodePort: - port: - protocol: TCP - targetPort: - ``` - -4. Add the Istio Gateway and Virtual service by deploying the istio-addons and update the configuration as given below. +1. Add the Istio Gateway and Virtual service by deploying the istio-addons and update the configuration as given below. * Gateway: ``` @@ -74,4 +32,52 @@ host: port: number: 5432 ## pod's service port - ``` \ No newline at end of file + ``` + +2. Update the IstioOperator (IOP) configuration as given below by editing the IOP in the istio-system namespace. + + ``` + $ kubectl -n istio-system edit istiooperator istio-operators-mosip + ``` + + ``` + k8s: + service: + ports: + - name: + nodePort: + port: + protocol: TCP + targetPort: + ``` + +3. Update the configuration as given below within the `stream` block of the nginx.conf file of nginx node. + ``` + upstream { + server :; + server :; + server :; + server :; + server :; + server :; + server :; + server :; + + } + + Note: The upstream block is usually followed by a server block where the traffic from clients is forwarded to the backend upstream group. + server{ + listen :; + proxy_pass ; + } + ``` + +4. Restart the Nginx service. + ``` + sudo systemctl restart nginx + ``` + +5. Expose the port and nodePort from the AWS cloud and UFW firewall. + * < port >: needs to be exposed for the nginx node. + * < nodeport >: needs to be exposed for all the k8's cluster nodes. + From ffd8823951ac54ef292e2f9f1181f78a202ba911 Mon Sep 17 00:00:00 2001 From: Abhishek S <127825992+abhishek8shankar@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:28:10 +0530 Subject: [PATCH 17/33] [DSD-6445] Updated esignet-global-cm.yaml.sample (#978) Signed-off-by: Abhishek S <127825992+abhishek8shankar@users.noreply.github.com> --- deploy/esignet-global-cm.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/esignet-global-cm.yaml b/deploy/esignet-global-cm.yaml index 3a5bdb357..8db1d1246 100644 --- a/deploy/esignet-global-cm.yaml +++ b/deploy/esignet-global-cm.yaml @@ -10,6 +10,7 @@ metadata: namespace: esignet data: mosip-version: develop + installation-domain: sandbox.xyz.net mosip-api-host: api.sandbox.xyz.net mosip-iam-external-host: iam.sandbox.xyz.net mosip-api-internal-host: api-internal.sandbox.xyz.net From ffa01ea7f7025bb5fb468c19751a1f75e7deb555 Mon Sep 17 00:00:00 2001 From: Sohan Kumar Dey <72375959+Sohandey@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:49:17 +0530 Subject: [PATCH 18/33] MOSIP-37006 Signed-off-by: Sohan Kumar Dey <72375959+Sohandey@users.noreply.github.com> --- .../io/mosip/testrig/apirig/testscripts/EsignetBioAuth.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/EsignetBioAuth.java b/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/EsignetBioAuth.java index ef38d7047..de163c37f 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/EsignetBioAuth.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/EsignetBioAuth.java @@ -85,7 +85,10 @@ public Object[] getTestCaseList(ITestContext context) { @Test(dataProvider = "testcaselist") public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException { testCaseName = testCaseDTO.getTestCaseName(); - testCaseName = EsignetUtil.isTestCaseValidForExecution(testCaseDTO); + + if (BaseTestCase.currentModule.equals(GlobalConstants.MASTERDATA)== false) { + testCaseName = EsignetUtil.isTestCaseValidForExecution(testCaseDTO); + } testCaseName = isTestCaseValidForExecution(testCaseDTO); if (HealthChecker.signalTerminateExecution) { throw new SkipException( From c4ac8a09e2fe1b58772c84af3cba6ea72c6f6648 Mon Sep 17 00:00:00 2001 From: Kaif Siddique <74772315+kaifk468@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:56:28 +0530 Subject: [PATCH 19/33] [ES-1640] added schema validation for claims query parameter (#887) * added schema validatio for claims Signed-off-by: Mohd Kaif Siddique * added schema validatio for claims Signed-off-by: Mohd Kaif Siddique * updated the jackson-core versions and fix test cases Signed-off-by: Mohd Kaif Siddique * updated jackson-core version Signed-off-by: Mohd Kaif Siddique * modified schema config and now storing it in app itself Signed-off-by: Mohd Kaif Siddique * resolve conflict with develop Signed-off-by: Mohd Kaif Siddique * review changes Signed-off-by: Mohd Kaif Siddique * review changes Signed-off-by: Mohd Kaif Siddique * review changes Signed-off-by: Mohd Kaif Siddique --------- Signed-off-by: Mohd Kaif Siddique Co-authored-by: Mohd Kaif Siddique --- esignet-core/pom.xml | 32 +- .../core/constants/ErrorConstants.java | 1 - .../esignet/core/dto/OAuthDetailRequest.java | 10 +- .../esignet/core/validator/ClaimsSchema.java | 26 + .../core/validator/ClaimsSchemaValidator.java | 77 +++ .../io/mosip/esignet/core/ValidatorTest.java | 140 ++++- .../verified_claims_request_schema_test.json | 531 +++++++++++++++++ esignet-service/pom.xml | 1 - .../resources/application-default.properties | 2 + .../resources/application-local.properties | 3 + .../verified_claims_request_schema.json | 542 ++++++++++++++++++ .../AuthorizationControllerTest.java | 67 ++- .../mosip/esignet/flows/AuthCodeFlowTest.java | 33 +- .../flows/AuthorizationAPIFlowTest.java | 28 +- .../resources/application-test.properties | 3 + .../verified_claims_request_schema_test.json | 531 +++++++++++++++++ pom.xml | 22 +- 17 files changed, 2021 insertions(+), 28 deletions(-) create mode 100644 esignet-core/src/main/java/io/mosip/esignet/core/validator/ClaimsSchema.java create mode 100644 esignet-core/src/main/java/io/mosip/esignet/core/validator/ClaimsSchemaValidator.java create mode 100644 esignet-core/src/test/resources/verified_claims_request_schema_test.json create mode 100644 esignet-service/src/main/resources/verified_claims_request_schema.json create mode 100644 esignet-service/src/test/resources/verified_claims_request_schema_test.json diff --git a/esignet-core/pom.xml b/esignet-core/pom.xml index 7b27d474a..2c70fa859 100644 --- a/esignet-core/pom.xml +++ b/esignet-core/pom.xml @@ -22,7 +22,6 @@ 11 2.9.5 2.9.8 - 2.15.0 2.15.0 2.15.0 1.2.1.0 @@ -100,20 +99,44 @@ micrometer-registry-prometheus runtime + + com.networknt + json-schema-validator + 1.5.1 + + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-annotations + + + com.fasterxml.jackson.core + jackson-databind + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + com.fasterxml.jackson.module + jackson-module-afterburner + + + com.fasterxml.jackson.core jackson-core - ${jackson.databind} com.fasterxml.jackson.core jackson-annotations - ${jackson.databind} com.fasterxml.jackson.core jackson-databind - ${jackson.databind} com.fasterxml.jackson.datatype @@ -181,4 +204,5 @@ + diff --git a/esignet-core/src/main/java/io/mosip/esignet/core/constants/ErrorConstants.java b/esignet-core/src/main/java/io/mosip/esignet/core/constants/ErrorConstants.java index 57ac0110b..2b8248378 100644 --- a/esignet-core/src/main/java/io/mosip/esignet/core/constants/ErrorConstants.java +++ b/esignet-core/src/main/java/io/mosip/esignet/core/constants/ErrorConstants.java @@ -92,6 +92,5 @@ public class ErrorConstants { public static final String INVALID_VERIFICATION = "invalid_verification"; public static final String INVALID_VERIFIED_CLAIMS = "invalid_verified_claims"; public static final String INVALID_PURPOSE="invalid_purpose"; - public static final String VERIFICATION_INCOMPLETE = "verification_incomplete"; } diff --git a/esignet-core/src/main/java/io/mosip/esignet/core/dto/OAuthDetailRequest.java b/esignet-core/src/main/java/io/mosip/esignet/core/dto/OAuthDetailRequest.java index 547f265c2..9063f2b40 100644 --- a/esignet-core/src/main/java/io/mosip/esignet/core/dto/OAuthDetailRequest.java +++ b/esignet-core/src/main/java/io/mosip/esignet/core/dto/OAuthDetailRequest.java @@ -5,16 +5,11 @@ */ package io.mosip.esignet.core.dto; -import io.mosip.esignet.api.dto.claim.Claims; import io.mosip.esignet.api.dto.claim.ClaimsV2; -import io.mosip.esignet.core.validator.OIDCDisplay; -import io.mosip.esignet.core.validator.OIDCPrompt; -import io.mosip.esignet.core.validator.OIDCResponseType; -import io.mosip.esignet.core.validator.OIDCScope; +import io.mosip.esignet.core.constants.ErrorConstants; +import io.mosip.esignet.core.validator.*; import lombok.Data; -import io.mosip.esignet.core.validator.RedirectURL; - import javax.validation.Valid; import javax.validation.constraints.NotBlank; @@ -76,6 +71,7 @@ public class OAuthDetailRequest { * names of the individual Claims being requested as the member names. */ @Valid + @ClaimsSchema(message = ErrorConstants.INVALID_CLAIM) private ClaimsV2 claims; /** diff --git a/esignet-core/src/main/java/io/mosip/esignet/core/validator/ClaimsSchema.java b/esignet-core/src/main/java/io/mosip/esignet/core/validator/ClaimsSchema.java new file mode 100644 index 000000000..a53308b6c --- /dev/null +++ b/esignet-core/src/main/java/io/mosip/esignet/core/validator/ClaimsSchema.java @@ -0,0 +1,26 @@ +package io.mosip.esignet.core.validator; + + +import io.mosip.esignet.core.constants.ErrorConstants; +import javax.validation.Constraint; +import javax.validation.Payload; +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.TYPE_USE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +@Target({FIELD, TYPE_USE}) +@Retention(RUNTIME) +@Constraint(validatedBy = ClaimsSchemaValidator.class) +@Documented +public @interface ClaimsSchema { + + String message() default ErrorConstants.INVALID_CLAIM; + + Class[] groups() default {}; + + Class[] payload() default {}; +} diff --git a/esignet-core/src/main/java/io/mosip/esignet/core/validator/ClaimsSchemaValidator.java b/esignet-core/src/main/java/io/mosip/esignet/core/validator/ClaimsSchemaValidator.java new file mode 100644 index 000000000..60c70f73e --- /dev/null +++ b/esignet-core/src/main/java/io/mosip/esignet/core/validator/ClaimsSchemaValidator.java @@ -0,0 +1,77 @@ +package io.mosip.esignet.core.validator; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.networknt.schema.JsonSchema; +import com.networknt.schema.JsonSchemaFactory; +import com.networknt.schema.SpecVersion; +import com.networknt.schema.ValidationMessage; +import io.mosip.esignet.api.dto.claim.ClaimsV2; +import io.mosip.esignet.core.exception.EsignetException; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.Resource; +import org.springframework.core.io.ResourceLoader; + +import javax.validation.ConstraintValidator; +import javax.validation.ConstraintValidatorContext; +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.util.Set; +import java.util.stream.Collectors; + + +@Slf4j +public class ClaimsSchemaValidator implements ConstraintValidator { + + + @Value("${mosip.esignet.claims.schema.url}") + private String schemaUrl; + + private volatile JsonSchema cachedSchema; + + @Autowired + private ObjectMapper objectMapper; + + @Autowired + private ResourceLoader resourceLoader; + + + @Override + public boolean isValid(ClaimsV2 claims, ConstraintValidatorContext context) { + Set errors = null; + try { + JsonNode jsonNode = objectMapper.valueToTree(claims); + errors = getCachedSchema().validate(jsonNode); + if(errors.isEmpty())return true; + } catch (Exception e) { + log.error("Error validating claims schema", e); + } + log.error("Validation failed for claims: {}", errors); + return false; + } + + private JsonSchema getCachedSchema() throws EsignetException { + if(cachedSchema!=null ) return cachedSchema; + synchronized (this) { + if (cachedSchema == null) { + InputStream schemaResponse = getResource(schemaUrl); + JsonSchemaFactory jsonSchemaFactory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V202012); + cachedSchema = jsonSchemaFactory.getSchema(schemaResponse); + } + } + return cachedSchema; + } + + private InputStream getResource(String url) { + try{ + Resource resource = resourceLoader.getResource(url); + return resource.getInputStream(); + }catch (IOException e){ + log.error("Failed to parse data: {}", url, e); + } + throw new EsignetException("invalid_configuration"); + } +} + diff --git a/esignet-core/src/test/java/io/mosip/esignet/core/ValidatorTest.java b/esignet-core/src/test/java/io/mosip/esignet/core/ValidatorTest.java index 4db70eb24..75ca8b8c3 100644 --- a/esignet-core/src/test/java/io/mosip/esignet/core/ValidatorTest.java +++ b/esignet-core/src/test/java/io/mosip/esignet/core/ValidatorTest.java @@ -5,6 +5,10 @@ */ package io.mosip.esignet.core; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.mosip.esignet.api.dto.claim.ClaimDetail; +import io.mosip.esignet.api.dto.claim.ClaimsV2; import io.mosip.esignet.api.spi.Authenticator; import io.mosip.esignet.core.dto.OAuthDetailRequestV2; import io.mosip.esignet.core.exception.EsignetException; @@ -15,11 +19,16 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; +import org.springframework.boot.test.context.SpringBootTest; import org.springframework.core.env.Environment; +import org.springframework.core.io.DefaultResourceLoader; +import org.springframework.core.io.ResourceLoader; import org.springframework.test.util.ReflectionTestUtils; - +import org.springframework.web.client.RestTemplate; +import java.io.IOException; import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; @@ -28,12 +37,16 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; - import static org.mockito.Mockito.when; + +@SpringBootTest @RunWith(MockitoJUnitRunner.class) public class ValidatorTest { + @InjectMocks + ClaimsSchemaValidator claimSchemaValidator; + @Mock AuthenticationContextClassRefUtil authenticationContextClassRefUtil; @@ -43,6 +56,17 @@ public class ValidatorTest { @Mock Environment environment; + + @Mock + RestTemplate restTemplate; + + + ResourceLoader resourceLoader= new DefaultResourceLoader(); + + ObjectMapper mapper= new ObjectMapper(); + + + private Map discoveryMap = new HashMap<>(); @Before @@ -647,4 +671,116 @@ public void test_ClientNameLangValidator_WithInValidDetail_thenFail(){ Assert.assertFalse(validator.isValid("abc", null)); } + // =============================ClaimSchemaValidator=============================// + + @Test + public void claimSchemaValidator_withValidDetails_thenPass() throws IOException { + + ReflectionTestUtils.setField(claimSchemaValidator,"resourceLoader",resourceLoader); + ReflectionTestUtils.setField(claimSchemaValidator,"objectMapper",mapper); + ReflectionTestUtils.setField(claimSchemaValidator,"schemaUrl","classpath:/verified_claims_request_schema_test.json"); + + String address="{\"essential\":true}"; + String verifiedClaims="[{\"verification\":{\"trust_framework\":{\"value\":\"income-tax\"}},\"claims\":{\"name\":null,\"email\":{\"essential\":true}}},{\"verification\":{\"trust_framework\":{\"value\":\"pwd\"}},\"claims\":{\"birthdate\":{\"essential\":true},\"address\":null}},{\"verification\":{\"trust_framework\":{\"value\":\"kaif\"}},\"claims\":{\"gender\":{\"essential\":true},\"email\":{\"essential\":true}}}]"; + + JsonNode addressNode = mapper.readValue(address, JsonNode.class); + JsonNode verifiedClaimNode = mapper.readValue(verifiedClaims, JsonNode.class); + + Map userinfoMap = new HashMap<>(); + userinfoMap.put("address", addressNode); + userinfoMap.put("verified_claims", verifiedClaimNode); + Map idTokenMap = new HashMap<>(); + + ClaimDetail claimDetail = new ClaimDetail("claim_value", null, true, "secondary"); + idTokenMap.put("some_claim", claimDetail); + + ClaimsV2 claimsV2 = new ClaimsV2(); + claimsV2.setUserinfo(userinfoMap); + claimsV2.setId_token(idTokenMap); + + Assert.assertTrue(claimSchemaValidator.isValid(claimsV2, null)); + } + + @Test + public void claimSchemaValidator_withTrustFrameWorkAsNull_thenFail() throws IOException { + + ReflectionTestUtils.setField(claimSchemaValidator,"resourceLoader",resourceLoader); + ReflectionTestUtils.setField(claimSchemaValidator,"objectMapper",mapper); + ReflectionTestUtils.setField(claimSchemaValidator,"schemaUrl","classpath:/verified_claims_request_schema_test.json"); + + String address="{\"essential\":true}"; + String verifiedClaims="[{\"verification\":{\"trust_framework\":{\"value\":null}},\"claims\":{\"name\":null,\"email\":{\"essential\":true}}},{\"verification\":{\"trust_framework\":{\"value\":\"pwd\"}},\"claims\":{\"birthdate\":{\"essential\":true},\"address\":null}},{\"verification\":{\"trust_framework\":{\"value\":\"kaif\"}},\"claims\":{\"gender\":{\"essential\":true},\"email\":{\"essential\":true}}}]"; + + JsonNode addressNode = mapper.readValue(address, JsonNode.class); + JsonNode verifiedClaimNode = mapper.readValue(verifiedClaims, JsonNode.class); + + Map userinfoMap = new HashMap<>(); + userinfoMap.put("address", addressNode); + userinfoMap.put("verified_claims", verifiedClaimNode); + Map idTokenMap = new HashMap<>(); + ClaimDetail claimDetail = new ClaimDetail("claim_value", null, true, "secondary"); + + idTokenMap.put("some_claim", claimDetail); + ClaimsV2 claimsV2 = new ClaimsV2(); + claimsV2.setUserinfo(userinfoMap); + claimsV2.setId_token(idTokenMap); + + Assert.assertFalse(claimSchemaValidator.isValid(claimsV2, null)); + + } + + @Test + public void claimSchemaValidator_withEssentialAsNonBoolean_thenFail() throws IOException { + + ReflectionTestUtils.setField(claimSchemaValidator,"resourceLoader",resourceLoader); + ReflectionTestUtils.setField(claimSchemaValidator,"objectMapper",mapper); + ReflectionTestUtils.setField(claimSchemaValidator,"schemaUrl","classpath:/verified_claims_request_schema_test.json"); + + String address="{\"essential\":true}"; + String verifiedClaims="[{\"verification\":{\"trust_framework\":{\"value\":\"pwd\"}},\"claims\":{\"name\":null,\"email\":{\"essential\":1}}},{\"verification\":{\"trust_framework\":{\"value\":\"pwd\"}},\"claims\":{\"birthdate\":{\"essential\":true},\"address\":null}},{\"verification\":{\"trust_framework\":{\"value\":\"kaif\"}},\"claims\":{\"gender\":{\"essential\":true},\"email\":{\"essential\":true}}}]"; + + JsonNode addressNode = mapper.readValue(address, JsonNode.class); + JsonNode verifiedClaimNode = mapper.readValue(verifiedClaims, JsonNode.class); + + Map userinfoMap = new HashMap<>(); + userinfoMap.put("address", addressNode); + userinfoMap.put("verified_claims", verifiedClaimNode); + Map idTokenMap = new HashMap<>(); + + ClaimDetail claimDetail = new ClaimDetail("claim_value", null, true, "secondary"); + + idTokenMap.put("some_claim", claimDetail); + ClaimsV2 claimsV2 = new ClaimsV2(); + claimsV2.setUserinfo(userinfoMap); + claimsV2.setId_token(idTokenMap); + + Assert.assertFalse(claimSchemaValidator.isValid(claimsV2, null)); + } + + @Test + public void test_ClaimSchemaValidator_withInvalidValue_thenFail() throws IOException { + + ReflectionTestUtils.setField(claimSchemaValidator,"resourceLoader",resourceLoader); + ReflectionTestUtils.setField(claimSchemaValidator,"objectMapper",mapper); + ReflectionTestUtils.setField(claimSchemaValidator,"schemaUrl","classpath:/verified_claims_request_schema_test.json"); + + String address="{\"essential\":true}"; + String verifiedClaims="[{\"verification\":{\"trust_framework\":{\"value\":\"pwd\"}},\"claims\":{\"name\":null,\"email\":{\"essential\":1}}},{\"verification\":{\"trust_framework\":{\"value\":\"pwd\"}},\"claims\":{\"birthdate\":{\"essential\":true},\"address\":null}},{\"verification\":{\"trust_framework\":{\"value\":\"kf\"}},\"claims\":{\"gender\":{\"essential\":true},\"email\":{\"essential\":true}}}]"; + + JsonNode addressNode = mapper.readValue(address, JsonNode.class); + JsonNode verifiedClaimNode = mapper.readValue(verifiedClaims, JsonNode.class); + + Map userinfoMap = new HashMap<>(); + userinfoMap.put("address", addressNode); + userinfoMap.put("verified_claims", verifiedClaimNode); + Map idTokenMap = new HashMap<>(); + ClaimDetail claimDetail = new ClaimDetail("claim_value", null, true, "secondary"); + + idTokenMap.put("some_claim", claimDetail); + ClaimsV2 claimsV2 = new ClaimsV2(); + claimsV2.setUserinfo(userinfoMap); + claimsV2.setId_token(idTokenMap); + + Assert.assertFalse(claimSchemaValidator.isValid(claimsV2, null)); + } } diff --git a/esignet-core/src/test/resources/verified_claims_request_schema_test.json b/esignet-core/src/test/resources/verified_claims_request_schema_test.json new file mode 100644 index 000000000..fa4590b1f --- /dev/null +++ b/esignet-core/src/test/resources/verified_claims_request_schema_test.json @@ -0,0 +1,531 @@ +{ + "$id": "https://bitbucket.org/openid/ekyc-ida/raw/master/schema/verified_claims_request.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$defs": { + "check_details": { + "type": "array", + "prefixItems": [ + { + "check_id": { + "type": "string" + }, + "check_method": { + "type": "string" + }, + "organization": { + "type": "string" + }, + "time": { + "$ref": "#/$defs/datetime_element" + } + } + ] + }, + "claims_element": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "object", + "properties": { + "essential": { + "type": "boolean" + }, + "purpose": { + "type": "string", + "maxLength": 300, + "minLength": 3 + } + } + } + ] + }, + "minProperties": 1 + } + ] + }, + "constrainable_element": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object", + "properties": { + "essential": { + "type": "boolean" + }, + "purpose": { + "type": "string", + "maxLength": 300, + "minLength": 3 + }, + "value": { + "type": "string" + }, + "values": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + } + } + ] + }, + "datetime_element": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object", + "properties": { + "essential": { + "type": "boolean" + }, + "max_age": { + "type": "integer", + "minimum": 0 + }, + "purpose": { + "type": "string", + "maxLength": 300, + "minLength": 3 + } + } + } + ] + }, + "document_details": { + "type": "object", + "properties": { + "type": { + "$ref": "#/$defs/constrainable_element" + }, + "date_of_expiry": { + "$ref": "#/$defs/datetime_element" + }, + "date_of_issuance": { + "$ref": "#/$defs/datetime_element" + }, + "document_number": { + "$ref": "#/$defs/simple_element" + }, + "issuer": { + "type": "object", + "properties": { + "country": { + "$ref": "#/$defs/simple_element" + }, + "country_code": { + "$ref": "#/$defs/simple_element" + }, + "formatted": { + "$ref": "#/$defs/simple_element" + }, + "jurisdiction": { + "$ref": "#/$defs/simple_element" + }, + "locality": { + "$ref": "#/$defs/simple_element" + }, + "name": { + "$ref": "#/$defs/simple_element" + }, + "postal_code": { + "$ref": "#/$defs/simple_element" + }, + "region": { + "$ref": "#/$defs/simple_element" + }, + "street_address": { + "$ref": "#/$defs/simple_element" + } + } + }, + "personal_number": { + "$ref": "#/$defs/simple_element" + }, + "serial_number": { + "$ref": "#/$defs/simple_element" + } + } + }, + "evidence": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "object", + "properties": { + "value": { + "enum": [ + "document", + "electronic_record", + "vouch", + "electronic_signature" + ] + } + } + }, + "attachments": { + "$ref": "#/$defs/simple_element" + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "value": "electronic_signature" + } + } + }, + "then": { + "properties": { + "created_at": { + "$ref": "#/$defs/datetime_element" + }, + "issuer": { + "$ref": "#/$defs/simple_element" + }, + "serial_number": { + "$ref": "#/$defs/simple_element" + }, + "signature_type": { + "$ref": "#/$defs/simple_element" + } + } + }, + "else": true + }, + { + "if": { + "properties": { + "type": { + "value": "document" + } + } + }, + "then": { + "properties": { + "check_details": { + "$ref": "#/$defs/check_details" + }, + "document_details": { + "$ref": "#/$defs/document_details" + }, + "method": { + "$ref": "#/$defs/constrainable_element" + }, + "time": { + "$ref": "#/$defs/datetime_element" + } + } + }, + "else": true + }, + { + "if": { + "properties": { + "type": { + "value": "electronic_record" + } + } + }, + "then": { + "properties": { + "check_details": { + "$ref": "#/$defs/check_details" + }, + "record": { + "type": "object", + "properties": { + "type": { + "$ref": "#/$defs/constrainable_element" + }, + "created_at": { + "$ref": "#/$defs/datetime_element" + }, + "date_of_expiry": { + "$ref": "#/$defs/datetime_element" + }, + "derived_claims": { + "$ref": "#/$defs/claims_element" + }, + "source": { + "type": "object", + "properties": { + "country": { + "$ref": "#/$defs/simple_element" + }, + "country_code": { + "$ref": "#/$defs/simple_element" + }, + "formatted": { + "$ref": "#/$defs/simple_element" + }, + "locality": { + "$ref": "#/$defs/simple_element" + }, + "name": { + "$ref": "#/$defs/simple_element" + }, + "postal_code": { + "$ref": "#/$defs/simple_element" + }, + "region": { + "$ref": "#/$defs/simple_element" + }, + "street_address": { + "$ref": "#/$defs/simple_element" + } + } + } + } + }, + "time": { + "$ref": "#/$defs/datetime_element" + } + } + }, + "else": true + }, + { + "if": { + "properties": { + "type": { + "value": "vouch" + } + } + }, + "then": { + "properties": { + "attestation": { + "type": "object", + "properties": { + "type": { + "$ref": "#/$defs/constrainable_element" + }, + "date_of_expiry": { + "$ref": "#/$defs/datetime_element" + }, + "date_of_issuance": { + "$ref": "#/$defs/datetime_element" + }, + "derived_claims": { + "$ref": "#/$defs/claims_element" + }, + "reference_number": { + "$ref": "#/$defs/simple_element" + }, + "voucher": { + "type": "object", + "properties": { + "birthdate": { + "$ref": "#/$defs/datetime_element" + }, + "country": { + "$ref": "#/$defs/simple_element" + }, + "formatted": { + "$ref": "#/$defs/simple_element" + }, + "locality": { + "$ref": "#/$defs/simple_element" + }, + "name": { + "$ref": "#/$defs/simple_element" + }, + "occupation": { + "$ref": "#/$defs/simple_element" + }, + "organization": { + "$ref": "#/$defs/simple_element" + }, + "postal_code": { + "$ref": "#/$defs/simple_element" + }, + "region": { + "$ref": "#/$defs/simple_element" + }, + "street_address": { + "$ref": "#/$defs/simple_element" + } + } + } + } + }, + "check_details": { + "$ref": "#/$defs/check_details" + }, + "time": { + "$ref": "#/$defs/datetime_element" + } + } + }, + "else": true + } + ] + }, + "simple_element": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object", + "properties": { + "essential": { + "type": "boolean" + }, + "purpose": { + "type": "string", + "maxLength": 300, + "minLength": 3 + } + } + } + ] + }, + "verified_claims": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/$defs/verified_claims_def" + } + ] + } + }, + { + "$ref": "#/$defs/verified_claims_def" + } + ] + }, + "verified_claims_def": { + "type": "object", + "required": [ + "verification", + "claims" + ], + "additionalProperties": false, + "properties": { + "claims": { + "$ref": "#/$defs/claims_element" + }, + "verification": { + "type": "object", + "required": [ + "trust_framework" + ], + "additionalProperties": true, + "properties": { + "assurance_level": { + "$ref": "#/$defs/constrainable_element" + }, + "assurance_process": { + "type": "object", + "properties": { + "assurance_details": { + "type": "array", + "items": { + "oneOf": [ + { + "assurance_classification": { + "$ref": "#/$defs/constrainable_element" + }, + "assurance_type": { + "$ref": "#/$defs/constrainable_element" + }, + "evidence_ref": { + "type": "object", + "required": [ + "txn" + ], + "additionalProperties": true, + "properties": { + "evidence_classification": { + "$ref": "#/$defs/constrainable_element" + }, + "evidence_metadata": { + "$ref": "#/$defs/constrainable_element" + }, + "txn": { + "$ref": "#/$defs/constrainable_element" + } + } + } + } + ] + }, + "minItems": 1 + }, + "policy": { + "$ref": "#/$defs/constrainable_element" + }, + "procedure": { + "$ref": "#/$defs/constrainable_element" + } + } + }, + "evidence": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/$defs/evidence" + } + ] + }, + "minItems": 1 + }, + "time": { + "$ref": "#/$defs/datetime_element" + }, + "trust_framework": { + "$ref": "#/$defs/constrainable_element" + }, + "verification_process": { + "$ref": "#/$defs/simple_element" + } + } + } + } + } + }, + "properties": { + "id_token": { + "type": "object", + "additionalProperties": true, + "properties": { + "verified_claims": { + "$ref": "#/$defs/verified_claims" + } + } + }, + "userinfo": { + "type": "object", + "additionalProperties": true, + "properties": { + "verified_claims": { + "$ref": "#/$defs/verified_claims" + } + } + } + } +} \ No newline at end of file diff --git a/esignet-service/pom.xml b/esignet-service/pom.xml index 7ed5cee60..d6ebbcb35 100644 --- a/esignet-service/pom.xml +++ b/esignet-service/pom.xml @@ -21,7 +21,6 @@ 11 2.9.5 2.9.8 - 2.12.0 2.12.0 2.12.0 diff --git a/esignet-service/src/main/resources/application-default.properties b/esignet-service/src/main/resources/application-default.properties index ed7004346..8c5361ede 100644 --- a/esignet-service/src/main/resources/application-default.properties +++ b/esignet-service/src/main/resources/application-default.properties @@ -69,6 +69,8 @@ mosip.esignet.captcha.site-key=${esignet.captcha.site.key} mosip.esignet.signup-id-token-expire-seconds=1800 mosip.esignet.signup-id-token-audience=mosip-signup-oauth-client +mosip.esignet.claims.schema.url=classpath:/verified_claims_request_schema.json + ## ------------------------------------------ e-Signet binding --------------------------------------------------------- mosip.esignet.binding.salt-length=16 mosip.esignet.binding.audience-id=esignet-binding diff --git a/esignet-service/src/main/resources/application-local.properties b/esignet-service/src/main/resources/application-local.properties index 802a3a338..52c9830d8 100644 --- a/esignet-service/src/main/resources/application-local.properties +++ b/esignet-service/src/main/resources/application-local.properties @@ -74,6 +74,9 @@ mosip.esignet.captcha.site-key=test-site-key mosip.esignet.signup-id-token-expire-seconds=1800 mosip.esignet.signup-id-token-audience=mosip-signup-oauth-client +mosip.esignet.host=localhost +mosip.esignet.claims.schema.url=classpath:/verified_claims_request_schema.json + ## ------------------------------------------ e-Signet binding --------------------------------------------------------- mosip.esignet.binding.salt-length=16 mosip.esignet.binding.audience-id=esignet-binding diff --git a/esignet-service/src/main/resources/verified_claims_request_schema.json b/esignet-service/src/main/resources/verified_claims_request_schema.json new file mode 100644 index 000000000..c0a504aaa --- /dev/null +++ b/esignet-service/src/main/resources/verified_claims_request_schema.json @@ -0,0 +1,542 @@ +{ + "$id": "https://bitbucket.org/openid/ekyc-ida/raw/master/schema/verified_claims_request.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$defs": { + "check_details": { + "type": "array", + "prefixItems": [ + { + "check_id": { + "type": "string" + }, + "check_method": { + "type": "string" + }, + "organization": { + "type": "string" + }, + "time": { + "$ref": "#/$defs/datetime_element" + } + } + ] + }, + "claims_element": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "object", + "properties": { + "essential": { + "type": "boolean" + }, + "purpose": { + "type": "string", + "maxLength": 300, + "minLength": 3 + }, + "value":{ + "type": "string", + "minLength": 3 + }, + "values": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + } + } + ] + }, + "minProperties": 1 + } + ] + }, + "constrainable_element": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object", + "properties": { + "essential": { + "type": "boolean" + }, + "purpose": { + "type": "string", + "maxLength": 300, + "minLength": 3 + }, + "value": { + "type": "string" + }, + "values": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + } + } + ] + }, + "datetime_element": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object", + "properties": { + "essential": { + "type": "boolean" + }, + "max_age": { + "type": "integer", + "minimum": 0 + }, + "purpose": { + "type": "string", + "maxLength": 300, + "minLength": 3 + } + } + } + ] + }, + "document_details": { + "type": "object", + "properties": { + "type": { + "$ref": "#/$defs/constrainable_element" + }, + "date_of_expiry": { + "$ref": "#/$defs/datetime_element" + }, + "date_of_issuance": { + "$ref": "#/$defs/datetime_element" + }, + "document_number": { + "$ref": "#/$defs/simple_element" + }, + "issuer": { + "type": "object", + "properties": { + "country": { + "$ref": "#/$defs/simple_element" + }, + "country_code": { + "$ref": "#/$defs/simple_element" + }, + "formatted": { + "$ref": "#/$defs/simple_element" + }, + "jurisdiction": { + "$ref": "#/$defs/simple_element" + }, + "locality": { + "$ref": "#/$defs/simple_element" + }, + "name": { + "$ref": "#/$defs/simple_element" + }, + "postal_code": { + "$ref": "#/$defs/simple_element" + }, + "region": { + "$ref": "#/$defs/simple_element" + }, + "street_address": { + "$ref": "#/$defs/simple_element" + } + } + }, + "personal_number": { + "$ref": "#/$defs/simple_element" + }, + "serial_number": { + "$ref": "#/$defs/simple_element" + } + } + }, + "evidence": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "object", + "properties": { + "value": { + "enum": [ + "document", + "electronic_record", + "vouch", + "electronic_signature" + ] + } + } + }, + "attachments": { + "$ref": "#/$defs/simple_element" + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "value": "electronic_signature" + } + } + }, + "then": { + "properties": { + "created_at": { + "$ref": "#/$defs/datetime_element" + }, + "issuer": { + "$ref": "#/$defs/simple_element" + }, + "serial_number": { + "$ref": "#/$defs/simple_element" + }, + "signature_type": { + "$ref": "#/$defs/simple_element" + } + } + }, + "else": true + }, + { + "if": { + "properties": { + "type": { + "value": "document" + } + } + }, + "then": { + "properties": { + "check_details": { + "$ref": "#/$defs/check_details" + }, + "document_details": { + "$ref": "#/$defs/document_details" + }, + "method": { + "$ref": "#/$defs/constrainable_element" + }, + "time": { + "$ref": "#/$defs/datetime_element" + } + } + }, + "else": true + }, + { + "if": { + "properties": { + "type": { + "value": "electronic_record" + } + } + }, + "then": { + "properties": { + "check_details": { + "$ref": "#/$defs/check_details" + }, + "record": { + "type": "object", + "properties": { + "type": { + "$ref": "#/$defs/constrainable_element" + }, + "created_at": { + "$ref": "#/$defs/datetime_element" + }, + "date_of_expiry": { + "$ref": "#/$defs/datetime_element" + }, + "derived_claims": { + "$ref": "#/$defs/claims_element" + }, + "source": { + "type": "object", + "properties": { + "country": { + "$ref": "#/$defs/simple_element" + }, + "country_code": { + "$ref": "#/$defs/simple_element" + }, + "formatted": { + "$ref": "#/$defs/simple_element" + }, + "locality": { + "$ref": "#/$defs/simple_element" + }, + "name": { + "$ref": "#/$defs/simple_element" + }, + "postal_code": { + "$ref": "#/$defs/simple_element" + }, + "region": { + "$ref": "#/$defs/simple_element" + }, + "street_address": { + "$ref": "#/$defs/simple_element" + } + } + } + } + }, + "time": { + "$ref": "#/$defs/datetime_element" + } + } + }, + "else": true + }, + { + "if": { + "properties": { + "type": { + "value": "vouch" + } + } + }, + "then": { + "properties": { + "attestation": { + "type": "object", + "properties": { + "type": { + "$ref": "#/$defs/constrainable_element" + }, + "date_of_expiry": { + "$ref": "#/$defs/datetime_element" + }, + "date_of_issuance": { + "$ref": "#/$defs/datetime_element" + }, + "derived_claims": { + "$ref": "#/$defs/claims_element" + }, + "reference_number": { + "$ref": "#/$defs/simple_element" + }, + "voucher": { + "type": "object", + "properties": { + "birthdate": { + "$ref": "#/$defs/datetime_element" + }, + "country": { + "$ref": "#/$defs/simple_element" + }, + "formatted": { + "$ref": "#/$defs/simple_element" + }, + "locality": { + "$ref": "#/$defs/simple_element" + }, + "name": { + "$ref": "#/$defs/simple_element" + }, + "occupation": { + "$ref": "#/$defs/simple_element" + }, + "organization": { + "$ref": "#/$defs/simple_element" + }, + "postal_code": { + "$ref": "#/$defs/simple_element" + }, + "region": { + "$ref": "#/$defs/simple_element" + }, + "street_address": { + "$ref": "#/$defs/simple_element" + } + } + } + } + }, + "check_details": { + "$ref": "#/$defs/check_details" + }, + "time": { + "$ref": "#/$defs/datetime_element" + } + } + }, + "else": true + } + ] + }, + "simple_element": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object", + "properties": { + "essential": { + "type": "boolean" + }, + "purpose": { + "type": "string", + "maxLength": 300, + "minLength": 3 + } + } + } + ] + }, + "verified_claims": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/$defs/verified_claims_def" + } + ] + } + }, + { + "$ref": "#/$defs/verified_claims_def" + } + ] + }, + "verified_claims_def": { + "type": "object", + "required": [ + "verification", + "claims" + ], + "additionalProperties": false, + "properties": { + "claims": { + "$ref": "#/$defs/claims_element" + }, + "verification": { + "type": "object", + "required": [ + "trust_framework" + ], + "additionalProperties": true, + "properties": { + "assurance_level": { + "$ref": "#/$defs/constrainable_element" + }, + "assurance_process": { + "type": "object", + "properties": { + "assurance_details": { + "type": "array", + "items": { + "oneOf": [ + { + "assurance_classification": { + "$ref": "#/$defs/constrainable_element" + }, + "assurance_type": { + "$ref": "#/$defs/constrainable_element" + }, + "evidence_ref": { + "type": "object", + "required": [ + "txn" + ], + "additionalProperties": true, + "properties": { + "evidence_classification": { + "$ref": "#/$defs/constrainable_element" + }, + "evidence_metadata": { + "$ref": "#/$defs/constrainable_element" + }, + "txn": { + "$ref": "#/$defs/constrainable_element" + } + } + } + } + ] + }, + "minItems": 1 + }, + "policy": { + "$ref": "#/$defs/constrainable_element" + }, + "procedure": { + "$ref": "#/$defs/constrainable_element" + } + } + }, + "evidence": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/$defs/evidence" + } + ] + }, + "minItems": 1 + }, + "time": { + "$ref": "#/$defs/datetime_element" + }, + "trust_framework": { + "$ref": "#/$defs/constrainable_element" + }, + "verification_process": { + "$ref": "#/$defs/simple_element" + } + } + } + } + } + }, + "properties": { + "id_token": { + "type": "object", + "additionalProperties": true, + "properties": { + "verified_claims": { + "$ref": "#/$defs/verified_claims" + } + } + }, + "userinfo": { + "type": "object", + "additionalProperties": true, + "properties": { + "verified_claims": { + "$ref": "#/$defs/verified_claims" + } + } + } + } +} \ No newline at end of file diff --git a/esignet-service/src/test/java/io/mosip/esignet/controllers/AuthorizationControllerTest.java b/esignet-service/src/test/java/io/mosip/esignet/controllers/AuthorizationControllerTest.java index 8453bcd6d..24005d003 100644 --- a/esignet-service/src/test/java/io/mosip/esignet/controllers/AuthorizationControllerTest.java +++ b/esignet-service/src/test/java/io/mosip/esignet/controllers/AuthorizationControllerTest.java @@ -5,8 +5,12 @@ */ package io.mosip.esignet.controllers; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import io.mosip.esignet.api.dto.AuthChallenge; +import io.mosip.esignet.api.dto.claim.ClaimDetail; +import io.mosip.esignet.api.dto.claim.ClaimsV2; import io.mosip.esignet.api.spi.AuditPlugin; import io.mosip.esignet.api.util.ConsentAction; import io.mosip.esignet.core.config.LocalAuthenticationEntryPoint; @@ -27,12 +31,15 @@ import org.junit.runner.RunWith; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.mock.mockito.MockBean; + import org.springframework.http.MediaType; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; +import org.springframework.web.client.RestTemplate; import java.time.ZoneOffset; import java.time.ZonedDateTime; @@ -73,18 +80,52 @@ public class AuthorizationControllerTest { @MockBean CacheUtilService cacheUtilService; + + @MockBean + RestTemplate restTemplate; + @MockBean LocalAuthenticationEntryPoint localAuthenticationEntryPoint; + + @Value("${mosip.esignet.claims.schema.url}") + private String schemaUrl; + ObjectMapper objectMapper = new ObjectMapper(); + ClaimDetail claimDetail; + + ClaimsV2 claimsV2; + + + @Before - public void init() throws EsignetException { + public void init() throws EsignetException, JsonProcessingException { HashSet acrValues = new HashSet<>(); acrValues.add("mosip:idp:acr:static-code"); acrValues.add("mosip:idp:acr:biometrics"); acrValues.add("mosip:idp:acr:linked-wallet"); when(authenticationContextClassRefUtil.getSupportedACRValues()).thenReturn(acrValues); + + String address="{\"essential\":true}"; + String verifiedClaims="[{\"verification\":{\"trust_framework\":{\"value\":\"pwd\"}},\"claims\":{\"name\":null,\"email\":{\"essential\":1}}},{\"verification\":{\"trust_framework\":{\"value\":\"pwd\"}},\"claims\":{\"birthdate\":{\"essential\":true},\"address\":null}},{\"verification\":{\"trust_framework\":{\"value\":\"kaif\"}},\"claims\":{\"gender\":{\"essential\":true},\"email\":{\"essential\":true}}}]"; + + JsonNode addressNode = objectMapper.readValue(address, JsonNode.class); + JsonNode verifiedClaimNode = objectMapper.readValue(verifiedClaims, JsonNode.class); + + Map userinfoMap = new HashMap<>(); + userinfoMap.put("address", addressNode); + userinfoMap.put("verified_claims", verifiedClaimNode); + Map idTokenMap = new HashMap<>(); + + + claimDetail = new ClaimDetail("claim_value", null, true, "secondary"); + + idTokenMap.put("some_claim", claimDetail); + ClaimsV2 claimsV2 = new ClaimsV2(); + claimsV2.setUserinfo(userinfoMap); + claimsV2.setId_token(idTokenMap); + } @@ -125,6 +166,7 @@ public void getOauthDetails_withInvalidRedirectUri_returnErrorResponse() throws oauthDetailRequest.setPrompt("login"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -149,11 +191,13 @@ public void getOauthDetails_withInvalidAcr_returnSuccessResponse() throws Except oauthDetailRequest.setPrompt("login"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); wrapper.setRequest(oauthDetailRequest); + OAuthDetailResponseV1 oauthDetailResponse = new OAuthDetailResponseV1(); oauthDetailResponse.setTransactionId("qwertyId"); when(authorizationService.getOauthDetails(oauthDetailRequest)).thenReturn(oauthDetailResponse); @@ -176,6 +220,7 @@ public void getOauthDetails_withInvalidDisplay_returnErrorResponse() throws Exce oauthDetailRequest.setPrompt("login"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -200,6 +245,7 @@ public void getOauthDetails_withInvalidPrompt_returnErrorResponse() throws Excep oauthDetailRequest.setPrompt("touch"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -224,6 +270,7 @@ public void getOauthDetails_withInvalidResponseType_returnErrorResponse() throws oauthDetailRequest.setPrompt("none"); oauthDetailRequest.setResponseType("implicit"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -248,6 +295,7 @@ public void getOauthDetails_withOnlyOpenIdScope_returnSuccessResponse() throws E oauthDetailRequest.setPrompt("login"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -275,6 +323,7 @@ public void getOauthDetails_withOutOpenIdScope_returnSuccessResponse() throws Ex oauthDetailRequest.setPrompt("login"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -299,6 +348,7 @@ public void getOauthDetails_withOpenIdScope_returnSuccessResponse() throws Excep oauthDetailRequest.setPrompt("login"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -326,6 +376,7 @@ public void getOauthDetails_withOnlyAuthorizeScope_returnSuccessResponse() throw oauthDetailRequest.setPrompt("login"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -353,6 +404,7 @@ public void getOauthDetails_withAuthorizeAndOpenIdScope_returnSuccessResponse() oauthDetailRequest.setPrompt("login"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -396,6 +448,7 @@ public void getOauthDetailsV2_withInvalidTimestamp_returnErrorResponse() throws oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); requestTime = requestTime.plusMinutes(10); @@ -430,6 +483,7 @@ public void getOauthDetailsV2_withInvalidRedirectUri_returnErrorResponse() throw oauthDetailRequest.setPrompt("login"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -461,6 +515,7 @@ public void getOauthDetailsV2_withInvalidAcr_returnSuccessResponse() throws Exce oauthDetailRequest.setPrompt("login"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -496,6 +551,7 @@ public void getOauthDetailsV2_withInvalidChallengeCode_returnErrorResponse() thr oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); oauthDetailRequest.setCodeChallenge("123"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -529,6 +585,7 @@ public void getOauthDetailsV2_withUnsupportedChallengeCodeMethod_returnErrorResp oauthDetailRequest.setNonce("23424234TY"); oauthDetailRequest.setCodeChallenge("123"); oauthDetailRequest.setCodeChallengeMethod("S123"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -561,6 +618,7 @@ public void getOauthDetailsV2_withInvalidDisplay_returnErrorResponse() throws Ex oauthDetailRequest.setPrompt("login"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -592,6 +650,7 @@ public void getOauthDetailsV2_withInvalidPrompt_returnErrorResponse() throws Exc oauthDetailRequest.setPrompt("touch"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -623,6 +682,7 @@ public void getOauthDetailsV2_withInvalidResponseType_returnErrorResponse() thro oauthDetailRequest.setPrompt("none"); oauthDetailRequest.setResponseType("implicit"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -654,6 +714,7 @@ public void getOauthDetailsV2_withOnlyOpenIdScope_returnSuccessResponse() throws oauthDetailRequest.setPrompt("login"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -688,6 +749,7 @@ public void getOauthDetailsV2_withOutOpenIdScope_returnErrorResponse() throws Ex oauthDetailRequest.setPrompt("login"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -719,6 +781,7 @@ public void getOauthDetailsV2_withOpenIdScope_returnSuccessResponse() throws Exc oauthDetailRequest.setPrompt("login"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -753,6 +816,7 @@ public void getOauthDetailsV2_withOnlyAuthorizeScope_returnSuccessResponse() thr oauthDetailRequest.setPrompt("login"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); @@ -787,6 +851,7 @@ public void getOauthDetailsV2_withAuthorizeAndOpenIdScope_returnSuccessResponse( oauthDetailRequest.setPrompt("login"); oauthDetailRequest.setResponseType("code"); oauthDetailRequest.setNonce("23424234TY"); + oauthDetailRequest.setClaims(claimsV2); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); RequestWrapper wrapper = new RequestWrapper<>(); wrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); diff --git a/esignet-service/src/test/java/io/mosip/esignet/flows/AuthCodeFlowTest.java b/esignet-service/src/test/java/io/mosip/esignet/flows/AuthCodeFlowTest.java index 3e7a2e77e..8e8975cea 100644 --- a/esignet-service/src/test/java/io/mosip/esignet/flows/AuthCodeFlowTest.java +++ b/esignet-service/src/test/java/io/mosip/esignet/flows/AuthCodeFlowTest.java @@ -21,8 +21,6 @@ import io.mosip.esignet.TestUtil; import io.mosip.esignet.api.dto.AuthChallenge; import io.mosip.esignet.api.dto.claim.ClaimDetail; -import io.mosip.esignet.api.dto.claim.Claims; -import io.mosip.esignet.api.dto.KycAuthDto; import io.mosip.esignet.api.dto.claim.ClaimsV2; import io.mosip.esignet.api.spi.AuditPlugin; import io.mosip.esignet.api.spi.Authenticator; @@ -40,11 +38,15 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; @@ -63,6 +65,8 @@ import java.util.Map; import static io.mosip.esignet.core.constants.Constants.UTC_DATETIME_PATTERN; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; @@ -97,9 +101,6 @@ public class AuthCodeFlowTest { @Autowired private AuthenticationContextClassRefUtil authenticationContextClassRefUtil; - @Autowired - RestTemplate restTemplate; - @Autowired AuditPlugin auditWrapper; @@ -298,6 +299,7 @@ private ResponseWrapper getOauthDetails(String clientId, oAuthDetailRequest.setState(state); ClaimsV2 claims = new ClaimsV2(); claims.setUserinfo(new HashMap<>()); + claims.setId_token(new HashMap<>()); claims.getUserinfo().put("email", getClaimDetail(null, null, true)); oAuthDetailRequest.setClaims(claims); @@ -305,6 +307,27 @@ private ResponseWrapper getOauthDetails(String clientId, request.setRequestTime(ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); request.setRequest(oAuthDetailRequest); + + String address="{\"essential\":true}"; + String verifiedClaims="[{\"verification\":{\"trust_framework\":{\"value\":null}},\"claims\":{\"name\":null,\"email\":{\"essential\":true}}},{\"verification\":{\"trust_framework\":{\"value\":\"pwd\"}},\"claims\":{\"birthdate\":{\"essential\":true},\"address\":null}},{\"verification\":{\"trust_framework\":{\"value\":\"kaif\"}},\"claims\":{\"gender\":{\"essential\":true},\"email\":{\"essential\":true}}}]"; + + JsonNode addressNode = objectMapper.readValue(address, JsonNode.class); + JsonNode verifiedClaimNode = objectMapper.readValue(verifiedClaims, JsonNode.class); + + Map userinfoMap = new HashMap<>(); + userinfoMap.put("address", addressNode); + userinfoMap.put("verified_claims", verifiedClaimNode); + Map idTokenMap = new HashMap<>(); + + + ClaimDetail claimDetail = new ClaimDetail("claim_value", null, true, "secondary"); + + idTokenMap.put("some_claim", claimDetail); + ClaimsV2 claimsV2 = new ClaimsV2(); + claimsV2.setUserinfo(userinfoMap); + claimsV2.setId_token(idTokenMap); + + MvcResult result = mockMvc.perform(post("/authorization/oauth-details") .contentType(MediaType.APPLICATION_JSON_UTF8) .content(objectMapper.writeValueAsString(request))) diff --git a/esignet-service/src/test/java/io/mosip/esignet/flows/AuthorizationAPIFlowTest.java b/esignet-service/src/test/java/io/mosip/esignet/flows/AuthorizationAPIFlowTest.java index ce14626ad..2aff68eca 100644 --- a/esignet-service/src/test/java/io/mosip/esignet/flows/AuthorizationAPIFlowTest.java +++ b/esignet-service/src/test/java/io/mosip/esignet/flows/AuthorizationAPIFlowTest.java @@ -21,8 +21,6 @@ import com.nimbusds.jwt.SignedJWT; import io.mosip.esignet.api.dto.AuthChallenge; import io.mosip.esignet.api.dto.claim.ClaimDetail; -import io.mosip.esignet.api.dto.claim.Claims; -import io.mosip.esignet.api.dto.KycAuthDto; import io.mosip.esignet.api.dto.claim.ClaimsV2; import io.mosip.esignet.api.spi.AuditPlugin; import io.mosip.esignet.api.spi.Authenticator; @@ -39,13 +37,14 @@ import org.json.simple.JSONObject; import org.junit.*; import org.junit.runner.RunWith; +import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.http.MediaType; import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.client.MockRestServiceServer; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; @@ -61,10 +60,7 @@ import static io.mosip.esignet.api.util.ErrorConstants.AUTH_FAILED; import static io.mosip.esignet.core.constants.Constants.UTC_DATETIME_PATTERN; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; -import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @SpringBootTest @@ -436,6 +432,7 @@ private ResponseWrapper getOauthDetails(String clientId, oAuthDetailRequest.setState(state); ClaimsV2 claims = new ClaimsV2(); claims.setUserinfo(new HashMap<>()); + claims.setId_token(new HashMap<>()); claims.getUserinfo().put("email", getClaimDetail(null, null, true)); oAuthDetailRequest.setClaims(claims); @@ -443,6 +440,25 @@ private ResponseWrapper getOauthDetails(String clientId, request.setRequestTime(ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); request.setRequest(oAuthDetailRequest); + String address="{\"essential\":true}"; + String verifiedClaims="[{\"verification\":{\"trust_framework\":{\"value\":null}},\"claims\":{\"name\":null,\"email\":{\"essential\":true}}},{\"verification\":{\"trust_framework\":{\"value\":\"pwd\"}},\"claims\":{\"birthdate\":{\"essential\":true},\"address\":null}},{\"verification\":{\"trust_framework\":{\"value\":\"kaif\"}},\"claims\":{\"gender\":{\"essential\":true},\"email\":{\"essential\":true}}}]"; + + JsonNode addressNode = objectMapper.readValue(address, JsonNode.class); + JsonNode verifiedClaimNode = objectMapper.readValue(verifiedClaims, JsonNode.class); + + Map userinfoMap = new HashMap<>(); + userinfoMap.put("address", addressNode); + userinfoMap.put("verified_claims", verifiedClaimNode); + Map idTokenMap = new HashMap<>(); + + + ClaimDetail claimDetail = new ClaimDetail("claim_value", null, true, "secondary"); + + idTokenMap.put("some_claim", claimDetail); + ClaimsV2 claimsV2 = new ClaimsV2(); + claimsV2.setUserinfo(userinfoMap); + claimsV2.setId_token(idTokenMap); + MvcResult result = mockMvc.perform(post("/authorization/oauth-details") .param("nonce", nonce).param("state", state) .contentType(MediaType.APPLICATION_JSON_UTF8) diff --git a/esignet-service/src/test/resources/application-test.properties b/esignet-service/src/test/resources/application-test.properties index 10b401447..bb746f7b9 100644 --- a/esignet-service/src/test/resources/application-test.properties +++ b/esignet-service/src/test/resources/application-test.properties @@ -51,6 +51,9 @@ mosip.esignet.host=http://localhost:8088 mosip.esignet.signup-id-token-expire-seconds=180 mosip.esignet.signup-id-token-audience=mosip-signup-client + +mosip.esignet.claims.schema.url=classpath:/verified_claims_request_schema_test.json + ## ------------------------------------------ e-Signet binding --------------------------------------------------------- mosip.esignet.binding.salt-length=16 diff --git a/esignet-service/src/test/resources/verified_claims_request_schema_test.json b/esignet-service/src/test/resources/verified_claims_request_schema_test.json new file mode 100644 index 000000000..fa4590b1f --- /dev/null +++ b/esignet-service/src/test/resources/verified_claims_request_schema_test.json @@ -0,0 +1,531 @@ +{ + "$id": "https://bitbucket.org/openid/ekyc-ida/raw/master/schema/verified_claims_request.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$defs": { + "check_details": { + "type": "array", + "prefixItems": [ + { + "check_id": { + "type": "string" + }, + "check_method": { + "type": "string" + }, + "organization": { + "type": "string" + }, + "time": { + "$ref": "#/$defs/datetime_element" + } + } + ] + }, + "claims_element": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "object", + "properties": { + "essential": { + "type": "boolean" + }, + "purpose": { + "type": "string", + "maxLength": 300, + "minLength": 3 + } + } + } + ] + }, + "minProperties": 1 + } + ] + }, + "constrainable_element": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object", + "properties": { + "essential": { + "type": "boolean" + }, + "purpose": { + "type": "string", + "maxLength": 300, + "minLength": 3 + }, + "value": { + "type": "string" + }, + "values": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + } + } + ] + }, + "datetime_element": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object", + "properties": { + "essential": { + "type": "boolean" + }, + "max_age": { + "type": "integer", + "minimum": 0 + }, + "purpose": { + "type": "string", + "maxLength": 300, + "minLength": 3 + } + } + } + ] + }, + "document_details": { + "type": "object", + "properties": { + "type": { + "$ref": "#/$defs/constrainable_element" + }, + "date_of_expiry": { + "$ref": "#/$defs/datetime_element" + }, + "date_of_issuance": { + "$ref": "#/$defs/datetime_element" + }, + "document_number": { + "$ref": "#/$defs/simple_element" + }, + "issuer": { + "type": "object", + "properties": { + "country": { + "$ref": "#/$defs/simple_element" + }, + "country_code": { + "$ref": "#/$defs/simple_element" + }, + "formatted": { + "$ref": "#/$defs/simple_element" + }, + "jurisdiction": { + "$ref": "#/$defs/simple_element" + }, + "locality": { + "$ref": "#/$defs/simple_element" + }, + "name": { + "$ref": "#/$defs/simple_element" + }, + "postal_code": { + "$ref": "#/$defs/simple_element" + }, + "region": { + "$ref": "#/$defs/simple_element" + }, + "street_address": { + "$ref": "#/$defs/simple_element" + } + } + }, + "personal_number": { + "$ref": "#/$defs/simple_element" + }, + "serial_number": { + "$ref": "#/$defs/simple_element" + } + } + }, + "evidence": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "object", + "properties": { + "value": { + "enum": [ + "document", + "electronic_record", + "vouch", + "electronic_signature" + ] + } + } + }, + "attachments": { + "$ref": "#/$defs/simple_element" + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "value": "electronic_signature" + } + } + }, + "then": { + "properties": { + "created_at": { + "$ref": "#/$defs/datetime_element" + }, + "issuer": { + "$ref": "#/$defs/simple_element" + }, + "serial_number": { + "$ref": "#/$defs/simple_element" + }, + "signature_type": { + "$ref": "#/$defs/simple_element" + } + } + }, + "else": true + }, + { + "if": { + "properties": { + "type": { + "value": "document" + } + } + }, + "then": { + "properties": { + "check_details": { + "$ref": "#/$defs/check_details" + }, + "document_details": { + "$ref": "#/$defs/document_details" + }, + "method": { + "$ref": "#/$defs/constrainable_element" + }, + "time": { + "$ref": "#/$defs/datetime_element" + } + } + }, + "else": true + }, + { + "if": { + "properties": { + "type": { + "value": "electronic_record" + } + } + }, + "then": { + "properties": { + "check_details": { + "$ref": "#/$defs/check_details" + }, + "record": { + "type": "object", + "properties": { + "type": { + "$ref": "#/$defs/constrainable_element" + }, + "created_at": { + "$ref": "#/$defs/datetime_element" + }, + "date_of_expiry": { + "$ref": "#/$defs/datetime_element" + }, + "derived_claims": { + "$ref": "#/$defs/claims_element" + }, + "source": { + "type": "object", + "properties": { + "country": { + "$ref": "#/$defs/simple_element" + }, + "country_code": { + "$ref": "#/$defs/simple_element" + }, + "formatted": { + "$ref": "#/$defs/simple_element" + }, + "locality": { + "$ref": "#/$defs/simple_element" + }, + "name": { + "$ref": "#/$defs/simple_element" + }, + "postal_code": { + "$ref": "#/$defs/simple_element" + }, + "region": { + "$ref": "#/$defs/simple_element" + }, + "street_address": { + "$ref": "#/$defs/simple_element" + } + } + } + } + }, + "time": { + "$ref": "#/$defs/datetime_element" + } + } + }, + "else": true + }, + { + "if": { + "properties": { + "type": { + "value": "vouch" + } + } + }, + "then": { + "properties": { + "attestation": { + "type": "object", + "properties": { + "type": { + "$ref": "#/$defs/constrainable_element" + }, + "date_of_expiry": { + "$ref": "#/$defs/datetime_element" + }, + "date_of_issuance": { + "$ref": "#/$defs/datetime_element" + }, + "derived_claims": { + "$ref": "#/$defs/claims_element" + }, + "reference_number": { + "$ref": "#/$defs/simple_element" + }, + "voucher": { + "type": "object", + "properties": { + "birthdate": { + "$ref": "#/$defs/datetime_element" + }, + "country": { + "$ref": "#/$defs/simple_element" + }, + "formatted": { + "$ref": "#/$defs/simple_element" + }, + "locality": { + "$ref": "#/$defs/simple_element" + }, + "name": { + "$ref": "#/$defs/simple_element" + }, + "occupation": { + "$ref": "#/$defs/simple_element" + }, + "organization": { + "$ref": "#/$defs/simple_element" + }, + "postal_code": { + "$ref": "#/$defs/simple_element" + }, + "region": { + "$ref": "#/$defs/simple_element" + }, + "street_address": { + "$ref": "#/$defs/simple_element" + } + } + } + } + }, + "check_details": { + "$ref": "#/$defs/check_details" + }, + "time": { + "$ref": "#/$defs/datetime_element" + } + } + }, + "else": true + } + ] + }, + "simple_element": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object", + "properties": { + "essential": { + "type": "boolean" + }, + "purpose": { + "type": "string", + "maxLength": 300, + "minLength": 3 + } + } + } + ] + }, + "verified_claims": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/$defs/verified_claims_def" + } + ] + } + }, + { + "$ref": "#/$defs/verified_claims_def" + } + ] + }, + "verified_claims_def": { + "type": "object", + "required": [ + "verification", + "claims" + ], + "additionalProperties": false, + "properties": { + "claims": { + "$ref": "#/$defs/claims_element" + }, + "verification": { + "type": "object", + "required": [ + "trust_framework" + ], + "additionalProperties": true, + "properties": { + "assurance_level": { + "$ref": "#/$defs/constrainable_element" + }, + "assurance_process": { + "type": "object", + "properties": { + "assurance_details": { + "type": "array", + "items": { + "oneOf": [ + { + "assurance_classification": { + "$ref": "#/$defs/constrainable_element" + }, + "assurance_type": { + "$ref": "#/$defs/constrainable_element" + }, + "evidence_ref": { + "type": "object", + "required": [ + "txn" + ], + "additionalProperties": true, + "properties": { + "evidence_classification": { + "$ref": "#/$defs/constrainable_element" + }, + "evidence_metadata": { + "$ref": "#/$defs/constrainable_element" + }, + "txn": { + "$ref": "#/$defs/constrainable_element" + } + } + } + } + ] + }, + "minItems": 1 + }, + "policy": { + "$ref": "#/$defs/constrainable_element" + }, + "procedure": { + "$ref": "#/$defs/constrainable_element" + } + } + }, + "evidence": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/$defs/evidence" + } + ] + }, + "minItems": 1 + }, + "time": { + "$ref": "#/$defs/datetime_element" + }, + "trust_framework": { + "$ref": "#/$defs/constrainable_element" + }, + "verification_process": { + "$ref": "#/$defs/simple_element" + } + } + } + } + } + }, + "properties": { + "id_token": { + "type": "object", + "additionalProperties": true, + "properties": { + "verified_claims": { + "$ref": "#/$defs/verified_claims" + } + } + }, + "userinfo": { + "type": "object", + "additionalProperties": true, + "properties": { + "verified_claims": { + "$ref": "#/$defs/verified_claims" + } + } + } + } +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index ffbac7975..ed686c59d 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ 3.7.0.1746 3.2.0 2.3 - + 2.15.0 Hoxton.SR8 2.3.6.RELEASE @@ -209,6 +209,26 @@ + + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.databind} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.databind} + + + com.fasterxml.jackson.core + jackson-core + ${jackson.databind} + + + + From 94ae343a3012b07920a4bac971c3638518ce15e9 Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Wed, 30 Oct 2024 16:06:25 +0530 Subject: [PATCH 20/33] ES-1425 Signed-off-by: Nandhukumar --- .../testrunner/MosipTestRunner.java | 13 +- .../testscripts/AddIdentity.java | 8 +- .../testscripts/DeleteWithParam.java | 7 +- .../testscripts/EsignetBioAuth.java | 7 +- .../testscripts/GetWithParam.java | 7 +- .../testscripts/GetWithQueryParam.java | 6 +- .../{ => esignet}/testscripts/KycAuth.java | 7 +- .../PatchWithPathParamsAndBody.java | 6 +- .../PostWithAutogenIdWithOtpGenerate.java | 8 +- ...ostWithAutogenIdWithOtpGenerateForWla.java | 7 +- .../PostWithBodyAndPathParams.java | 6 +- ...ostWithBodyAndQueryParamsForAutoGenId.java | 6 +- .../PostWithBodyWithOtpGenerate.java | 7 +- .../testscripts/PostWithOnlyPathParam.java | 7 +- .../testscripts/PutWithPathParamsAndBody.java | 6 +- .../testscripts/SimplePatchForAutoGenId.java | 6 +- .../{ => esignet}/testscripts/SimplePost.java | 7 +- .../testscripts/SimplePostForAutoGenId.java | 7 +- .../SimplePostForAutoGenIdForUrlEncoded.java | 7 +- .../utils/EsignetConfigManager.java | 5 +- .../{ => esignet}/utils/EsignetUtil.java | 8 +- .../main/resources/config/esignet.properties | 6 +- .../OAuthDetailsRequest.yml | 4 +- .../esignetPrerequisiteSuite.xml | 40 +-- api-test/testNgXmlFiles/esignetSuite.xml | 242 +++++++++--------- 25 files changed, 219 insertions(+), 221 deletions(-) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testrunner/MosipTestRunner.java (95%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/AddIdentity.java (97%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/DeleteWithParam.java (96%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/EsignetBioAuth.java (97%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/GetWithParam.java (97%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/GetWithQueryParam.java (97%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/KycAuth.java (96%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/PatchWithPathParamsAndBody.java (96%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/PostWithAutogenIdWithOtpGenerate.java (97%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/PostWithAutogenIdWithOtpGenerateForWla.java (97%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/PostWithBodyAndPathParams.java (97%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/PostWithBodyAndQueryParamsForAutoGenId.java (97%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/PostWithBodyWithOtpGenerate.java (97%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/PostWithOnlyPathParam.java (96%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/PutWithPathParamsAndBody.java (97%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/SimplePatchForAutoGenId.java (96%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/SimplePost.java (97%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/SimplePostForAutoGenId.java (97%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/testscripts/SimplePostForAutoGenIdForUrlEncoded.java (97%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/utils/EsignetConfigManager.java (85%) rename api-test/src/main/java/io/mosip/testrig/apirig/{ => esignet}/utils/EsignetUtil.java (95%) diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testrunner/MosipTestRunner.java similarity index 95% rename from api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testrunner/MosipTestRunner.java index 2a767053e..3214d3b72 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testrunner/MosipTestRunner.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testrunner; +package io.mosip.testrig.apirig.esignet.testrunner; import java.io.File; import java.io.FileInputStream; @@ -25,13 +25,17 @@ import io.mosip.testrig.apirig.dataprovider.BiometricDataProvider; import io.mosip.testrig.apirig.dbaccess.DBManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.report.EmailableReport; +import io.mosip.testrig.apirig.testrunner.BaseTestCase; +import io.mosip.testrig.apirig.testrunner.ExtractResource; +import io.mosip.testrig.apirig.testrunner.HealthChecker; +import io.mosip.testrig.apirig.testrunner.OTPListener; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthTestsUtil; import io.mosip.testrig.apirig.utils.CertificateGenerationUtil; import io.mosip.testrig.apirig.utils.CertsUtil; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.JWKKeyUtil; import io.mosip.testrig.apirig.utils.KeyCloakUserAndAPIKeyGeneration; @@ -124,6 +128,9 @@ public static void main(String[] arg) { else startTestRunner(); } else { + BaseTestCase.isTargetEnvLatest = true; + BaseTestCase.languageList.add("eng"); + BaseTestCase.languageList.add("khm"); startTestRunner(); } diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/AddIdentity.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/AddIdentity.java similarity index 97% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/AddIdentity.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/AddIdentity.java index 7874d1b8f..40a542f45 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/AddIdentity.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/AddIdentity.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.text.DateFormat; @@ -26,12 +26,12 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.testrunner.JsonPrecondtion; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.GlobalMethods; import io.mosip.testrig.apirig.utils.KernelAuthentication; @@ -150,8 +150,6 @@ public void test(TestCaseDTO testCaseDTO) throws Exception { new KernelAuthentication().getTokenByRole(testCaseDTO.getRole())).asString(), "response.uin"); - testCaseName = isTestCaseValidForExecution(testCaseDTO); - DateFormat dateFormatter = new SimpleDateFormat("yyyyMMddHHmmss"); Calendar cal = Calendar.getInstance(); String timestampValue = dateFormatter.format(cal.getTime()); diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/DeleteWithParam.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DeleteWithParam.java similarity index 96% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/DeleteWithParam.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DeleteWithParam.java index 0515dfdc2..95d6bcdb4 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/DeleteWithParam.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DeleteWithParam.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.util.ArrayList; @@ -22,12 +22,12 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -79,7 +79,6 @@ public Object[] getTestCaseList(ITestContext context) { public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException { testCaseName = testCaseDTO.getTestCaseName(); testCaseName = EsignetUtil.isTestCaseValidForExecution(testCaseDTO); - testCaseName = isTestCaseValidForExecution(testCaseDTO); if (HealthChecker.signalTerminateExecution) { throw new SkipException( GlobalConstants.TARGET_ENV_HEALTH_CHECK_FAILED + HealthChecker.healthCheckFailureMapS); diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/EsignetBioAuth.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/EsignetBioAuth.java similarity index 97% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/EsignetBioAuth.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/EsignetBioAuth.java index ef38d7047..4803cdae3 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/EsignetBioAuth.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/EsignetBioAuth.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.util.Base64; @@ -23,14 +23,14 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.BaseTestCase; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; import io.mosip.testrig.apirig.utils.BioDataUtility; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -86,7 +86,6 @@ public Object[] getTestCaseList(ITestContext context) { public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException { testCaseName = testCaseDTO.getTestCaseName(); testCaseName = EsignetUtil.isTestCaseValidForExecution(testCaseDTO); - testCaseName = isTestCaseValidForExecution(testCaseDTO); if (HealthChecker.signalTerminateExecution) { throw new SkipException( GlobalConstants.TARGET_ENV_HEALTH_CHECK_FAILED + HealthChecker.healthCheckFailureMapS); diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/GetWithParam.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/GetWithParam.java similarity index 97% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/GetWithParam.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/GetWithParam.java index dee036c5b..ac84e5f50 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/GetWithParam.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/GetWithParam.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.util.ArrayList; @@ -23,13 +23,13 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.BaseTestCase; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -84,7 +84,6 @@ public Object[] getTestCaseList(ITestContext context) { public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException { testCaseName = testCaseDTO.getTestCaseName(); testCaseName = EsignetUtil.isTestCaseValidForExecution(testCaseDTO); - testCaseName = isTestCaseValidForExecution(testCaseDTO); if (HealthChecker.signalTerminateExecution) { throw new SkipException( GlobalConstants.TARGET_ENV_HEALTH_CHECK_FAILED + HealthChecker.healthCheckFailureMapS); diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/GetWithQueryParam.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/GetWithQueryParam.java similarity index 97% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/GetWithQueryParam.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/GetWithQueryParam.java index e1ed3861d..66758f04f 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/GetWithQueryParam.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/GetWithQueryParam.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.util.ArrayList; @@ -23,13 +23,13 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.BaseTestCase; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/KycAuth.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/KycAuth.java similarity index 96% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/KycAuth.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/KycAuth.java index b73ce3fbb..1b0bfafcd 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/KycAuth.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/KycAuth.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.util.HashMap; @@ -23,13 +23,13 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.BaseTestCase; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -101,7 +101,6 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad throw new SkipException(GlobalConstants.VID_FEATURE_NOT_SUPPORTED); } } - testCaseName = isTestCaseValidForExecution(testCaseDTO); JSONObject request = new JSONObject(testCaseDTO.getInput()); String kycAuthEndPoint = null; if (request.has(GlobalConstants.KYCAUTHENDPOINT)) { diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PatchWithPathParamsAndBody.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PatchWithPathParamsAndBody.java similarity index 96% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PatchWithPathParamsAndBody.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PatchWithPathParamsAndBody.java index ede73dd22..af8366809 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PatchWithPathParamsAndBody.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PatchWithPathParamsAndBody.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.util.List; @@ -20,13 +20,13 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.BaseTestCase; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerate.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithAutogenIdWithOtpGenerate.java similarity index 97% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerate.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithAutogenIdWithOtpGenerate.java index 53820d7bb..c953c2b45 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerate.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithAutogenIdWithOtpGenerate.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.util.List; @@ -22,13 +22,13 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.BaseTestCase; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -103,8 +103,6 @@ public void test(TestCaseDTO testCaseDTO) throw new SkipException(GlobalConstants.VID_FEATURE_NOT_SUPPORTED); } } - testCaseName = isTestCaseValidForExecution(testCaseDTO); - String inputJson = testCaseDTO.getInput().toString(); JSONObject req = new JSONObject(testCaseDTO.getInput()); diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerateForWla.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithAutogenIdWithOtpGenerateForWla.java similarity index 97% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerateForWla.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithAutogenIdWithOtpGenerateForWla.java index 5c5172a95..b368722fb 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerateForWla.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithAutogenIdWithOtpGenerateForWla.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.util.List; @@ -22,13 +22,13 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.BaseTestCase; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -93,7 +93,6 @@ public void test(TestCaseDTO testCaseDTO) throws AdminTestException { } } - testCaseName = isTestCaseValidForExecution(testCaseDTO); JSONObject req = new JSONObject(testCaseDTO.getInput()); String otpRequest = null; String sendOtpReqTemplate = null; diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithBodyAndPathParams.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithBodyAndPathParams.java similarity index 97% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithBodyAndPathParams.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithBodyAndPathParams.java index 86b27131d..0b49fd791 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithBodyAndPathParams.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithBodyAndPathParams.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.util.ArrayList; @@ -22,13 +22,13 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.BaseTestCase; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithBodyAndQueryParamsForAutoGenId.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithBodyAndQueryParamsForAutoGenId.java similarity index 97% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithBodyAndQueryParamsForAutoGenId.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithBodyAndQueryParamsForAutoGenId.java index 170d5bb22..49b6ce88f 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithBodyAndQueryParamsForAutoGenId.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithBodyAndQueryParamsForAutoGenId.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.util.HashMap; @@ -22,14 +22,14 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.BaseTestCase; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.PartnerTypes; diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithBodyWithOtpGenerate.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithBodyWithOtpGenerate.java similarity index 97% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithBodyWithOtpGenerate.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithBodyWithOtpGenerate.java index 1371671dd..7e893612c 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithBodyWithOtpGenerate.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithBodyWithOtpGenerate.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.util.List; @@ -21,13 +21,13 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.BaseTestCase; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -93,7 +93,6 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad } } - testCaseName = isTestCaseValidForExecution(testCaseDTO); auditLogCheck = testCaseDTO.isAuditLogCheck(); String tempUrl = EsignetConfigManager.getEsignetBaseUrl(); JSONObject req = new JSONObject(testCaseDTO.getInput()); diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithOnlyPathParam.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithOnlyPathParam.java similarity index 96% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithOnlyPathParam.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithOnlyPathParam.java index a462e3fe1..6df86180b 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithOnlyPathParam.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithOnlyPathParam.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.util.ArrayList; @@ -23,13 +23,13 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.BaseTestCase; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -83,7 +83,6 @@ public Object[] getTestCaseList(ITestContext context) { public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException { testCaseName = testCaseDTO.getTestCaseName(); testCaseName = EsignetUtil.isTestCaseValidForExecution(testCaseDTO); - testCaseName = isTestCaseValidForExecution(testCaseDTO); String[] templateFields = testCaseDTO.getTemplateFields(); if (HealthChecker.signalTerminateExecution) { throw new SkipException( diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PutWithPathParamsAndBody.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PutWithPathParamsAndBody.java similarity index 97% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PutWithPathParamsAndBody.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PutWithPathParamsAndBody.java index 72c2c22a6..745e04a96 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/PutWithPathParamsAndBody.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PutWithPathParamsAndBody.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.util.ArrayList; @@ -23,13 +23,13 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.BaseTestCase; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePatchForAutoGenId.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/SimplePatchForAutoGenId.java similarity index 96% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePatchForAutoGenId.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/SimplePatchForAutoGenId.java index 0d01f908d..ce34b11d3 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePatchForAutoGenId.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/SimplePatchForAutoGenId.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.util.ArrayList; @@ -22,13 +22,13 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.BaseTestCase; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePost.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/SimplePost.java similarity index 97% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePost.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/SimplePost.java index fa569a938..bff48b5ec 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePost.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/SimplePost.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.util.ArrayList; @@ -23,13 +23,13 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.BaseTestCase; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -84,7 +84,6 @@ public Object[] getTestCaseList(ITestContext context) { public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException { testCaseName = testCaseDTO.getTestCaseName(); testCaseName = EsignetUtil.isTestCaseValidForExecution(testCaseDTO); - testCaseName = isTestCaseValidForExecution(testCaseDTO); auditLogCheck = testCaseDTO.isAuditLogCheck(); String[] templateFields = testCaseDTO.getTemplateFields(); if (HealthChecker.signalTerminateExecution) { diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenId.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/SimplePostForAutoGenId.java similarity index 97% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenId.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/SimplePostForAutoGenId.java index 12303eef1..5db0bb6c9 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenId.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/SimplePostForAutoGenId.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.security.NoSuchAlgorithmException; @@ -24,13 +24,13 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.BaseTestCase; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -100,7 +100,6 @@ public void test(TestCaseDTO testCaseDTO) } } - testCaseName = isTestCaseValidForExecution(testCaseDTO); String[] templateFields = testCaseDTO.getTemplateFields(); String inputJson = ""; diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenIdForUrlEncoded.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/SimplePostForAutoGenIdForUrlEncoded.java similarity index 97% rename from api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenIdForUrlEncoded.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/SimplePostForAutoGenIdForUrlEncoded.java index 4409e3eb0..edcd3ad3b 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenIdForUrlEncoded.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/SimplePostForAutoGenIdForUrlEncoded.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.testscripts; +package io.mosip.testrig.apirig.esignet.testscripts; import java.lang.reflect.Field; import java.security.NoSuchAlgorithmException; @@ -23,13 +23,13 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager; +import io.mosip.testrig.apirig.esignet.utils.EsignetUtil; import io.mosip.testrig.apirig.testrunner.BaseTestCase; import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.EsignetConfigManager; -import io.mosip.testrig.apirig.utils.EsignetUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -111,7 +111,6 @@ public void test(TestCaseDTO testCaseDTO) if (EsignetConfigManager.isInServiceNotDeployedList(GlobalConstants.ESIGNET)) { throw new SkipException("esignet is not deployed hence skipping the testcase"); } - testCaseName = isTestCaseValidForExecution(testCaseDTO); String[] templateFields = testCaseDTO.getTemplateFields(); String inputJson = getJsonFromTemplate(testCaseDTO.getInput(), testCaseDTO.getInputTemplate()); diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/utils/EsignetConfigManager.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/utils/EsignetConfigManager.java similarity index 85% rename from api-test/src/main/java/io/mosip/testrig/apirig/utils/EsignetConfigManager.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/utils/EsignetConfigManager.java index dc42b2b61..a9ef10891 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/utils/EsignetConfigManager.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/utils/EsignetConfigManager.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.utils; +package io.mosip.testrig.apirig.esignet.utils; import java.util.HashMap; import java.util.Map; @@ -6,7 +6,8 @@ import org.apache.log4j.Logger; -import io.mosip.testrig.apirig.testrunner.MosipTestRunner; +import io.mosip.testrig.apirig.esignet.testrunner.MosipTestRunner; +import io.mosip.testrig.apirig.utils.ConfigManager; public class EsignetConfigManager extends ConfigManager{ private static final Logger LOGGER = Logger.getLogger(EsignetConfigManager.class); diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/utils/EsignetUtil.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/utils/EsignetUtil.java similarity index 95% rename from api-test/src/main/java/io/mosip/testrig/apirig/utils/EsignetUtil.java rename to api-test/src/main/java/io/mosip/testrig/apirig/esignet/utils/EsignetUtil.java index de6b2c186..16456c85f 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/utils/EsignetUtil.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/utils/EsignetUtil.java @@ -1,4 +1,4 @@ -package io.mosip.testrig.apirig.utils; +package io.mosip.testrig.apirig.esignet.utils; import java.util.Arrays; import java.util.HashMap; @@ -12,8 +12,12 @@ import org.testng.SkipException; import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.esignet.testrunner.MosipTestRunner; import io.mosip.testrig.apirig.testrunner.BaseTestCase; -import io.mosip.testrig.apirig.testrunner.MosipTestRunner; +import io.mosip.testrig.apirig.utils.AdminTestUtil; +import io.mosip.testrig.apirig.utils.GlobalConstants; +import io.mosip.testrig.apirig.utils.RestClient; +import io.mosip.testrig.apirig.utils.SkipTestCaseHandler; import io.restassured.response.Response; public class EsignetUtil extends AdminTestUtil { diff --git a/api-test/src/main/resources/config/esignet.properties b/api-test/src/main/resources/config/esignet.properties index b327f31d4..f6a148e45 100644 --- a/api-test/src/main/resources/config/esignet.properties +++ b/api-test/src/main/resources/config/esignet.properties @@ -4,11 +4,11 @@ tokenEndpoint=/v1/esignet/oauth/token validateBindingEndpoint=ida-binding esignetWellKnownEndPoint=/v1/esignet/oidc/.well-known/openid-configuration signupSettingsEndPoint=/v1/signup/settings -esignetActuatorPropertySection=esignet-default.properties +esignetActuatorPropertySection=application-default.properties # uncomment below property while executing on camdgc env locally -#servicesNotDeployed=resident,ridgenerator,admin,hotlist,preregistration,registrationprocessor,hub,print,packetcreator,packetmanager,mock-abis-service,mockmv,sunbirdrc +servicesNotDeployed=resident,ridgenerator,admin,hotlist,preregistration,registrationprocessor,hub,print,packetcreator,packetmanager,mock-abis-service,mockmv,sunbirdrc # uncomment below property while executing on non camdgc env locally -servicesNotDeployed= +#servicesNotDeployed= esignetMockBaseURL=esignet-insurance. sunBirdBaseURL=https://registry.dev1.mosip.net #Once sunbird registry is pointing to specific env, remove the above line and uncomment below line diff --git a/api-test/src/main/resources/esignet/OAuthDetailsRequestV3/OAuthDetailsRequest.yml b/api-test/src/main/resources/esignet/OAuthDetailsRequestV3/OAuthDetailsRequest.yml index a903f2a35..27414a68d 100644 --- a/api-test/src/main/resources/esignet/OAuthDetailsRequestV3/OAuthDetailsRequest.yml +++ b/api-test/src/main/resources/esignet/OAuthDetailsRequestV3/OAuthDetailsRequest.yml @@ -7,7 +7,7 @@ OAuthDetailsRequestV3: inputTemplate: esignet/OAuthDetailsRequestV3/OAuthDetailsRequest input: '{ "requestTime": "$TIMESTAMP$", - "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", "scope": "openid profile", "responseType": "code", "redirectUri": "$IDPREDIRECTURI$", @@ -31,7 +31,7 @@ OAuthDetailsRequestV3: inputTemplate: esignet/OAuthDetailsRequestV3/OAuthDetailsWithClaimValueRequest input: '{ "requestTime": "$TIMESTAMP$", - "clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY", + "clientId": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$", "scope": "openid profile", "responseType": "code", "redirectUri": "$IDPREDIRECTURI$", diff --git a/api-test/testNgXmlFiles/esignetPrerequisiteSuite.xml b/api-test/testNgXmlFiles/esignetPrerequisiteSuite.xml index 7ca15540b..be3a7d4b3 100644 --- a/api-test/testNgXmlFiles/esignetPrerequisiteSuite.xml +++ b/api-test/testNgXmlFiles/esignetPrerequisiteSuite.xml @@ -13,7 +13,7 @@ value="esignet/AddIdentityMock/AddIdentity.yml" /> - + @@ -21,7 +21,7 @@ value="esignet/AddIdentity/AddIdentity.yml" /> - + @@ -30,7 +30,7 @@ - + @@ -40,7 +40,7 @@ - + @@ -49,7 +49,7 @@ value="esignet/PmsIntegration/PublishPolicy/PublishPolicy.yml" /> - + @@ -59,7 +59,7 @@ - + @@ -68,7 +68,7 @@ value= "esignet/PmsIntegration/UploadCertificate/UploadCertificate.yml" /> - + @@ -78,7 +78,7 @@ - + @@ -88,7 +88,7 @@ - + @@ -98,7 +98,7 @@ - + @@ -108,7 +108,7 @@ - + @@ -117,7 +117,7 @@ - + @@ -126,7 +126,7 @@ - + @@ -135,7 +135,7 @@ - + @@ -145,7 +145,7 @@ - + @@ -154,7 +154,7 @@ - + @@ -163,7 +163,7 @@ - + @@ -171,7 +171,7 @@ value="esignet/GetOidcClient/GetOidcClient.yml" /> - + @@ -181,7 +181,7 @@ - + @@ -189,7 +189,7 @@ - + \ No newline at end of file diff --git a/api-test/testNgXmlFiles/esignetSuite.xml b/api-test/testNgXmlFiles/esignetSuite.xml index 3adbb9e85..4fa546056 100644 --- a/api-test/testNgXmlFiles/esignetSuite.xml +++ b/api-test/testNgXmlFiles/esignetSuite.xml @@ -12,112 +12,112 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -126,21 +126,21 @@ value="esignet/OIDCClientV2/OIDCClientV2.yml" /> - + - + - + @@ -148,7 +148,7 @@ value="esignet/LinkedConsent/OAuthDetailsRequestLinkedConsent/OAuthDetailsRequestLinkedConsent.yml" /> - + @@ -156,7 +156,7 @@ value="esignet/LinkedConsent/GenerateLinkCodeConsent/GenerateLinkCodeConsent.yml" /> - + @@ -164,14 +164,14 @@ value="esignet/LinkedConsent/LinkTransactionConsent/LinkTransactionConsent.yml" /> - + - + @@ -179,14 +179,14 @@ value="esignet/LinkedConsent/LinkedAuthenticationConsentWla/LinkedAuthenticationConsentWla.yml" /> - + - + @@ -194,7 +194,7 @@ value="esignet/LinkedConsent/LinkAuthorizationCodeConsent/LinkAuthorizationCodeConsent.yml" /> - + @@ -202,14 +202,14 @@ value="esignet/LinkedConsent/GenerateTokenLinkedConsent/GenerateTokenLinkedConsent.yml" /> - + - + @@ -217,7 +217,7 @@ value="esignet/OAuthDetailsRequestLinked/OAuthDetailsRequest.yml" /> - + @@ -225,7 +225,7 @@ value="esignet/GenerateLinkCode/GenerateLinkCode.yml" /> - + @@ -233,14 +233,14 @@ value="esignet/LinkTransaction/LinkTransaction.yml" /> - + - + @@ -248,14 +248,14 @@ value="esignet/LinkedAuthenticationWla/LinkedAuthenticationWla.yml" /> - + - + @@ -263,7 +263,7 @@ value="esignet/LinkAuthorizationCode/LinkAuthorizationCode.yml" /> - + @@ -271,14 +271,14 @@ value="esignet/GenerateTokenLinked/GenerateTokenLinked.yml" /> - + - + @@ -286,21 +286,21 @@ value="esignet/OAuthDetailsRequest/OAuthDetailsRequestNonAuth.yml" /> - + - + - + @@ -308,14 +308,14 @@ value="esignet/Consent/OAuthDetailsRequestConsent/OAuthDetailsRequestConsent.yml" /> - + - + @@ -323,7 +323,7 @@ value="esignet/Consent/AuthorizationCodeConsent/AuthorizationCodeConsent.yml" /> - + @@ -331,14 +331,14 @@ value="esignet/Consent/GenerateTokenConsent/GenerateTokenConsent.yml" /> - + - + @@ -346,28 +346,28 @@ value="esignet/OAuthDetailsRequest/OAuthDetailsRequest.yml" /> - + - + - + - + @@ -375,7 +375,7 @@ value="esignet/AuthorizationCode/AuthorizationCode.yml" /> - + @@ -383,14 +383,14 @@ value="esignet/GenerateToken/GenerateToken.yml" /> - + - + @@ -398,14 +398,14 @@ value="esignet/VCI/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI.yml" /> - + - + @@ -413,7 +413,7 @@ value="esignet/VCI/AuthorizationCodeVCI/AuthorizationCodeVCI.yml" /> - + @@ -421,14 +421,14 @@ value="esignet/VCI/GenerateTokenVCI/GenerateTokenVCI.yml" /> - + - + @@ -436,14 +436,14 @@ value="esignet/VCIVid/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI.yml" /> - + - + @@ -451,7 +451,7 @@ value="esignet/VCIVid/AuthorizationCodeVCI/AuthorizationCodeVCI.yml" /> - + @@ -459,14 +459,14 @@ value="esignet/VCIVid/GenerateTokenVCI/GenerateTokenVCI.yml" /> - + - + @@ -474,14 +474,14 @@ value="esignet/VCINegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI.yml" /> - + - + @@ -489,7 +489,7 @@ value="esignet/VCINegTC/AuthorizationCodeVCI/AuthorizationCodeVCI.yml" /> - + @@ -497,14 +497,14 @@ value="esignet/VCINegTC/GenerateTokenVCI/GenerateTokenVCI.yml" /> - + - + @@ -512,14 +512,14 @@ value="esignet/VCIVidNegTC/OAuthDetailsRequestVCI/OAuthDetailsRequestVCI.yml" /> - + - + @@ -527,7 +527,7 @@ value="esignet/VCIVidNegTC/AuthorizationCodeVCI/AuthorizationCodeVCI.yml" /> - + @@ -535,21 +535,21 @@ value="esignet/VCIVidNegTC/GenerateTokenVCI/GenerateTokenVCI.yml" /> - + - + - + @@ -557,14 +557,14 @@ value="esignet/OAuthDetailsRequestPassword/OAuthDetailsRequestPassword.yml" /> - + - + @@ -572,7 +572,7 @@ value="esignet/AuthorizationCodePassword/AuthorizationCodePassword.yml" /> - + @@ -580,14 +580,14 @@ value="esignet/GenerateTokenPassword/GenerateTokenPassword.yml" /> - + - + @@ -595,14 +595,14 @@ value="esignet/OAuthDetailsRequestPasswordNegTC/OAuthDetailsRequestPasswordNegTC.yml" /> - + - + @@ -610,7 +610,7 @@ value="esignet/CreateOIDCClient/CreateOIDCClient.yml" /> - + @@ -618,7 +618,7 @@ value="esignet/UpdateOIDCClient/UpdateOIDCClient.yml" /> - + @@ -626,7 +626,7 @@ value="esignet/CreateOIDCClientV2/CreateOIDCClient.yml" /> - + @@ -634,7 +634,7 @@ value="esignet/UpdateOIDCClientV2/UpdateOIDCClient.yml" /> - + @@ -642,7 +642,7 @@ value="esignet/OAuthDetailsRequestV2/OAuthDetailsRequest.yml" /> - + @@ -651,7 +651,7 @@ - + @@ -659,7 +659,7 @@ value="esignet/SunBirdR/GetPolicySunBirdR/GetPolicySunBirdR.yml" /> - + @@ -667,7 +667,7 @@ value="esignet/SunBirdR/SearchPolicySunBirdR/SearchPolicySunBirdR.yml" /> - + @@ -675,7 +675,7 @@ value="esignet/SunBirdC/CreateOIDCClientV2SunBirdC/CreateOIDCClientV2SunBirdC.yml" /> - + @@ -683,14 +683,14 @@ value="esignet/SunBirdC/OAuthDetailsRequestSunBirdC/OAuthDetailsRequestSunBirdC.yml" /> - + - + @@ -698,7 +698,7 @@ value="esignet/SunBirdC/AuthorizationCodeSunBirdC/AuthorizationCodeSunBirdC.yml" /> - + @@ -706,14 +706,14 @@ value="esignet/SunBirdC/GenerateTokenSunBirdC/GenerateTokenSunBirdC.yml" /> - + - + @@ -721,14 +721,14 @@ value="esignet/SunBirdCNegTC/OAuthDetailsRequestSunBirdCNegTC/OAuthDetailsRequestSunBirdCNegTC.yml" /> - + - + @@ -736,7 +736,7 @@ value="esignet/SunBirdCNegTC/AuthorizationCodeSunBirdCNegTC/AuthorizationCodeSunBirdCNegTC.yml" /> - + @@ -744,14 +744,14 @@ value="esignet/SunBirdCNegTC/GenerateTokenSunBirdCNegTC/GenerateTokenSunBirdCNegTC.yml" /> - + - + @@ -760,7 +760,7 @@ - + @@ -769,56 +769,56 @@ - + - + - + - + - + - + - + - + --> @@ -828,21 +828,21 @@ value="esignet/OAuthDetailsRequestV3/OAuthDetailsRequest.yml" /> - + - + - + @@ -850,7 +850,7 @@ value="esignet/PrepareSignupRedirect/PrepareSignupRedirect.yml" /> - + @@ -858,14 +858,14 @@ value="esignet/SignupAuthorize/SignupAuthorize.yml" /> - + - + @@ -873,7 +873,7 @@ value="esignet/SignupAuthorizeCode/SignupAuthorizeCode.yml" /> - + @@ -881,30 +881,30 @@ value="esignet/InitiateIdVerification/InitiateIdVerification.yml" /> - + - + - + - + \ No newline at end of file From af77d9ba12fad44a364f9fb4e177fd713240b267 Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Wed, 30 Oct 2024 17:52:05 +0530 Subject: [PATCH 21/33] ES-1425 Signed-off-by: Nandhukumar --- .../esignet/testrunner/MosipTestRunner.java | 3 +- .../apirig/esignet/utils/EsignetUtil.java | 66 +++++++++++++++++++ .../main/resources/config/esignet.properties | 1 + 3 files changed, 68 insertions(+), 2 deletions(-) diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testrunner/MosipTestRunner.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testrunner/MosipTestRunner.java index 3214d3b72..255c95f5a 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testrunner/MosipTestRunner.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/testrunner/MosipTestRunner.java @@ -129,8 +129,7 @@ public static void main(String[] arg) { startTestRunner(); } else { BaseTestCase.isTargetEnvLatest = true; - BaseTestCase.languageList.add("eng"); - BaseTestCase.languageList.add("khm"); + EsignetUtil.getSupportedLanguage(); startTestRunner(); } diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/esignet/utils/EsignetUtil.java b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/utils/EsignetUtil.java index 16456c85f..56083c679 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/esignet/utils/EsignetUtil.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/esignet/utils/EsignetUtil.java @@ -3,6 +3,8 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +import java.util.Set; +import java.util.TreeSet; import javax.ws.rs.core.MediaType; @@ -43,6 +45,31 @@ public static String getIdentityPluginNameFromEsignetActuator() { return plugin; } + public static void getSupportedLanguage() { + String supportedLanguages = getValueFromSignupActuator("classpath:/application-default.properties", + "mosip.signup.supported-languages"); + + if (supportedLanguages != null && supportedLanguages.isBlank() == false) { + supportedLanguages = supportedLanguages.replace("{", "").replace("}", "").replace("'", ""); + + // Split the string by commas + String[] languages = supportedLanguages.split(","); + + // Use a TreeSet to sort the languages + Set sortedLanguages = new TreeSet<>(); + for (String language : languages) { + sortedLanguages.add(language.trim()); // Trim to remove any extra spaces + } + + // Add sorted languages to the languageList + BaseTestCase.languageList.addAll(sortedLanguages); + + logger.info("languageList " + BaseTestCase.languageList); + } else { + logger.error("Language not found"); + } + } + private static final Map actuatorValueCache = new HashMap<>(); public static JSONArray esignetActuatorResponseArray = null; @@ -84,6 +111,45 @@ public static String getValueFromEsignetActuator(String section, String key) { } + public static JSONArray signupActuatorResponseArray = null; + + public static String getValueFromSignupActuator(String section, String key) { + String url = EsignetConfigManager.getSignupBaseUrl() + EsignetConfigManager.getproperty("actuatorSignupEndpoint"); + String actuatorCacheKey = url + section + key; + String value = actuatorValueCache.get(actuatorCacheKey); + if (value != null && !value.isEmpty()) + return value; + + try { + if (signupActuatorResponseArray == null) { + Response response = null; + JSONObject responseJson = null; + response = RestClient.getRequest(url, MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON); + responseJson = new JSONObject(response.getBody().asString()); + signupActuatorResponseArray = responseJson.getJSONArray("propertySources"); + } + + for (int i = 0, size = signupActuatorResponseArray.length(); i < size; i++) { + JSONObject eachJson = signupActuatorResponseArray.getJSONObject(i); + if (eachJson.get("name").toString().contains(section)) { + logger.info(eachJson.getJSONObject(GlobalConstants.PROPERTIES)); + value = eachJson.getJSONObject(GlobalConstants.PROPERTIES).getJSONObject(key) + .get(GlobalConstants.VALUE).toString(); + if (EsignetConfigManager.IsDebugEnabled()) + logger.info("Actuator: " + url + " key: " + key + " value: " + value); + break; + } + } + actuatorValueCache.put(actuatorCacheKey, value); + + return value; + } catch (Exception e) { + logger.error(GlobalConstants.EXCEPTION_STRING_2 + e); + return value; + } + + } + public static String isTestCaseValidForExecution(TestCaseDTO testCaseDTO) { String testCaseName = testCaseDTO.getTestCaseName(); diff --git a/api-test/src/main/resources/config/esignet.properties b/api-test/src/main/resources/config/esignet.properties index f6a148e45..b6a0a4ff4 100644 --- a/api-test/src/main/resources/config/esignet.properties +++ b/api-test/src/main/resources/config/esignet.properties @@ -1,5 +1,6 @@ #---------------------------------- End point(s) relative URLs ----------------------------------# actuatorEsignetEndpoint=/v1/esignet/actuator/env +actuatorSignupEndpoint=/v1/signup/actuator/env tokenEndpoint=/v1/esignet/oauth/token validateBindingEndpoint=ida-binding esignetWellKnownEndPoint=/v1/esignet/oidc/.well-known/openid-configuration From 1ec9a390eb91d378e8496e7f828bee7ca3489a8f Mon Sep 17 00:00:00 2001 From: sacrana0 Date: Wed, 30 Oct 2024 18:23:45 +0530 Subject: [PATCH 22/33] MOSIP-36169 added unique index on 'n' field of public_key (#953) * added unique index on 'n' field of public_key Signed-off-by: Sachin Rana * removed redundant unique key constraint Signed-off-by: Sachin Rana * added migration scripts Signed-off-by: Sachin Rana * moved properties Signed-off-by: Sachin Rana --------- Signed-off-by: Sachin Rana --- .../io/mosip/esignet/entity/ClientDetail.java | 2 +- .../ddl/esignet-client_detail.sql | 7 +- .../sql/1.5.0_to_1.5.1_rollback.sql | 50 ++++++++++++- .../sql/1.5.0_to_1.5.1_upgrade.sql | 72 ++++++++++++++++++- .../resources/application-local.properties | 1 + .../src/main/resources/bootstrap.properties | 5 +- 6 files changed, 130 insertions(+), 7 deletions(-) diff --git a/client-management-service-impl/src/main/java/io/mosip/esignet/entity/ClientDetail.java b/client-management-service-impl/src/main/java/io/mosip/esignet/entity/ClientDetail.java index 0b1f6840a..c9dd8a6cd 100644 --- a/client-management-service-impl/src/main/java/io/mosip/esignet/entity/ClientDetail.java +++ b/client-management-service-impl/src/main/java/io/mosip/esignet/entity/ClientDetail.java @@ -45,7 +45,7 @@ public class ClientDetail { private String redirectUris; @NotBlank(message = INVALID_PUBLIC_KEY) - @Column(name = "public_key", columnDefinition = "TEXT") + @Column(name = "public_key", columnDefinition = "jsonb") private String publicKey; @NotBlank(message = INVALID_CLAIM) diff --git a/db_scripts/mosip_esignet/ddl/esignet-client_detail.sql b/db_scripts/mosip_esignet/ddl/esignet-client_detail.sql index b9fd5a3ef..d2c67de1d 100644 --- a/db_scripts/mosip_esignet/ddl/esignet-client_detail.sql +++ b/db_scripts/mosip_esignet/ddl/esignet-client_detail.sql @@ -23,16 +23,17 @@ CREATE TABLE client_detail( redirect_uris character varying NOT NULL, claims character varying NOT NULL, acr_values character varying NOT NULL, - public_key character varying NOT NULL, + public_key jsonb NOT NULL, grant_types character varying NOT NULL, auth_methods character varying NOT NULL, status character varying(20) NOT NULL, cr_dtimes timestamp NOT NULL, upd_dtimes timestamp, - CONSTRAINT pk_clntdtl_id PRIMARY KEY (id), - CONSTRAINT uk_clntdtl_key UNIQUE (public_key) + CONSTRAINT pk_clntdtl_id PRIMARY KEY (id) ); +CREATE UNIQUE INDEX unique_n_value ON client_detail ((public_key->>'n')); + COMMENT ON TABLE client_detail IS 'Contains key alias and metadata of all the keys used in MOSIP system.'; COMMENT ON COLUMN client_detail.id IS 'Client ID: Unique id assigned to registered OIDC client.'; diff --git a/db_upgrade_script/mosip_esignet/sql/1.5.0_to_1.5.1_rollback.sql b/db_upgrade_script/mosip_esignet/sql/1.5.0_to_1.5.1_rollback.sql index 1a2e0a41c..0506996eb 100644 --- a/db_upgrade_script/mosip_esignet/sql/1.5.0_to_1.5.1_rollback.sql +++ b/db_upgrade_script/mosip_esignet/sql/1.5.0_to_1.5.1_rollback.sql @@ -1 +1,49 @@ -\echo 'Rollback Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION' \ No newline at end of file +\c mosip_esignet + +CREATE OR REPLACE FUNCTION is_column_jsonb( + p_table_name text, + p_column_name text, + p_schema_name text DEFAULT current_schema() +) RETURNS boolean AS $$ +DECLARE + v_column_type text; +BEGIN + -- Get the column data type + SELECT data_type INTO v_column_type + FROM information_schema.columns + WHERE table_schema = p_schema_name + AND table_name = p_table_name + AND column_name = p_column_name; + + -- Handle case when column doesn't exist + IF v_column_type IS NULL THEN + RAISE EXCEPTION 'Column %.% does not exist', p_table_name, p_column_name; + END IF; + + -- Return true if jsonb, false otherwise + RETURN v_column_type = 'jsonb'; + +EXCEPTION + WHEN undefined_table THEN + RAISE EXCEPTION 'Table %.% does not exist', p_schema_name, p_table_name; + WHEN OTHERS THEN + RAISE EXCEPTION 'Error checking column type: %', SQLERRM; +END; +$$ LANGUAGE plpgsql; + +DO $$ +BEGIN +IF is_column_jsonb('client_detail', 'public_key') THEN + IF EXISTS ( + SELECT 1 FROM information_schema.tables + WHERE table_name='client_detail_migr_bkp' + ) THEN + DROP TABLE client_detail; + CREATE TABLE client_detail (LIKE client_detail_migr_bkp including ALL); + INSERT INTO client_detail SELECT * FROM client_detail_migr_bkp; + DROP TABLE client_detail_migr_bkp; + ELSE + RAISE EXCEPTION 'Error: Backup doesn''t exist'; + END IF; +END IF; +END $$ \ No newline at end of file diff --git a/db_upgrade_script/mosip_esignet/sql/1.5.0_to_1.5.1_upgrade.sql b/db_upgrade_script/mosip_esignet/sql/1.5.0_to_1.5.1_upgrade.sql index 381e2be11..d8a106ee2 100644 --- a/db_upgrade_script/mosip_esignet/sql/1.5.0_to_1.5.1_upgrade.sql +++ b/db_upgrade_script/mosip_esignet/sql/1.5.0_to_1.5.1_upgrade.sql @@ -1 +1,71 @@ -\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION' \ No newline at end of file +\c mosip_esignet + +CREATE OR REPLACE FUNCTION is_column_jsonb( + p_table_name text, + p_column_name text, + p_schema_name text DEFAULT current_schema() +) RETURNS boolean AS $$ +DECLARE + v_column_type text; +BEGIN + -- Get the column data type + SELECT data_type INTO v_column_type + FROM information_schema.columns + WHERE table_schema = p_schema_name + AND table_name = p_table_name + AND column_name = p_column_name; + + -- Handle case when column doesn't exist + IF v_column_type IS NULL THEN + RAISE EXCEPTION 'Column %.% does not exist', p_table_name, p_column_name; + END IF; + + -- Return true if jsonb, false otherwise + RETURN v_column_type = 'jsonb'; + +EXCEPTION + WHEN undefined_table THEN + RAISE EXCEPTION 'Table %.% does not exist', p_schema_name, p_table_name; + WHEN OTHERS THEN + RAISE EXCEPTION 'Error checking column type: %', SQLERRM; +END; +$$ LANGUAGE plpgsql; + + +DO $$ +BEGIN +IF NOT is_column_jsonb('client_detail', 'public_key') THEN + + -- create backup + DROP TABLE IF EXISTS client_detail_migr_bkp; + CREATE TABLE client_detail_migr_bkp (LIKE client_detail including ALL); + INSERT into client_detail_migr_bkp SELECT * from client_detail; + ---- + + ALTER TABLE client_detail ADD COLUMN public_key_new jsonb; + UPDATE client_detail SET public_key_new = public_key::jsonb; + ALTER TABLE client_detail DROP COLUMN public_key; + ALTER TABLE client_detail RENAME COLUMN public_key_new TO public_key; + + -- inactivating clients with same modulus in public key + WITH duplicates AS ( + SELECT public_key->>'n' as modulus + FROM client_detail + WHERE public_key->>'n' IS NOT NULL + GROUP BY public_key->>'n' + HAVING COUNT(*) > 1 + ) + UPDATE client_detail SET status='INACTIVE', public_key='{}'::jsonb where id IN ( + SELECT + client_detail.id + FROM client_detail + JOIN duplicates ON client_detail.public_key->>'n' = duplicates.modulus); + ---- + + ALTER TABLE client_detail ALTER COLUMN public_key SET NOT NULL; + CREATE UNIQUE INDEX unique_n_value ON client_detail ((public_key->>'n')); + RAISE NOTICE 'Upgrade Successful'; +ELSE + RAISE NOTICE 'Database already uptodate'; +END IF; +END $$ \ No newline at end of file diff --git a/esignet-service/src/main/resources/application-local.properties b/esignet-service/src/main/resources/application-local.properties index 52c9830d8..5412b7b03 100644 --- a/esignet-service/src/main/resources/application-local.properties +++ b/esignet-service/src/main/resources/application-local.properties @@ -266,6 +266,7 @@ spring.datasource.url=jdbc:postgresql://${mosip.esignet.database.hostname}:${mos spring.datasource.username=${mosip.esignet.database.username} spring.datasource.password=postgres + spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL95Dialect spring.jpa.show-sql=false spring.jpa.hibernate.ddl-auto=none diff --git a/esignet-service/src/main/resources/bootstrap.properties b/esignet-service/src/main/resources/bootstrap.properties index 4077637b0..b79c7e7a3 100644 --- a/esignet-service/src/main/resources/bootstrap.properties +++ b/esignet-service/src/main/resources/bootstrap.properties @@ -45,4 +45,7 @@ logging.level.io.mosip.esignet=INFO management.endpoint.metrics.enabled=true management.endpoints.web.exposure.include=* management.endpoint.prometheus.enabled=true -management.metrics.export.prometheus.enabled=true \ No newline at end of file +management.metrics.export.prometheus.enabled=true + +# to accept string as valid type for jsonb column +spring.datasource.hikari.data-source-properties=stringtype=unspecified \ No newline at end of file From 1c44375064902efd5175dc38a294eca377d41838 Mon Sep 17 00:00:00 2001 From: Gk <76690271+gk-4VII@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:25:52 +0530 Subject: [PATCH 23/33] [ES-1892] [ES-1358] i18n translation changes and minor UI changes. (#987) Signed-off-by: GurukiranP --- oidc-ui/public/locales/ar.json | 5 +++-- oidc-ui/public/locales/en.json | 7 ++++--- oidc-ui/public/locales/hi.json | 5 +++-- oidc-ui/public/locales/km.json | 5 +++-- oidc-ui/public/locales/kn.json | 5 +++-- oidc-ui/public/locales/ta.json | 7 ++++--- oidc-ui/src/components/ClaimDetails.js | 13 ++++++++++++- 7 files changed, 32 insertions(+), 15 deletions(-) diff --git a/oidc-ui/public/locales/ar.json b/oidc-ui/public/locales/ar.json index 8e478aaff..d9b5bbaa8 100644 --- a/oidc-ui/public/locales/ar.json +++ b/oidc-ui/public/locales/ar.json @@ -192,8 +192,8 @@ "consentDetails": { "essential_claims": "المطالبات الأساسية", "voluntary_claims": "المطالبات الطوعية", - "verified_claims": "المطالبات التي تم التحقق منها", - "unverified_claims": "مطالبات لم يتم التحقق منها", + "verified_claims": "تم التحقق منه", + "unverified_claims": "لم يتم التحقق منها", "name": "اسم", "given_name": "اسم", "middle_name": "الاسم الأوسط", @@ -455,6 +455,7 @@ "IDA-OTA-010": "نوع هوية الإدخال لا يتطابق مع نوع هوية طلب OTP", "IDA-OTA-011": "معرف الشريك المدخل لا يتطابق مع معرف الشريك لطلب OTP", "IDA-OTA-012": "لا يمكن إجراء التحقق من صحة كلمة المرور لمرة واحدة (OTP) مقابل معرف الفرد هذا. ", + "IDA-OTA-013": "تم حظر طلب/التحقق من صحة OTP مؤقتًا. يرجى المحاولة مرة أخرى بعد وقت ما.", "send_otp_failed": "غير قادر على إرسال OTP. ", "send_otp_failed_msg": "غير قادر على إرسال OTP. ", "invalid_otp_channel": "تم توفير قناة OTP غير صالحة.", diff --git a/oidc-ui/public/locales/en.json b/oidc-ui/public/locales/en.json index 11e7d5d71..d5334fa80 100644 --- a/oidc-ui/public/locales/en.json +++ b/oidc-ui/public/locales/en.json @@ -192,8 +192,8 @@ "consentDetails": { "essential_claims": "Essential Claims", "voluntary_claims": "Voluntary Claims", - "verified_claims": "Verified Claims", - "unverified_claims": "Unverified Claims", + "verified_claims": "Verified", + "unverified_claims": "Not Verified", "name": "Name", "given_name": "Name", "middle_name": "Middle Name", @@ -215,7 +215,7 @@ "verified": "Verified", "not-verified": "Not Verified", "available": "Available", - "not-available": "Not-Available", + "not-available": "Not Available", "message": "Click on proceed to begin with the verification process", "proceed": "Proceed", "cancel": "Cancel", @@ -455,6 +455,7 @@ "IDA-OTA-010": "Input Identity Type does not match Identity Type of OTP Request", "IDA-OTA-011": "Input Partner-ID does not match Partner-ID of OTP Request", "IDA-OTA-012": "OTP validation can't be performed against this Individual-ID. Generate OTP first", + "IDA-OTA-013": "OTP request/validation has been temporarily blocked. Please try again after sometime.", "send_otp_failed": "Unable to send OTP. Please try again.", "send_otp_failed_msg": "Unable to send OTP. Please try again.", "invalid_otp_channel": "Invalid OTP Channel Provided.", diff --git a/oidc-ui/public/locales/hi.json b/oidc-ui/public/locales/hi.json index 45a8f9918..70ca0ab49 100644 --- a/oidc-ui/public/locales/hi.json +++ b/oidc-ui/public/locales/hi.json @@ -192,8 +192,8 @@ "consentDetails": { "essential_claims": "आवश्यक दावे", "voluntary_claims": "स्वैच्छिक दावे", - "verified_claims": "सत्यापित दावे", - "unverified_claims": "असत्यापित दावे", + "verified_claims": "सत्यापित", + "unverified_claims": "सत्यापित नहीं है", "name": "नाम", "given_name": "नाम", "middle_name": "मध्य नाम", @@ -455,6 +455,7 @@ "IDA-OTA-010": "इनपुट पहचान प्रकार ओटीपी अनुरोध के पहचान प्रकार से मेल नहीं खाता", "IDA-OTA-011": "इनपुट पार्टनर-आईडी ओटीपी अनुरोध के पार्टनर-आईडी से मेल नहीं खाता है", "IDA-OTA-012": "इस व्यक्तिगत-आईडी के विरुद्ध ओटीपी सत्यापन नहीं किया जा सकता है। ", + "IDA-OTA-013": "ओटीपी अनुरोध/सत्यापन अस्थायी रूप से अवरुद्ध कर दिया गया है। कृपया कुछ समय बाद पुनः प्रयास करें.", "send_otp_failed": "ओटीपी भेजने में असमर्थ. ", "send_otp_failed_msg": "ओटीपी भेजने में असमर्थ. ", "invalid_otp_channel": "अमान्य ओटीपी चैनल प्रदान किया गया।", diff --git a/oidc-ui/public/locales/km.json b/oidc-ui/public/locales/km.json index bb6e36f90..edbfb7fe9 100644 --- a/oidc-ui/public/locales/km.json +++ b/oidc-ui/public/locales/km.json @@ -192,8 +192,8 @@ "consentDetails": { "essential_claims": "ការទាមទារសំខាន់ៗ", "voluntary_claims": "ការទាមទារដោយស្ម័គ្រចិត្ត", - "verified_claims": "ការទាមទារដែលបានផ្ទៀងផ្ទាត់", - "unverified_claims": "ការទាមទារដែលមិនបានបញ្ជាក់", + "verified_claims": "ផ្ទៀងផ្ទាត់", + "unverified_claims": "មិនបានផ្ទៀងផ្ទាត់", "name": "ឈ្មោះ", "given_name": "ឈ្មោះ", "middle_name": "ឈ្មោះកណ្តាល", @@ -455,6 +455,7 @@ "IDA-OTA-010": "ប្រភេទអត្តសញ្ញាណបញ្ចូលមិនត្រូវគ្នានឹងប្រភេទអត្តសញ្ញាណនៃសំណើ OTP ទេ។", "IDA-OTA-011": "លេខសម្គាល់ដៃគូបញ្ចូលមិនត្រូវគ្នានឹងលេខសម្គាល់ដៃគូនៃសំណើ OTP ទេ។", "IDA-OTA-012": "សុពលភាព OTP មិនអាចត្រូវបានអនុវត្តប្រឆាំងនឹង Individual-ID នេះទេ។ ", + "IDA-OTA-013": "សំណើ/សុពលភាព OTP ត្រូវបានរារាំងជាបណ្តោះអាសន្ន។ សូមព្យាយាមម្តងទៀតបន្ទាប់ពីពេលខ្លះ។", "send_otp_failed": "មិនអាចផ្ញើ OTP បានទេ។ ", "send_otp_failed_msg": "មិនអាចផ្ញើ OTP បានទេ។ ", "invalid_otp_channel": "ប៉ុស្តិ៍ OTP មិនត្រឹមត្រូវត្រូវបានផ្តល់។", diff --git a/oidc-ui/public/locales/kn.json b/oidc-ui/public/locales/kn.json index 8d031f69e..4c48f8403 100644 --- a/oidc-ui/public/locales/kn.json +++ b/oidc-ui/public/locales/kn.json @@ -192,8 +192,8 @@ "consentDetails": { "essential_claims": "ಅಗತ್ಯ ಹಕ್ಕುಗಳು", "voluntary_claims": "ಸ್ವಯಂಪ್ರೇರಿತ ಹಕ್ಕುಗಳು", - "verified_claims": "ಪರಿಶೀಲಿಸಿದ ಹಕ್ಕುಗಳು", - "unverified_claims": "ಪರಿಶೀಲಿಸದ ಹಕ್ಕುಗಳು", + "verified_claims": "ಪರಿಶೀಲಿಸಲಾಗಿದೆ", + "unverified_claims": "ಪರಿಶೀಲಿಸಲಾಗಿಲ್ಲ", "name": "ಹೆಸರು", "given_name": "ಹೆಸರು", "middle_name": "ಮಧ್ಯದ ಹೆಸರು", @@ -455,6 +455,7 @@ "IDA-OTA-010": "ಇನ್‌ಪುಟ್ ಗುರುತಿನ ಪ್ರಕಾರವು OTP ವಿನಂತಿಯ ಗುರುತಿನ ಪ್ರಕಾರಕ್ಕೆ ಹೊಂದಿಕೆಯಾಗುವುದಿಲ್ಲ", "IDA-OTA-011": "OTP ವಿನಂತಿಯ ಪಾಲುದಾರ-ID ಇನ್‌ಪುಟ್ ಪಾಲುದಾರ-ID ಹೊಂದಿಕೆಯಾಗುವುದಿಲ್ಲ", "IDA-OTA-012": "ಈ ವೈಯಕ್ತಿಕ-ಐಡಿ ವಿರುದ್ಧ OTP ಮೌಲ್ಯೀಕರಣವನ್ನು ನಿರ್ವಹಿಸಲು ಸಾಧ್ಯವಿಲ್ಲ. ", + "IDA-OTA-013": "OTP ವಿನಂತಿ/ಮೌಲ್ಯಮಾಪನವನ್ನು ತಾತ್ಕಾಲಿಕವಾಗಿ ನಿರ್ಬಂಧಿಸಲಾಗಿದೆ. ದಯವಿಟ್ಟು ಸ್ವಲ್ಪ ಸಮಯದ ನಂತರ ಮತ್ತೆ ಪ್ರಯತ್ನಿಸಿ.", "send_otp_failed": "OTP ಕಳುಹಿಸಲು ಸಾಧ್ಯವಾಗುತ್ತಿಲ್ಲ. ", "send_otp_failed_msg": "OTP ಕಳುಹಿಸಲು ಸಾಧ್ಯವಾಗುತ್ತಿಲ್ಲ. ", "invalid_otp_channel": "ಅಮಾನ್ಯ OTP ಚಾನಲ್ ಒದಗಿಸಲಾಗಿದೆ.", diff --git a/oidc-ui/public/locales/ta.json b/oidc-ui/public/locales/ta.json index 7ff1e3643..dcc53d1e8 100644 --- a/oidc-ui/public/locales/ta.json +++ b/oidc-ui/public/locales/ta.json @@ -192,8 +192,8 @@ "consentDetails": { "essential_claims": "அத்தியாவசிய உரிமைகோரல்கள்", "voluntary_claims": "தன்னார்வ உரிமைகோரல்கள்", - "verified_claims": "சரிபார்க்கப்பட்ட உரிமைகோரல்கள்", - "unverified_claims": "சரிபார்க்கப்படாத உரிமைகோரல்கள்", + "verified_claims": "சரிபார்க்கப்பட்டது", + "unverified_claims": "சரிபார்க்கப்படவில்லை", "name": "பெயர்", "given_name": "பெயர்", "middle_name": "நடுத்தர பெயர்", @@ -215,7 +215,7 @@ "verified": "சரிபார்க்கப்பட்டது", "not-verified": "சரிபார்க்கப்படவில்லை", "available": "கிடைக்கும்", - "not-available": "இல்லை-கிடைக்கவில்லை", + "not-available": "கிடைக்கவில்லை", "message": "சரிபார்ப்பு செயல்முறையைத் தொடங்க தொடர என்பதைக் கிளிக் செய்யவும்", "proceed": "தொடரவும்", "cancel": "ரத்து செய்", @@ -455,6 +455,7 @@ "IDA-OTA-010": "உள்ளீட்டு அடையாள வகை, OTP கோரிக்கையின் அடையாள வகையுடன் பொருந்தவில்லை", "IDA-OTA-011": "உள்ளீட்டு பார்ட்னர் ஐடி, OTP கோரிக்கையின் பார்ட்னர் ஐடியுடன் பொருந்தவில்லை", "IDA-OTA-012": "இந்த தனிநபர் ஐடிக்கு எதிராக OTP சரிபார்ப்பைச் செய்ய முடியாது. ", + "IDA-OTA-013": "OTP கோரிக்கை/சரிபார்ப்பு தற்காலிகமாக தடுக்கப்பட்டது. சிறிது நேரம் கழித்து மீண்டும் முயற்சிக்கவும்.", "send_otp_failed": "OTP ஐ அனுப்ப முடியவில்லை. ", "send_otp_failed_msg": "OTP ஐ அனுப்ப முடியவில்லை. ", "invalid_otp_channel": "தவறான OTP சேனல் வழங்கப்பட்டது.", diff --git a/oidc-ui/src/components/ClaimDetails.js b/oidc-ui/src/components/ClaimDetails.js index 86f114a8e..5b8469e5c 100644 --- a/oidc-ui/src/components/ClaimDetails.js +++ b/oidc-ui/src/components/ClaimDetails.js @@ -89,7 +89,18 @@ const ClaimDetails = ({ } else if (label === "voluntary") { return (
-

{t1("voluntaryClaimsTooltip")}

+

+ {t1("voluntary_claims")}: + {t1("voluntaryClaimsTooltip")} +

+

+ {t1("verified_claims")}: + {t1("verifiedClaimTooltip")} +

+

+ {t1("unverified_claims")}: + {t1("unverifiedClaimTooltip")} +

); } From fcfbc17f5197e24d4e9b5a9bb3c4cd10bbc1f534 Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Tue, 5 Nov 2024 13:22:52 +0530 Subject: [PATCH 24/33] MOSIP-37137 | changed package name Signed-off-by: Nandhukumar --- api-test/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-test/pom.xml b/api-test/pom.xml index bf9977b36..0f909aa6f 100644 --- a/api-test/pom.xml +++ b/api-test/pom.xml @@ -163,7 +163,7 @@ - io.mosip.testrig.apirig.testrunner.MosipTestRunner + io.mosip.testrig.apirig.esignet.testrunner.MosipTestRunner - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 56c3068e9d4273133745a8de520d2d71f0d1ca94 Mon Sep 17 00:00:00 2001 From: Gk <76690271+gk-4VII@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:40:51 +0530 Subject: [PATCH 30/33] [ES-1166] minor theme changes. (#993) Signed-off-by: GurukiranP --- oidc-ui/public/theme/variables.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oidc-ui/public/theme/variables.css b/oidc-ui/public/theme/variables.css index 681e532af..9b09b0ba5 100644 --- a/oidc-ui/public/theme/variables.css +++ b/oidc-ui/public/theme/variables.css @@ -248,11 +248,11 @@ --secondary-button-disable-color: #ffffff; --secondary-button-disable-bg-color: #cbcbcb; --secondary-button-disable-border-color: #cbcbcb; - --loading-indicator-ring-color: #3182ce; + --loading-indicator-ring-color: #004282; --loading-indicator-bg-color: transparent; --loading-indicator-font-color: #000000; - --qrcode-border-color: #1263ca; - --info-icon-color: #0686f0; + --qrcode-border-color: #004282; + --info-icon-color: #004282; --toggle-button-inactive-bg-color: #ffffff; --toggle-button-inactive-border-color: #d8d8d8; --toggle-button-active-bg-color: #ffffff; From 1a5410bed3a1c19ebb9064534845f0c29f77c3e2 Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Wed, 13 Nov 2024 22:49:34 +0530 Subject: [PATCH 31/33] MOSIP-37214 Signed-off-by: Nandhukumar --- api-test/README.md | 101 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 99 insertions(+), 2 deletions(-) diff --git a/api-test/README.md b/api-test/README.md index 51b622679..992d43cfb 100644 --- a/api-test/README.md +++ b/api-test/README.md @@ -1,3 +1,100 @@ -# Automation test +# eSignet API Test Rig -All automation test code. +## Overview + +The **eSignet API Test Rig** is designed for the execution of module-wise automation API tests for the eSignet service. This test rig utilizes **Java REST Assured** and **TestNG** frameworks to automate testing of the eSignet API functionalities. The key focus is to validate the authentication, signature generation, and related functionalities provided by the eSignet module. + +## Test Categories + +- **Smoke**: Contains only positive test scenarios for quick verification. +- **Regression**: Includes all test scenarios, covering both positive and negative cases. + +## Coverage + +This test rig covers only **external API endpoints** exposed by the eSignet module. + +## Pre-requisites + +Before running the automation tests, ensure the following software is installed on the machine: + +- **Java 21** (or a compatible version) +- **Maven 3.9.6** (or higher) +- **Lombok** (Refer to [Lombok Project](https://projectlombok.org/)) + +### For Windows + +- **Git Bash 2.18.0** or higher +- Ensure the `settings.xml` file is present in the `.m2` folder. + +### For Linux + +- The `settings.xml` file should be present in two places: + - In the regular Maven configuration folder (`/conf`) + - Under `/usr/local/maven/conf/` + +## Access Test Automation Code + +You can access the test automation code using either of the following methods: + +### From Browser + +1. Clone or download the repository as a zip file from [GitHub](https://github.com/mosip/esignet). +2. Unzip the contents to your local machine. +3. Open a terminal (Linux) or command prompt (Windows) and continue with the following steps. + +### From Git Bash + +1. Copy the Git repository URL: `https://github.com/mosip/esignet` +2. Open **Git Bash** on your local machine. +3. Run the following command to clone the repository: + ```sh + git clone https://github.com/mosip/esignet + ``` + +## Build Test Automation Code + +Once the repository is cloned or downloaded, follow these steps to build and install the test automation code: + +1. Navigate to the project directory: + ```sh + cd apitest + ``` + +2. Build the project using Maven: + ```sh + mvn clean install -Dgpg.skip=true -Dmaven.gitcommitid.skip=true + ``` + +This will download the required dependencies and prepare the test suite for execution. + +## Execute Test Automation Suite + +To execute the tests, use the following steps: + +1. Navigate to the `target` directory where the JAR file is generated: + ```sh + cd target/ + ``` + +2. Run the automation test suite JAR file: + ```sh + java -jar -Dmodules=esignet -Denv.user=api-internal. -Denv.endpoint= -Denv.testLevel=smokeAndRegression -jar apitest-esignet-1.5.0-SNAPSHOT-jar-with-dependencies.jar + ``` + +### Details of Arguments Used + +- **env.user**: The user of the environment where the tests will be executed. +- **env.endpoint**: The environment where the application under test is deployed. Replace `` with the actual environment hostname. +- **env.testLevel**: Set this to `smoke` to run only smoke test cases, or `smokeAndRegression` to run both smoke and regression tests. +- **jar**: Specify the name of the JAR file to execute. The version will change according to the development code version. For example, the current version may look like `apitest-esignet-1.5.0-SNAPSHOT-jar-with-dependencies.jar`. + +## Build and Run + +To run the tests for both **Smoke** and **Regression**: + +1. Ensure the correct environment and test level parameters are set. +2. Execute the tests as shown in the command above to validate eSignet's API functionalities. + +## License + +This project is licensed under the terms of the [Mozilla Public License 2.0] \ No newline at end of file From 6d32988c3e9d53b24cfa55596e416dd2fa7d258b Mon Sep 17 00:00:00 2001 From: Mohanachandran S <165888272+mohanachandran-s@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:01:29 +0530 Subject: [PATCH 32/33] MOSIP-37476 - updated the docker file for jdk version Signed-off-by: Mohanachandran S <165888272+mohanachandran-s@users.noreply.github.com> --- api-test/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-test/Dockerfile b/api-test/Dockerfile index ff6cb8945..9849f8524 100644 --- a/api-test/Dockerfile +++ b/api-test/Dockerfile @@ -1,4 +1,4 @@ -FROM mosipdev/openjdk-21-jre:latest +FROM mosipid/openjdk-21-jre:21.0.4 ARG SOURCE ARG COMMIT_HASH From 21ca0af0c554724e36255db493c0bf829aafd250 Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Thu, 14 Nov 2024 13:56:15 +0530 Subject: [PATCH 33/33] MOSIP-37214 Signed-off-by: Nandhukumar --- api-test/README.md | 66 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 59 insertions(+), 7 deletions(-) diff --git a/api-test/README.md b/api-test/README.md index 992d43cfb..b0f1c11cd 100644 --- a/api-test/README.md +++ b/api-test/README.md @@ -57,7 +57,7 @@ Once the repository is cloned or downloaded, follow these steps to build and ins 1. Navigate to the project directory: ```sh - cd apitest + cd api-test ``` 2. Build the project using Maven: @@ -69,7 +69,11 @@ This will download the required dependencies and prepare the test suite for exec ## Execute Test Automation Suite -To execute the tests, use the following steps: +You can execute the test automation code using either of the following methods: + +### Using Jar + +To execute the tests using Jar, use the following steps: 1. Navigate to the `target` directory where the JAR file is generated: ```sh @@ -77,16 +81,64 @@ To execute the tests, use the following steps: ``` 2. Run the automation test suite JAR file: - ```sh - java -jar -Dmodules=esignet -Denv.user=api-internal. -Denv.endpoint= -Denv.testLevel=smokeAndRegression -jar apitest-esignet-1.5.0-SNAPSHOT-jar-with-dependencies.jar ``` + java -jar -Dmodules=esignet -Denv.user=api-internal. -Denv.endpoint= -Denv.testLevel=smokeAndRegression -jar apitest-esignet-1.2.1-SNAPSHOT-jar-with-dependencies.jar + ``` + +# Using Eclipse IDE + +To execute the tests using Eclipse IDE, use the following steps: + +## 1. **Install Eclipse (Latest Version)** + - Download and install the latest version of Eclipse IDE from the [Eclipse Downloads](https://www.eclipse.org/downloads/). + +## 2. **Import the Maven Project** + + After Eclipse is installed, follow these steps to import the Maven project: + + - Open Eclipse IDE. + - Go to `File` > `Import`. + - In the **Import** wizard, select `Maven` > `Existing Maven Projects`, then click **Next**. + - Browse to the location where the `api-test` folder is saved (either from the cloned Git repository or downloaded zip). + - Select the folder, and Eclipse will automatically detect the Maven project. Click **Finish** to import the project. + +## 3. **Build the Project** + + - Right-click on the project in the **Project Explorer** and select `Maven` > `Update Project`. + - This will download the required dependencies as defined in the `pom.xml` and ensure everything is correctly set up. + +## 4. **Run the Tests** + + To execute the test automation suite, you need to configure the run parameters in Eclipse: + + - Go to `Run` > `Run Configurations`. + - In the **Run Configurations** window, create a new configuration for your tests: + - Right-click on **Java Application** and select **New**. + - In the **Main** tab, select the project by browsing the location where the `api-test` folder is saved, and select the **Main class** as `io.mosip.testrig.apirig.esignet.testrunner.MosipTestRunner`. + - In the **Arguments** tab, add the necessary **VM arguments**: + - **VM Arguments**: + ``` + -Dmodules=esignet -Denv.user=api-internal. -Denv.endpoint= -Denv.testLevel=smokeAndRegression``` + +## 5. **Run the Configuration** + + - Once the configuration is set up, click **Run** to execute the test suite. + - The tests will run, and the results will be shown in the **Console** tab of Eclipse. + + **Note**: You can also run in **Debug Mode** to troubleshoot issues by setting breakpoints in your code and choosing `Debug` instead of `Run`. + +## 6. **View Test Results** + + - After the tests are executed, you can view the detailed results in the `api-test\testng-report` directory. + + ### Details of Arguments Used -- **env.user**: The user of the environment where the tests will be executed. -- **env.endpoint**: The environment where the application under test is deployed. Replace `` with the actual environment hostname. +- **env.user**: Replace `` with the appropriate environment name (e.g., `dev`, `qa`, etc.). +- **env.endpoint**: The environment where the application under test is deployed. Replace `` with the correct base URL for the environment (e.g., `https://api-internal..mosip.net`). - **env.testLevel**: Set this to `smoke` to run only smoke test cases, or `smokeAndRegression` to run both smoke and regression tests. -- **jar**: Specify the name of the JAR file to execute. The version will change according to the development code version. For example, the current version may look like `apitest-esignet-1.5.0-SNAPSHOT-jar-with-dependencies.jar`. +- **jar**: Specify the name of the JAR file to execute. The version will change according to the development code version. For example, the current version may look like `apitest-esignet-1.2.1-SNAPSHOT-jar-with-dependencies.jar`. ## Build and Run