diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000000..7f27dbe1ffa --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/registration-processor" + schedule: + interval: "daily" + target-branch: "develop" + open-pull-requests-limit: 50 diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 00000000000..2478af3b03b --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/registration-processor" + schedule: + interval: "daily" + target-branch: "develop" + open-pull-requests-limit: 50 diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml index 3ad84cd5e62..b1de735fc4e 100644 --- a/.github/workflows/push-trigger.yml +++ b/.github/workflows/push-trigger.yml @@ -56,50 +56,65 @@ jobs: - SERVICE_LOCATION: 'registration-processor/post-processor/registration-processor-registration-transaction-service' SERVICE_NAME: 'registration-processor-registration-transaction-service' BUILD_ARTIFACT: 'registration' + SQUASH_LAYERS: '11' - SERVICE_LOCATION: 'registration-processor/stage-groups/registration-processor-stage-group-1' SERVICE_NAME: 'registration-processor-stage-group-1' BUILD_ARTIFACT: 'registration' + SQUASH_LAYERS: '13' - SERVICE_LOCATION: 'registration-processor/stage-groups/registration-processor-stage-group-2' SERVICE_NAME: 'registration-processor-stage-group-2' BUILD_ARTIFACT: 'registration' + SQUASH_LAYERS: '7' - SERVICE_LOCATION: 'registration-processor/stage-groups/registration-processor-stage-group-3' SERVICE_NAME: 'registration-processor-stage-group-3' BUILD_ARTIFACT: 'registration' + SQUASH_LAYERS: '10' - SERVICE_LOCATION: 'registration-processor/stage-groups/registration-processor-stage-group-4' SERVICE_NAME: 'registration-processor-stage-group-4' BUILD_ARTIFACT: 'registration' + SQUASH_LAYERS: '7' - SERVICE_LOCATION: 'registration-processor/stage-groups/registration-processor-stage-group-5' SERVICE_NAME: 'registration-processor-stage-group-5' BUILD_ARTIFACT: 'registration' + SQUASH_LAYERS: '7' - SERVICE_LOCATION: 'registration-processor/stage-groups/registration-processor-stage-group-6' SERVICE_NAME: 'registration-processor-stage-group-6' BUILD_ARTIFACT: 'registration' + SQUASH_LAYERS: '13' - SERVICE_LOCATION: 'registration-processor/stage-groups/registration-processor-stage-group-7' SERVICE_NAME: 'registration-processor-stage-group-7' BUILD_ARTIFACT: 'registration' + SQUASH_LAYERS: '9' - SERVICE_LOCATION: 'registration-processor/core-processor/registration-processor-abis' SERVICE_NAME: 'registration-processor-abis' BUILD_ARTIFACT: 'registration' + SQUASH_LAYERS: '10' - SERVICE_LOCATION: 'registration-processor/workflow-engine/registration-processor-reprocessor' SERVICE_NAME: 'registration-processor-reprocessor' BUILD_ARTIFACT: 'registration' + SQUASH_LAYERS: '10' - SERVICE_LOCATION: 'registration-processor/init/registration-processor-dmz-packet-server' SERVICE_NAME: 'registration-processor-dmz-packet-server' - SERVICE_LOCATION: 'registration-processor/init/registration-processor-registration-status-service' SERVICE_NAME: 'registration-processor-registration-status-service' BUILD_ARTIFACT: 'registration' + SQUASH_LAYERS: '12' - SERVICE_LOCATION: 'registration-processor/registration-processor-notification-service' SERVICE_NAME: 'registration-processor-notification-service' BUILD_ARTIFACT: 'registration' + SQUASH_LAYERS: '10' - SERVICE_LOCATION: 'registration-processor/registration-processor-landing-zone' SERVICE_NAME: 'registration-processor-landing-zone' BUILD_ARTIFACT: 'registration' + SQUASH_LAYERS: '10' - SERVICE_LOCATION: 'registration-processor/workflow-engine/registration-processor-workflow-manager-service' SERVICE_NAME: 'registration-processor-workflow-manager-service' BUILD_ARTIFACT: 'registration' + SQUASH_LAYERS: '10' - SERVICE_LOCATION: 'registration-processor/registration-processor-common-camel-bridge' SERVICE_NAME: 'registration-processor-common-camel-bridge' BUILD_ARTIFACT: 'registration' + SQUASH_LAYERS: '10' fail-fast: false name: ${{ matrix.SERVICE_NAME }} @@ -108,6 +123,7 @@ jobs: SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }} SERVICE_NAME: ${{ matrix.SERVICE_NAME }} BUILD_ARTIFACT: ${{ matrix.BUILD_ARTIFACT || false }} + SQUASH_LAYERS: ${{ matrix.SQUASH_LAYERS }} secrets: DEV_NAMESPACE_DOCKER_HUB: ${{ secrets.DEV_NAMESPACE_DOCKER_HUB }} ACTOR_DOCKER_HUB: ${{ secrets.ACTOR_DOCKER_HUB }} diff --git a/README.md b/README.md index d2d317a9980..666ce8c3c8b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Staged architecture: * Group 2 stages * [Securezone notification](registration-processor/pre-processor/registration-processor-securezone-notification-stage) * [Quality classifier](registration-processor/pre-processor/registration-processor-quality-classifier-stage) - * [Message sender]() + * [Message sender](registration-processor/registration-processor-message-sender-impl) * Group 3 stages * [ABIS handler](registration-processor/core-processor/registration-processor-abis-handler-stage) * [ABIS middleware ](registration-processor/core-processor/registration-processor-abis-middleware-stage) @@ -37,11 +37,11 @@ Staged architecture: * Group 6 stages * [Packet uploader](registration-processor/pre-processor/registration-processor-packet-uploader-stage) * [Packet classifier](registration-processor/pre-processor/registration-processor-packet-classifier-stage) - * Verification + * [Verification](registration-processor/core-processor/registration-processor-verification-stage) * Group 7 stages - * UIN generator - * Biometric extraction - * Finalization + * [UIN generator](registration-processor/core-processor/registration-processor-uin-generator-stage) + * [Biometric extraction](registration-processor/core-processor/registration-processor-biometric-extraction-stage) + * [Finalization](registration-processor/core-processor/registration-processor-finalization-stage) * [Credential requestor](registration-processor/post-processor/registration-processor-credential-requestor-stage) The control and data flow in the stages is controlled by [Workflow engine](registration-processor/workflow-engine/) @@ -53,7 +53,7 @@ Other services: * Transaction service ### Registration flows -An overview of various enrollment scenarious (or flows) is described in [ID Lifecycle Management](https://docs.mosip.io/1.2.0/id-lifecycle-management). Registration Processor recognises the following flows: +An overview of various enrollment scenarios (or flows) is described in [ID Lifecycle Management](https://docs.mosip.io/1.2.0/id-lifecycle-management). Registration Processor recognises the following flows: * New * Update @@ -87,7 +87,7 @@ See [DB guide](db_scripts/README.md) [Packetmanager](https://docs.mosip.io/1.2.0/modules/packet-manager) ## Build & run (for developers) -The project requires JDK 1.11. +The project requires JDK 21.0.3 and mvn version 3.9.6 1. To build jars: ``` $ cd registration @@ -106,16 +106,16 @@ The project requires JDK 1.11. ## Deploy ### Registration processor in sandbox -To deploy Registration Processor services on Kubernetes cluster using Dockers refer to [Sandbox Deployment](https://docs.mosip.io/1.2.0/deployment/sandbox-deployment). +To deploy Registration Processor services on Kubernetes cluster using Dockers refer to [Sandbox Deployment](https://docs.mosip.io/1.2.0/deploymentnew/v3-installation). ## Configuration Refer to the [configuration guide](docs/configuration.md). ## Test -Automated functional tests available in [Functional Tests repo](https://github.com/mosip/mosip-functional-tests) +Automated functional tests available in [DSL Automation](https://github.com/mosip/mosip-automation-tests) ## APIs -API documentation is available [here](https://docs.mosip.io/1.2.0/api) +API documentation is available [here](https://mosip.github.io/documentation/1.2.0/1.2.0.html) ## License This project is licensed under the terms of [Mozilla Public License 2.0](LICENSE). diff --git a/db_upgrade_scripts/mosip_regprc/sql/1.2.0.1_to_1.2.0.2_rollback.sql b/db_upgrade_scripts/mosip_regprc/sql/1.2.0.1_to_1.2.0.2_rollback.sql new file mode 100644 index 00000000000..e69de29bb2d diff --git a/db_upgrade_scripts/mosip_regprc/sql/1.2.0.1_to_1.2.0.2_upgrade.sql b/db_upgrade_scripts/mosip_regprc/sql/1.2.0.1_to_1.2.0.2_upgrade.sql new file mode 100644 index 00000000000..e69de29bb2d diff --git a/deploy/copy_cm.sh b/deploy/copy_cm.sh index 7476af4379b..acf46ec64b6 100755 --- a/deploy/copy_cm.sh +++ b/deploy/copy_cm.sh @@ -3,7 +3,7 @@ # DST_NS: Destination namespace function copying_cm() { - UTIL_URL=https://github.com/mosip/mosip-infra/blob/master/deployment/v3/utils/copy_cm_func.sh + UTIL_URL=https://raw.githubusercontent.com/mosip/mosip-infra/master/deployment/v3/utils/copy_cm_func.sh COPY_UTIL=./copy_cm_func.sh DST_NS=regproc diff --git a/helm/regproc-camel/templates/deployment.yaml b/helm/regproc-camel/templates/deployment.yaml index 9379532d55c..e5077a9ed48 100644 --- a/helm/regproc-camel/templates/deployment.yaml +++ b/helm/regproc-camel/templates/deployment.yaml @@ -106,8 +106,10 @@ spec: {{- end }} {{- end }} {{- if .Values.extraEnvVarsSecret }} + {{- range .Values.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + name: {{ . }} + {{- end }} {{- end }} ports: - name: spring-service diff --git a/helm/regproc-camel/values.yaml b/helm/regproc-camel/values.yaml index 3c5265a3d0c..0c22e5bf380 100644 --- a/helm/regproc-camel/values.yaml +++ b/helm/regproc-camel/values.yaml @@ -252,7 +252,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## diff --git a/helm/regproc-group1/templates/deployment.yaml b/helm/regproc-group1/templates/deployment.yaml index 72c577428fa..8dd874df6df 100644 --- a/helm/regproc-group1/templates/deployment.yaml +++ b/helm/regproc-group1/templates/deployment.yaml @@ -104,8 +104,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: landing-folder diff --git a/helm/regproc-group1/values.yaml b/helm/regproc-group1/values.yaml index 33f2f2bcee5..5dff7a3a590 100644 --- a/helm/regproc-group1/values.yaml +++ b/helm/regproc-group1/values.yaml @@ -252,7 +252,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## @@ -288,7 +288,8 @@ sidecars: {} persistence: enabled: true - storageClass: longhorn + storageClass: nfs-csi + # Adding this for Reference Implementation. ## If defined, storageClassName: ## If set to "-", storageClassName: "", which disables dynamic provisioning ## If undefined (the default) or set to null, no storageClassName spec is diff --git a/helm/regproc-group2/templates/deployment.yaml b/helm/regproc-group2/templates/deployment.yaml index b48f65b45ba..fe1aece1f58 100644 --- a/helm/regproc-group2/templates/deployment.yaml +++ b/helm/regproc-group2/templates/deployment.yaml @@ -104,8 +104,10 @@ spec: {{- end }} {{- end }} {{- if .Values.extraEnvVarsSecret }} + {{- range .Values.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + name: {{ . }} + {{- end }} {{- end }} ports: [] {{- if .Values.resources }} diff --git a/helm/regproc-group2/values.yaml b/helm/regproc-group2/values.yaml index f4320d4aca9..130b42d3168 100644 --- a/helm/regproc-group2/values.yaml +++ b/helm/regproc-group2/values.yaml @@ -257,7 +257,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## diff --git a/helm/regproc-group3/templates/deployment.yaml b/helm/regproc-group3/templates/deployment.yaml index e407f7aafd3..38214607393 100644 --- a/helm/regproc-group3/templates/deployment.yaml +++ b/helm/regproc-group3/templates/deployment.yaml @@ -104,8 +104,10 @@ spec: {{- end }} {{- end }} {{- if .Values.extraEnvVarsSecret }} + {{- range .Values.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + name: {{ . }} + {{- end }} {{- end }} ports: [] {{- if .Values.resources }} diff --git a/helm/regproc-group3/values.yaml b/helm/regproc-group3/values.yaml index eca2abb497a..7a162579acf 100644 --- a/helm/regproc-group3/values.yaml +++ b/helm/regproc-group3/values.yaml @@ -256,7 +256,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## diff --git a/helm/regproc-group4/templates/deployment.yaml b/helm/regproc-group4/templates/deployment.yaml index 26df667980f..bc7f0b757ab 100644 --- a/helm/regproc-group4/templates/deployment.yaml +++ b/helm/regproc-group4/templates/deployment.yaml @@ -104,8 +104,10 @@ spec: {{- end }} {{- end }} {{- if .Values.extraEnvVarsSecret }} + {{- range .Values.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + name: {{ . }} + {{- end }} {{- end }} ports: [] {{- if .Values.resources }} diff --git a/helm/regproc-group4/values.yaml b/helm/regproc-group4/values.yaml index 81df744cb25..d8b54839ed2 100644 --- a/helm/regproc-group4/values.yaml +++ b/helm/regproc-group4/values.yaml @@ -255,7 +255,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## diff --git a/helm/regproc-group5/templates/deployment.yaml b/helm/regproc-group5/templates/deployment.yaml index 67dc6ac3760..0ee5f826782 100644 --- a/helm/regproc-group5/templates/deployment.yaml +++ b/helm/regproc-group5/templates/deployment.yaml @@ -104,8 +104,10 @@ spec: {{- end }} {{- end }} {{- if .Values.extraEnvVarsSecret }} + {{- range .Values.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + name: {{ . }} + {{- end }} {{- end }} ports: [] {{- if .Values.resources }} diff --git a/helm/regproc-group5/values.yaml b/helm/regproc-group5/values.yaml index ae5a75a0596..b2f216a9a84 100644 --- a/helm/regproc-group5/values.yaml +++ b/helm/regproc-group5/values.yaml @@ -255,7 +255,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## diff --git a/helm/regproc-group6/templates/deployment.yaml b/helm/regproc-group6/templates/deployment.yaml index 477dcada6f2..c864d722a73 100644 --- a/helm/regproc-group6/templates/deployment.yaml +++ b/helm/regproc-group6/templates/deployment.yaml @@ -104,8 +104,10 @@ spec: {{- end }} {{- end }} {{- if .Values.extraEnvVarsSecret }} + {{- range .Values.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + name: {{ . }} + {{- end }} {{- end }} ports: [] {{- if .Values.resources }} @@ -128,4 +130,4 @@ spec: {{- end }} {{- if .Values.sidecars }} {{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }} - {{- end }} + {{- end }} \ No newline at end of file diff --git a/helm/regproc-group6/values.yaml b/helm/regproc-group6/values.yaml index 7721f6e08f9..9a48e51b565 100644 --- a/helm/regproc-group6/values.yaml +++ b/helm/regproc-group6/values.yaml @@ -255,7 +255,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## diff --git a/helm/regproc-group7/templates/deployment.yaml b/helm/regproc-group7/templates/deployment.yaml index cfdba592280..7887afdb65b 100644 --- a/helm/regproc-group7/templates/deployment.yaml +++ b/helm/regproc-group7/templates/deployment.yaml @@ -104,8 +104,10 @@ spec: {{- end }} {{- end }} {{- if .Values.extraEnvVarsSecret }} + {{- range .Values.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + name: {{ . }} + {{- end }} {{- end }} ports: [] {{- if .Values.resources }} diff --git a/helm/regproc-group7/values.yaml b/helm/regproc-group7/values.yaml index 5bbe039d4dd..eb785565877 100644 --- a/helm/regproc-group7/values.yaml +++ b/helm/regproc-group7/values.yaml @@ -256,7 +256,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## diff --git a/helm/regproc-landingzone/templates/deployment.yaml b/helm/regproc-landingzone/templates/deployment.yaml index 3f7d3f19018..f5a85079533 100644 --- a/helm/regproc-landingzone/templates/deployment.yaml +++ b/helm/regproc-landingzone/templates/deployment.yaml @@ -104,8 +104,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: landing-folder diff --git a/helm/regproc-landingzone/values.yaml b/helm/regproc-landingzone/values.yaml index cb47cee36d7..cc7935cd531 100644 --- a/helm/regproc-landingzone/values.yaml +++ b/helm/regproc-landingzone/values.yaml @@ -253,7 +253,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## diff --git a/helm/regproc-notifier/templates/deployment.yaml b/helm/regproc-notifier/templates/deployment.yaml index f0d1bf0e7c9..414492bd194 100644 --- a/helm/regproc-notifier/templates/deployment.yaml +++ b/helm/regproc-notifier/templates/deployment.yaml @@ -104,8 +104,10 @@ spec: {{- end }} {{- end }} {{- if .Values.extraEnvVarsSecret }} + {{- range .Values.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + name: {{ . }} + {{- end }} {{- end }} ports: - name: spring-service diff --git a/helm/regproc-notifier/values.yaml b/helm/regproc-notifier/values.yaml index bdfc4d736a2..e20056165b5 100644 --- a/helm/regproc-notifier/values.yaml +++ b/helm/regproc-notifier/values.yaml @@ -252,7 +252,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## diff --git a/helm/regproc-opencrvs/.gitignore b/helm/regproc-opencrvs/.gitignore deleted file mode 100644 index b3c94bf6431..00000000000 --- a/helm/regproc-opencrvs/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -charts/ -Charts.lock diff --git a/helm/regproc-opencrvs/Chart.yaml b/helm/regproc-opencrvs/Chart.yaml deleted file mode 100644 index ada09339ed7..00000000000 --- a/helm/regproc-opencrvs/Chart.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v2 -name: regproc-opencrvs -description: A Helm chart for mosip regproc-opencrvs stage. -type: application -version: 0.0.1-develop -appVersion: "" -home: https://mosip.io -dependencies: -- name: common - repository: https://charts.bitnami.com/bitnami - tags: - - bitnami-common - version: 1.x.x -keywords: - - mosip - - mosip-opencrvs-mediator - - opencrvs-mediator - - regproc-opencrvs - - regproc-opencrvs-stage - - opencrvs -maintainers: - - email: info@mosip.io - name: MOSIP diff --git a/helm/regproc-opencrvs/README.md b/helm/regproc-opencrvs/README.md deleted file mode 100644 index 54463a6a005..00000000000 --- a/helm/regproc-opencrvs/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# MOSIP Regproc Opencrvs Stage - -Helm chart for installing for Regproc Opencrvs Stage. - -## Install - -```console -$ helm repo add mosip https://mosip.github.io -$ helm install my-release mosip/regproc-opencrvs -``` diff --git a/helm/regproc-opencrvs/templates/NOTES.txt b/helm/regproc-opencrvs/templates/NOTES.txt deleted file mode 100644 index 4f4b86dd60e..00000000000 --- a/helm/regproc-opencrvs/templates/NOTES.txt +++ /dev/null @@ -1 +0,0 @@ -Installation done diff --git a/helm/regproc-opencrvs/templates/_helpers.tpl b/helm/regproc-opencrvs/templates/_helpers.tpl deleted file mode 100644 index 5b95557caad..00000000000 --- a/helm/regproc-opencrvs/templates/_helpers.tpl +++ /dev/null @@ -1,58 +0,0 @@ -{{/* -Return the proper image name -*/}} -{{- define "regprocOpencrvs.image" -}} -{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }} -{{- end -}} - -{{/* -Return the proper image name (for the init container volume-permissions image) -*/}} -{{- define "regprocOpencrvs.volumePermissions.image" -}} -{{- include "common.images.image" ( dict "imageRoot" .Values.volumePermissions.image "global" .Values.global ) -}} -{{- end -}} - -{{/* -Return the proper Docker Image Registry Secret Names -*/}} -{{- define "regprocOpencrvs.imagePullSecrets" -}} -{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.volumePermissions.image) "global" .Values.global) -}} -{{- end -}} - -{{/* -Create the name of the service account to use -*/}} -{{- define "regprocOpencrvs.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} - {{ default (printf "%s-foo" (include "common.names.fullname" .)) .Values.serviceAccount.name }} -{{- else -}} - {{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} - -{{/* -Compile all warnings into a single message. -*/}} -{{- define "regprocOpencrvs.validateValues" -}} -{{- $messages := list -}} -{{- $messages := append $messages (include "regprocOpencrvs.validateValues.foo" .) -}} -{{- $messages := append $messages (include "regprocOpencrvs.validateValues.bar" .) -}} -{{- $messages := without $messages "" -}} -{{- $message := join "\n" $messages -}} - -{{- if $message -}} -{{- printf "\nVALUES VALIDATION:\n%s" $message -}} -{{- end -}} -{{- end -}} - -{{/* -Return podAnnotations -*/}} -{{- define "regprocOpencrvs.podAnnotations" -}} -{{- if .Values.podAnnotations }} -{{ include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) }} -{{- end }} -{{- if and .Values.metrics.enabled .Values.metrics.podAnnotations }} -{{ include "common.tplvalues.render" (dict "value" .Values.metrics.podAnnotations "context" $) }} -{{- end }} -{{- end -}} diff --git a/helm/regproc-opencrvs/templates/deployment.yaml b/helm/regproc-opencrvs/templates/deployment.yaml deleted file mode 100644 index dda98b1b823..00000000000 --- a/helm/regproc-opencrvs/templates/deployment.yaml +++ /dev/null @@ -1,144 +0,0 @@ -apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} -kind: Deployment -metadata: - name: {{ template "common.names.fullname" . }} - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - replicas: {{ .Values.replicaCount }} - {{- if .Values.updateStrategy }} - strategy: - {{- toYaml .Values.updateStrategy | nindent 4 }} - {{- end }} - selector: - matchLabels: - {{- include "common.labels.matchLabels" . | nindent 6 }} - template: - metadata: - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 8 }} - {{- end }} - {{- if .Values.podAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.podAnnotations "context" $ ) | nindent 8 }} - {{- end }} - labels: - {{- include "common.labels.standard" . | nindent 8 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.podLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.podLabels "context" $ ) | nindent 8 }} - {{- end }} - spec: - serviceAccountName: {{- include "regprocOpencrvs.serviceAccountName" . | nindent 8 }} - {{- include "regprocOpencrvs.imagePullSecrets" . | nindent 6 }} - {{- if .Values.hostAliases }} - hostAliases: - {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.affinity }} - affinity: - {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" $) | nindent 8 }} - {{- else }} - affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }} - nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} - {{- end }} - {{- if .Values.nodeSelector }} - nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.nodeSelector "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.tolerations }} - tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }} - {{- end }} - {{- if .Values.priorityClassName }} - priorityClassName: {{ .Values.priorityClassName | quote }} - {{- end }} - {{- if .Values.podSecurityContext.enabled }} - securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} - {{- end }} - initContainers: - {{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }} - - name: volume-permissions - image: {{- include "regprocOpencrvs.volumePermissions.image" . }} - imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }} - command: - - %%commands%% - securityContext: - runAsUser: 0 - {{- if .Values.volumePermissions.resources }} - resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }} - {{- end }} - volumeMounts: - - name: foo - mountPath: bar - {{- end }} - {{- if .Values.initContainers }} - {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} - {{- end }} - containers: - - name: regproc-opencrvs - image: {{ template "regprocOpencrvs.image" . }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if .Values.lifecycleHooks }} - lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.containerSecurityContext.enabled }} - securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} - {{- end }} - {{- if .Values.command }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.args }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} - {{- end }} - env: - {{- if .Values.extraEnvVars }} - {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} - {{- end }} - - envFrom: - {{- if .Values.extraEnvVarsCM }} - {{- range .Values.extraEnvVarsCM }} - - configMapRef: - name: {{ . }} - {{- end }} - {{- end }} - {{- if .Values.extraEnvVarsSecret }} - {{- range .Values.extraEnvVarsSecret }} - - secretRef: - name: {{ . }} - {{- end }} - {{- end }} - ports: - - name: container-port - containerPort: {{ .Values.containerPort }} - {{- if .Values.resources }} - resources: {{- toYaml .Values.resources | nindent 12 }} - {{- end }} - {{- if .Values.startupProbe.enabled }} - startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.startupProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customStartupProbe }} - startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.livenessProbe.enabled }} - livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.livenessProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customLivenessProbe }} - livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.readinessProbe.enabled }} - readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readinessProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customReadinessProbe }} - readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.sidecars }} - {{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }} - {{- end }} diff --git a/helm/regproc-opencrvs/templates/extra-list.yaml b/helm/regproc-opencrvs/templates/extra-list.yaml deleted file mode 100644 index 9ac65f9e16f..00000000000 --- a/helm/regproc-opencrvs/templates/extra-list.yaml +++ /dev/null @@ -1,4 +0,0 @@ -{{- range .Values.extraDeploy }} ---- -{{ include "common.tplvalues.render" (dict "value" . "context" $) }} -{{- end }} diff --git a/helm/regproc-opencrvs/templates/service-account.yaml b/helm/regproc-opencrvs/templates/service-account.yaml deleted file mode 100644 index f827cd277a0..00000000000 --- a/helm/regproc-opencrvs/templates/service-account.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ template "regprocOpencrvs.serviceAccountName" . }} - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - namespace: {{ .Release.Namespace }} diff --git a/helm/regproc-opencrvs/templates/service.yaml b/helm/regproc-opencrvs/templates/service.yaml deleted file mode 100644 index 20cb4931d34..00000000000 --- a/helm/regproc-opencrvs/templates/service.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "common.names.fullname" . }} - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - type: {{ .Values.service.type }} - {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} - externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} - {{- end }} - {{ if eq .Values.service.type "LoadBalancer" }} - loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }} - {{ end }} - {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} - loadBalancerIP: {{ .Values.service.loadBalancerIP }} - {{- end }} - ports: - - name: http - port: {{ .Values.service.port }} - protocol: TCP - targetPort: {{ .Values.containerPort }} - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} diff --git a/helm/regproc-opencrvs/templates/servicemonitor.yaml b/helm/regproc-opencrvs/templates/servicemonitor.yaml deleted file mode 100644 index 64db5089ac8..00000000000 --- a/helm/regproc-opencrvs/templates/servicemonitor.yaml +++ /dev/null @@ -1,39 +0,0 @@ -{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: {{ template "common.names.fullname" . }} - {{- if .Values.metrics.serviceMonitor.namespace }} - namespace: {{ .Values.metrics.serviceMonitor.namespace }} - {{- end }} - labels: - {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.metrics.serviceMonitor.additionalLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.additionalLabels "context" $) | nindent 4 }} - {{- end }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - endpoints: - - targetPort: {{ .Values.containerPort }} - path: {{ .Values.metrics.endpointPath }} - {{- if .Values.metrics.serviceMonitor.interval }} - interval: {{ .Values.metrics.serviceMonitor.interval }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} - scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.honorLabels }} - honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.relabellings }} - metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.relabellings | nindent 6 }} - {{- end }} - namespaceSelector: - matchNames: - - {{ .Release.Namespace | quote }} - selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} -{{- end }} diff --git a/helm/regproc-opencrvs/values.yaml b/helm/regproc-opencrvs/values.yaml deleted file mode 100644 index bf7b67369bf..00000000000 --- a/helm/regproc-opencrvs/values.yaml +++ /dev/null @@ -1,400 +0,0 @@ -## Global Docker image parameters -## Please, note that this will override the image parameters, including dependencies, configured to use the global value -## Current available global Docker image parameters: imageRegistry and imagePullSecrets -## -# global: -# imageRegistry: myRegistryName -# imagePullSecrets: -# - myRegistryKeySecretName -# storageClass: myStorageClass - -## Add labels to all the deployed resources -## -commonLabels: {} - -## Add annotations to all the deployed resources -## -commonAnnotations: {} - -## Kubernetes Cluster Domain -## -clusterDomain: cluster.local - -## Extra objects to deploy (value evaluated as a template) -## -extraDeploy: [] - -## Number of nodes -## -replicaCount: 1 - -service: - type: ClusterIP - port: 80 - ## loadBalancerIP for the SuiteCRM Service (optional, cloud specific) - ## ref: http://kubernetes.io/docs/user-guide/services/#type-loadbalancer - ## - ## loadBalancerIP: - ## - ## nodePorts: - ## http: - ## https: - ## - nodePorts: - http: "" - https: "" - ## Enable client source IP preservation - ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip - ## - externalTrafficPolicy: Cluster - -image: - registry: docker.io - repository: mosipqa/registration-processor-opencrvs-stage - tag: develop - ## Specify a imagePullPolicy - ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' - ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - pullPolicy: Always - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## - pullSecrets: [] - # - myRegistryKeySecretName - -## Port on which this particular spring service module is running. -containerPort: 4545 - -## Configure extra options for liveness and readiness probes -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes -## -startupProbe: - enabled: true - httpGet: - path: "/registrationprocessor/v1/opencrvs-stage/actuator/health" - port: 8045 - initialDelaySeconds: 0 - periodSeconds: 30 - timeoutSeconds: 5 - failureThreshold: 10 - successThreshold: 1 - -livenessProbe: - enabled: true - httpGet: - path: "/registrationprocessor/v1/opencrvs-stage/actuator/health" - port: 8045 - initialDelaySeconds: 20 - periodSeconds: 60 - timeoutSeconds: 5 - failureThreshold: 2 - successThreshold: 1 - -readinessProbe: - enabled: true - httpGet: - path: "/registrationprocessor/v1/opencrvs-stage/actuator/health" - port: 8045 - initialDelaySeconds: 0 - periodSeconds: 20 - timeoutSeconds: 5 - failureThreshold: 2 - successThreshold: 1 - -## -# existingConfigmap: - -## Command and args for running the container (set to default if not set). Use array form -## -command: [] -args: [] - -## Deployment pod host aliases -## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/ -## -hostAliases: [] - -## ref: http://kubernetes.io/docs/user-guide/compute-resources/ -## -resources: - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - limits: {} - # cpu: 200m - # memory: 256Mi - requests: {} - # cpu: 100m - # memory: 1500Mi - -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container -containerSecurityContext: - enabled: false - runAsUser: mosip - runAsNonRoot: true - -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod -## -podSecurityContext: - enabled: false - fsGroup: 1001 - -## Pod affinity preset -## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## Allowed values: soft, hard -## -podAffinityPreset: "" - -## Pod anti-affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## Allowed values: soft, hard -## -podAntiAffinityPreset: soft - -## Node affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity -## Allowed values: soft, hard -## -nodeAffinityPreset: - ## Node affinity type - ## Allowed values: soft, hard - ## - type: "" - ## Node label key to match - ## E.g. - ## key: "kubernetes.io/e2e-az-name" - ## - key: "" - ## Node label values to match - ## E.g. - ## values: - ## - e2e-az1 - ## - e2e-az2 - ## - values: [] - -## Affinity for pod assignment. Evaluated as a template. -## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity -## -affinity: {} - -## Node labels for pod assignment. Evaluated as a template. -## ref: https://kubernetes.io/docs/user-guide/node-selection/ -## -nodeSelector: {} - -## Tolerations for pod assignment. Evaluated as a template. -## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ -## -tolerations: [] - -## Pod extra labels -## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ -## -podLabels: {} - -## Annotations for server pods. -## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ -## -podAnnotations: {} - -## pods' priority. -## ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ -## -priorityClassName: "" - -## lifecycleHooks for the container to automate configuration before or after startup. -## -lifecycleHooks: {} - -## Custom Liveness probes for -## -customLivenessProbe: {} - -## Custom Rediness probes -## -customReadinessProbe: {} - -## Update strategy - only really applicable for deployments with RWO PVs attached -## If replicas = 1, an update can get "stuck", as the previous pod remains attached to the -## PV, and the "incoming" pod can never start. Changing the strategy to "Recreate" will -## terminate the single previous pod, so that the new, incoming pod can attach to the PV -## -updateStrategy: - type: RollingUpdate - -## Additional environment variables to set -## Example: -## extraEnvVars: -## - name: FOO -## value: "bar" -## -extraEnvVars: [] - -## ConfigMap with extra environment variables -## -extraEnvVarsCM: - - global - - config-server-share - - artifactory-share - -## Secret with extra environment variables -## -extraEnvVarsSecret: [] - -## Extra volumes to add to the deployment -## -extraVolumes: [] - -## Extra volume mounts to add to the container -## -extraVolumeMounts: [] - -## Add init containers to the pods. -## Example: -## initContainers: -## - name: your-image-name -## image: your-image -## imagePullPolicy: Always -## ports: -## - name: portname -## containerPort: 1234 -## -initContainers: {} - -## Add sidecars to the pods. -## Example: -## sidecars: -## - name: your-image-name -## image: your-image -## imagePullPolicy: Always -## ports: -## - name: portname -## containerPort: 1234 -## -sidecars: {} - -persistence: - enabled: false - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack). - ## - # storageClass: "-" - ## - ## If you want to reuse an existing claim, you can pass the name of the PVC using - ## the existingClaim variable - # existingClaim: your-claim - ## ReadWriteMany not supported by AWS gp2 - storageClass: - accessModes: - - ReadWriteOnce - size: 10M - existingClaim: - # Dir where config and keys are written inside container - mountDir: - -## Init containers parameters: -## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section. -## -volumePermissions: - enabled: false - image: - registry: docker.io - repository: bitnami/bitnami-shell - tag: "10" - pullPolicy: Always - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## - pullSecrets: [] - ## - myRegistryKeySecretName - ## Init containers' resource requests and limits - ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ - ## - resources: - ## We usually recommend not to specify default resources and to leave this as a conscious - ## choice for the user. This also increases chances charts run on environments with little - ## resources, such as Minikube. If you do want to specify resources, uncomment the following - ## lines, adjust them as necessary, and remove the curly braces after 'resources:'. - ## - limits: {} - ## cpu: 100m - ## memory: 128Mi - ## - requests: {} - ## cpu: 100m - ## memory: 128Mi - ## - -## Specifies whether a ServiceAccount should be created -## -serviceAccount: - create: true - ## The name of the ServiceAccount to use. - ## If not set and create is true, a name is generated using the fullname template - ## - name: - -## Prometheus Metrics -## -metrics: - enabled: true - ## Prometheus pod annotations - ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - ## - podAnnotations: - prometheus.io/scrape: "true" - - endpointPath: /registrationprocessor/v1/opencrvs-stage/actuator/prometheus - - ## Prometheus Service Monitor - ## ref: https://github.com/coreos/prometheus-operator - ## - serviceMonitor: - ## If the operator is installed in your cluster, set to true to create a Service Monitor Entry - ## - enabled: true - ## Specify the namespace in which the serviceMonitor resource will be created - ## - # namespace: "" - ## Specify the interval at which metrics should be scraped - ## - interval: 10s - ## Specify the timeout after which the scrape is ended - ## - # scrapeTimeout: 30s - ## Specify Metric Relabellings to add to the scrape endpoint - ## - # relabellings: - ## Specify honorLabels parameter to add the scrape endpoint - ## - honorLabels: false - ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with - ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec - ## - additionalLabels: {} - - ## Custom PrometheusRule to be defined - ## The value is evaluated as a template, so, for example, the value can depend on .Release or .Chart - ## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions - ## - prometheusRule: - enabled: false - additionalLabels: {} - namespace: '' - ## List of rules, used as template by Helm. - ## These are just examples rules inspired from https://awesome-prometheus-alerts.grep.to/rules.html - # rules: - # - alert: RabbitmqDown - # expr: rabbitmq_up{service="{{ template "rabbitmq.fullname" . }}"} == 0 - # for: 5m - # labels: - # severity: error - rules: [] diff --git a/helm/regproc-pktserver/templates/deployment.yaml b/helm/regproc-pktserver/templates/deployment.yaml index 0b9f844b771..56d278c7700 100644 --- a/helm/regproc-pktserver/templates/deployment.yaml +++ b/helm/regproc-pktserver/templates/deployment.yaml @@ -104,8 +104,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: landing-folder diff --git a/helm/regproc-pktserver/values.yaml b/helm/regproc-pktserver/values.yaml index 36105c80603..be779a86933 100644 --- a/helm/regproc-pktserver/values.yaml +++ b/helm/regproc-pktserver/values.yaml @@ -259,7 +259,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## diff --git a/helm/regproc-reprocess/templates/deployment.yaml b/helm/regproc-reprocess/templates/deployment.yaml index 7f107a87d9e..5048dfb4a4b 100644 --- a/helm/regproc-reprocess/templates/deployment.yaml +++ b/helm/regproc-reprocess/templates/deployment.yaml @@ -102,8 +102,10 @@ spec: {{- end }} {{- end }} {{- if .Values.extraEnvVarsSecret }} + {{- range .Values.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + name: {{ . }} + {{- end }} {{- end }} ports: - name: spring-service diff --git a/helm/regproc-reprocess/values.yaml b/helm/regproc-reprocess/values.yaml index 39c551f8bbf..75c7dddf5b0 100644 --- a/helm/regproc-reprocess/values.yaml +++ b/helm/regproc-reprocess/values.yaml @@ -252,7 +252,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## diff --git a/helm/regproc-salt/templates/job.yaml b/helm/regproc-salt/templates/job.yaml index b09f743cf8b..4ffd37ed58b 100644 --- a/helm/regproc-salt/templates/job.yaml +++ b/helm/regproc-salt/templates/job.yaml @@ -78,6 +78,8 @@ spec: {{- end }} {{- end }} {{- if .Values.extraEnvVarsSecret }} + {{- range .Values.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + name: {{ . }} + {{- end }} {{- end }} diff --git a/helm/regproc-salt/values.yaml b/helm/regproc-salt/values.yaml index e2175bf627d..c5a47358702 100644 --- a/helm/regproc-salt/values.yaml +++ b/helm/regproc-salt/values.yaml @@ -191,7 +191,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## diff --git a/helm/regproc-status/templates/deployment.yaml b/helm/regproc-status/templates/deployment.yaml index 6be3e6055d7..37fb11c401a 100644 --- a/helm/regproc-status/templates/deployment.yaml +++ b/helm/regproc-status/templates/deployment.yaml @@ -114,8 +114,10 @@ spec: {{- end }} {{- end }} {{- if .Values.extraEnvVarsSecret }} + {{- range .Values.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + name: {{ . }} + {{- end }} {{- end }} ports: - name: spring-service diff --git a/helm/regproc-status/values.yaml b/helm/regproc-status/values.yaml index ea3cf5060f3..f162d089df3 100644 --- a/helm/regproc-status/values.yaml +++ b/helm/regproc-status/values.yaml @@ -254,7 +254,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## diff --git a/helm/regproc-trans/templates/deployment.yaml b/helm/regproc-trans/templates/deployment.yaml index b4e08599512..d71e978f6f2 100644 --- a/helm/regproc-trans/templates/deployment.yaml +++ b/helm/regproc-trans/templates/deployment.yaml @@ -114,8 +114,10 @@ spec: {{- end }} {{- end }} {{- if .Values.extraEnvVarsSecret }} + {{- range .Values.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + name: {{ . }} + {{- end }} {{- end }} ports: - name: spring-service diff --git a/helm/regproc-trans/values.yaml b/helm/regproc-trans/values.yaml index e35aa4a2043..f844077b2fb 100644 --- a/helm/regproc-trans/values.yaml +++ b/helm/regproc-trans/values.yaml @@ -254,7 +254,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## diff --git a/helm/regproc-workflow/templates/deployment.yaml b/helm/regproc-workflow/templates/deployment.yaml index f7934d62696..11d762a0c41 100644 --- a/helm/regproc-workflow/templates/deployment.yaml +++ b/helm/regproc-workflow/templates/deployment.yaml @@ -104,8 +104,10 @@ spec: {{- end }} {{- end }} {{- if .Values.extraEnvVarsSecret }} + {{- range .Values.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + name: {{ . }} + {{- end }} {{- end }} ports: - name: spring-service diff --git a/helm/regproc-workflow/values.yaml b/helm/regproc-workflow/values.yaml index 36deae02202..f8cf9fe4226 100644 --- a/helm/regproc-workflow/values.yaml +++ b/helm/regproc-workflow/values.yaml @@ -253,7 +253,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## diff --git a/performance-test/README.md b/performance-test/README.md new file mode 100644 index 00000000000..c468217e238 --- /dev/null +++ b/performance-test/README.md @@ -0,0 +1,137 @@ +### Contains +* This folder contains 2 different Jmeter sscripts + Script 1. Packet creator script to create packets [Packet_Creator_Script.jmx] + Script 2. Scenario-based results scripts for Packet and Credential Processing [Results_Script.jmx] + +*List of Thread Groups in script 1: + * 01 Auth Token Generation (Preparation) + * 02 Packet Generation (Preparation) + * 03 Packet Creator Rid Sync (Preparation) + * 04 Sync And Upload Registration Packet (Preparation) + +*List of Thread Groups in script 2: + * S01 Secure Zone To Upload Packet (Results) + * S02 Upload Packet To Validate Packet (Results) + * S03 Validate Packet To Packet Classification (Results) + * S04 Packet Classification To CMD Validation (Results) + * S05 CMD Validation To Operator Validation (Results) + * S06 Operator Validation To Supervisor Validation (Results) + * S07 Supervisor Validation To Quality Classifiier (Results) + * S08 Quality Classifiier To Demographic Verification (Results) + * S09 Demographic Verification To Biographic Verification (Results) + * S10 Biographic Verification To UIN Generation (Results) + * S11 UIN Generation To Biometric Extraction (Results) + * S12 Biometric Extraction To Finalization (Results) + * S13 Finalization To Print Service (Results) + * S14 Print Service To Internal Workflow Action (Results) + * S15 Complete Reg Proc Packet Processing (Results) + * S16 End to End Packet and Credential Processing (Results) + * S17 Overall Status Of The Packets (Results) + +* Open source tools used, + 1. [Apache JMeter](https://jmeter.apache.org/) + +Pre-requisite to install the plugins: +1. Download JMeter Plugin Manager jar file with following link. "https://jmeter-plugins.org/get/" +2. Place the jar file under following JMeter folder path. +3. After adding the plugin restart the JMeter +4. To download the necessary plugins, we have to click on the Plugin’s Manager. It will re-direct to list of available plugins. Choose the above mentioned plugin "jmeter-plugins-synthesis" to install and then restart the JMeter. + +### Setup points before execution + +* We need some jmeter plugin files that needs to be installed before opening of this script, PFA dependency links for your reference : + * jmeter-plugins-synthesis-2.2.jar + * + +### How to run performance scripts using Apache JMeter tool +* Download Apache JMeter from https://jmeter.apache.org/download_jmeter.cgi +* Download scripts for the required module. +* Place the support files in the bin folder of the jmeter, the paths in the scripts are defined to fetch the testdata from the bin folder. +* Start JMeter by running the jmeter.bat file for Windows or jmeter file for Unix. +* Validate the scripts for one user. +* Execute a dry run for 10 min. +* Execute performance run with various loads in order to achieve targeted NFR's. + +### Installation of Packet Utility as a pre-requisite: + +*The mentioned service is pre-requisite for Reg proc module and must be running in the system as it is used to create packets. + +*Path for Packet Utility : https://github.com/mosip/mosip-automation-tests/tree/master/mosip-packet-creator/src/main/resources/dockersupport/centralized + +*Readme file is present to follow the steps : https://github.com/mosip/mosip-automation-tests/blob/master/README.md + +*For generating the packets, packet utility is required. + Step 1 - Packet utility setup. + Step 2 - We need device partner and device dsk partner certificate to be present in the auth certs. + Step 3 - For packet generation, need to create context for it. Will require api-internal.qa-platform1.mosip.net.12117.reg.key provided by the team or we can generate it from the dsl setup. + Step 4 - Update the secret keys for all the client's, user id, machine id and center id in create context. Also, update the mountPath and authCertsPath path variable. + Step 5 - Create packet. + +*Once the packet utility is up and running pls check this swagger link + Swagger link - http://localhost:8080/v1/packetcreator/swagger-ui.html#/packet-controller + +*To run packet utility use following command as reference: + +java -jar -Dfile.encoding=UTF-8 -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=9999,suspend=n -jar dslrig-packetcreator-1.2.1-develop-SNAPSHOT.jar --spring.config.location=file:///C:\Users\61091460\Documents\centralized\mosip-packet-creator\config\application.properties>>C:\Users\61091460\Documents\centralized\mosip-packet-creator\PacketUtilityRunlog.txt + +### Test Setup for Script 1 + 1. The centers, machines and users should be onboarded in the system before using as part of context_details.csv + 2. Add the document path of (document.pdf) prsent in the support-files folder to the file document_path.txt + 3. The mosip-packet-creator and mount volume folders need to be present with the latest jar. + 4. From the terminal run the command to start mosip-packet-creator as mentioned in above steps. + 5. Open the [Packet_Creator_Script.jmx] script and run the Auth Token Generation (Setup) thread group. + 6. Excute Packet Generation (Setup) thread group by spcifying the no of packets it need to generate. + 7. Sync the packets to reg client using Sync Registration Packet (Setup) thread group. + 8. Finally Sync And Upload Registration Packet (Preparation) thread group for uploading the packets. + +### Description of thread groups from script 1: + + *01 Auth Token Generation (Setup) - In this thread we are creating the authorization token values of Regpoc, Resident and Regproc - Using User Id which will be saved to a file in the Run Time Files in bin folder of JMeter. + + *02 Packet Generation (Setup) - In this thread group we will basically create the context with the help of existing center id's, machine id's & user id's present in our current environment & we will read them through a file named contextDetails.csv. Once the contexts are created we will use the same in the execution thread group where basically the packet generation happens & then the packet path gets stored in a file naming as Run Time Files in bin folder of JMeter. + + *03 Sync Registration Packet (Setup) - To create encrypted data for generated packets(test data to registration processor sync API). Which will basically create a file with the encrypted data's for all the packets created. + + *04 Sync And Upload Registration Packet (Preparation) : This step will sync and upload the generated packets to the registration processor. + +### Test Setup for Script 2: + + 1. From S01 to S17 thread groups will be run after the completion of the test which means most packets have finished processing. These are queries to the database which determine the reponse times between each stage and also the overall performance. + 2. List of RID's will be required as per environment which is valid and will be prepared while sync and upload to reg proc was run as part of script 1. + 3. Execute the Script 2 with all thread groups enabled, so that it will start printing the results in the aggregate report. + +### Description of the thread groups from script 2: + + * S01 Secure Zone To Upload Packet: Ensuring the packet is uploaded securely. + + * S02 Upload Packet To Validate Packet: Verifying the integrity and authenticity of the uploaded packet. + + * S03 Validate Packet To Packet Classification: Categorizing the packet based on predefined criteria. + + * S04 Packet Classification To CMD Validation: Checking the packet against Command (CMD) validation rules. + + * S05 CMD Validation To Operator Validation: Operator reviews and validates the packet. + + * S06 Operator Validation To Supervisor Validation: Supervisor performs an additional layer of validation. + + * S07 Supervisor Validation To Quality Classifier: Quality control checks are conducted. + + * S08 Quality Classifier To Demographic Verification: Verifying demographic details within the packet. + + * S09 Demographic Verification To Biographic Verification: Confirming biographic information. + + * S10 Biographic Verification To UIN Generation: Generating a Unique Identification Number (UIN) for the packet. + + * S11 UIN Generation To Biometric Extraction: Extracting biometric data from the packet. + + * S12 Biometric Extraction To Finalization: Finalizing the packet processing. + + * S13 Finalization To Print Service: Preparing the packet for printing services. + + * S14 Print Service To Internal Workflow Action: Internal actions are taken based on the printed packet. + + * S15 Complete Reg Proc Packet Processing: Completing the registration process for the packet. + + * S16 End to End Packet and Credential Processing: Full processing of the packet and associated credentials. + + * S17 Overall Status Of The Packets: Reporting the overall status of all packets. \ No newline at end of file diff --git a/performance-test/scripts/Packet_Creator_Script.jmx b/performance-test/scripts/Packet_Creator_Script.jmx new file mode 100644 index 00000000000..698a2272cdb --- /dev/null +++ b/performance-test/scripts/Packet_Creator_Script.jmx @@ -0,0 +1,1468 @@ + + + + + true + true + + + + false + + + + + + + + protocol + https + = + + + packetUtilityPortNo + 8080 + = + + + packetUtilityServerIP + localhost + = + + + serverIPInternal + api-internal.cellbox1.mosip.net + = + + + serverPortNo + 443 + = + + + contextKeyValue + api-internal.cellbox1.mosip.net_S0_context + = + + + process + NEW + = + + + mountPath + /home/ubuntu/performance-testing-aws-ebs-volume/mountvolume/ + = + + + serverIP + cellbox1.mosip.net + = + + + testDuration + 30 + = + + + rampUp + 1 + = + + + clientId + mosip-regproc-client + = + + + regprcoSecretKey + 51GSCoEjmXIBfNuB + = + + + appId + regproc + = + + + clientIdResident + mosip-resident-client + = + + + secretKeyResident + Zb3YxTJoCgaPgrV9 + = + + + appIdResident + resident + = + + + runTimeFilePath + /home/ubuntu/performance-testing-aws-ebs-volume/apache-jmeter-5.6.3/bin/regproc-scripts/regproc-scripts/runtime-files/ + = + + + packetCreationCountPerUser + 1 + = + + + partnerPassword + mosip123 + = + + + adminSecretKey + 5xyAl2JF29ttnxJo + = + + + adminPassword + mosip123 + = + + + adminUsername + sanjay0 + = + + + residentPassword + mosip123 + = + + + idrepoSecretkey + CcCyCoMWEVDKM10I + = + + + keycloakPassword + uXEhXDVZyW + = + + + authClientSecretkey + Zb3YxTJoCgaPgrV9 + = + + + auditPassword + G7zMqBaSJg + = + + + regClientSecretkey + jpwOwsHL6lZmDDNS + = + + + postgresPassword + 797mKZO1Bo + = + + + pmsClientSecretkey + htdFIZiSw0dsVjSY + = + + + testrigClientSecretkey + zVqU7P4wIqT5rSfs + = + + + + + + /home/ubuntu/performance-testing-aws-ebs-volume/apache-jmeter-5.6.3/bin/regproc-scripts/regproc-scripts/support-files/contextDetails.csv + UTF-8 + userID,machineID,centerID,password + true + , + false + true + false + shareMode.all + + + + 1 + 1 + true + continue + + false + 1 + + false + + + + + + true + + + + false + { + "id": "string", + "metadata": {}, + "request": { + "clientId": "${clientId}", + "secretKey": "${regprcoSecretKey}", + "appId": "${appId}" + }, + "requesttime": "${__time(YYYY-MM-dd'T'HH:mm:ss.SSS,)}Z", + "version": "1.0" +} + = + + + + ${serverIPInternal} + ${serverPortNo} + ${protocol} + + v1/authmanager/authenticate/clientidsecretkey + POST + true + false + true + false + + + + + + + + + Content-Type + application/json + + + + + + + "message":"Clientid and Token combination had been validated successfully" + + + Assertion.response_data + false + 16 + + + + + 200 + + + Assertion.response_code + false + 2 + + + + true + authToken + set-cookie: Authorization=([\w.-]+); + $1$ + authToken_not_found + 1 + + + + + + false + ${__StringToFile(${runTimeFilePath}/authorization_token_regproc.txt,${authToken}\n,false,)} + + + + + true + + + + false + { + "id": "string", + "metadata": {}, + "request": { + "clientId": "${clientIdResident}", + "secretKey": "${secretKeyResident}", + "appId": "${appIdResident}" + }, + "requesttime": "${__time(YYYY-MM-dd'T'HH:mm:ss.SSS,)}Z", + "version": "1.0" +} + = + + + + ${serverIPInternal} + ${serverPortNo} + ${protocol} + + v1/authmanager/authenticate/clientidsecretkey + POST + true + false + true + false + + + + + + + + + Content-Type + application/json + + + + + + + "message":"Clientid and Token combination had been validated successfully" + + + Assertion.response_data + false + 16 + + + + + 200 + + + Assertion.response_code + false + 2 + + + + true + authToken + set-cookie: Authorization=([\w.-]+); + $1$ + authToken_not_found + 1 + + + + + + false + ${__StringToFile(${runTimeFilePath}/authorization_token_resident.txt,${authToken}\n,false,)} + + + + + + 1 + 1 + 60 + true + startnextloop + + false + 1 + + false + + + + + true + + + + false + { + "mockNotificationChannel": "", + "admin_zone_clientId": "mosip-admin-client", + "signPublicKey": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnkuJmoLUkpO5nGlLs8nZdpdzMHsBv03DQTqBZzxNgmE6H1FGIupdQwAflmE68btbAzJmmwyvOBCbjtyntyP6Zaf1Z2dzV8olFlCPaBXDCgckJzIXxxQnGYzgRfjmCvywnvLAGochqQmimxGejtS+5thU0FX//0p1WU4Zi7pzptOLb4jrXCPoBMZ5sbCGycgMyml5Q5dNtRIvMUvw6zGXutU+9fYiVFQ3d0SdJMXk15ygXyydvRLaYZ7gUdoIu7nbFV1eONJbtmsi+OVZrdc2+UzPqTHVRr1ovYUTOkm7Kz39QmlxeRo8Aos3keCIgjZTl/zH+nFJwQLm+STiLhEkiwIDAQAB", + "mosip_regproc_client_secret": "${regprcoSecretKey}", + "FetchDeviceSpec_lang_URI": "/v1/masterdata/devicespecifications/{langcode}", + "mosip.test.persona.locationsdatapath": "/profile_resource/location_data", + "partnerUrlSuffix": "oYf63Lax0DY2QkYMRHnrmDqhmO3RMWQagwm0ftgLlkuin1KOND/666/576732", + "mosip.test.persona.datapath": "/profile_resource/", + "partner_user_password": "${partnerPassword}", + "Male": "MLE", + "getUserHistory": "/v1/masterdata/users/{id}/{eff_dtimes}", + "FetchRejectionReason_URI": "/v1/masterdata/packetrejectionreasons/{reasoncategorycode}/{langcode}", + "eSignetDeployed": "yes", + "userid": "${userID}", + "push-reports-to-s3": "yes", + "FetchRegCentHolidays_URI": "/v1/masterdata/getregistrationcenterholidays/{langcode}/{registrationcenterid}/{year}", + "decrypt_URI": "/v1/keymanager/decrypt", + "mosip_resident_client_id": "mosip-resident-client", + "s3-region": "", + "db-server": "api-internal.${serverIP}", + "mosip_pms_app_id": "partner", + "syncConf": "/v1/syncdata/configs", + "getRoles": "/v1/syncdata/roles", + "admin_zone_clientSecret": "${adminSecretKey}", + "FetchApplication_URI": "/v1/masterdata/applicationtypes", + "langselect": "0", + "fetchAllTemplate": "/v1/masterdata/templates/templatetypecodes/{code}", + "s3-host": "http://minio.minio:9000", + "invalidEncryptedHashFlag": "", + "FetchTitle_URI": "/v1/masterdata/title/{langcode}", + "scenariosToSkip": "S-AFTER_SUITE,S-157", + "admin_zone_password": "${adminPassword}", + "FetchRegCent_id_lang_URI": "/v1/masterdata/registrationcenters/{id}/{langcode}", + "mosip_regprocclient_app_id": "regproc", + "ConfigParameters": "mosip.kernel.rid.length,mosip.kernel.uin.length,mosip.kernel.sms.country.code,mosip.kernel.sms.number.length,mosip.kernel.otp.default-length,mosip.kernel.otp.expiry-time,mosip.kernel.otp.key-freeze-time,mosip.kernel.otp.validation-attempt-threshold,mosip.kernel.otp.min-key-length,mosip.kernel.otp.max-key-length,mosip.kernel.licensekey.length,mosip.supported-languages", + "fetchmapLicenseKey": "/v1/keymanager/license/permission", + "useExternalScenarioSheet": "no", + "getusersBasedOnRegCenter": "/v1/syncdata/userdetails/{regid}", + "invalidOfficerIDFlag": "", + "actuatorIDAEndpoint": "/idauthentication/v1/actuator/env", + "FetchLocationHierarchy_URI_hierarchyname": "/v1/masterdata/locations/locationhierarchy/{hierarchyname}", + "audit_username": "postgres", + "auditLog_URI": "/v1/auditmanager/audits", + "eSignetbaseurl": "https://api.${serverIP}", + "tokenEndpoint": "/v1/esignet/oauth/token", + "admin_userName": "${adminUsername}", + "FetchRegcentMachUserMaping_URI": "/v1/masterdata/getregistrationmachineusermappinghistory/{effdtimes}/{registrationcenterid}/{machineid}/{userid}", + "machineid": "${machineID}", + "invalidDateFlag": "", + "scenario": "2:Resident walk-ins to registration center completes the process and gets UIN card", + "partner_userName": "111997", + "Female": "FLE", + "FetchApplication_lang_URI": "/v1/masterdata/applicationtypes/{langcode}", + "uin": "UIN", + "show_sql": "true", + "hibernate.connection.driver_class": "org.postgresql.Driver", + "pmsAuthInternal": "true", + "FetchDevice_lang_URI": "/v1/masterdata/devices/{languagecode}", + "FetchDocumentCategories_URI_withcodeAndLangCode": "/v1/masterdata/documentcategories/{code}/{langcode}", + "usePreConfiguredEmail": "prereg-dsl9@gmail.com", + "pool_size": "1", + "actuatorRegprocEndpoint": "/registrationprocessor/v1/registrationtransaction/actuator/env", + "FetchMachineHistory_URI": "/v1/masterdata/machineshistories/{id}/{langcode}/{effdatetimes}", + "mosip_reg_client_id": "mosip-reg-client", + "bulkUploadUrl": "/v1/admin/bulkupload", + "new_Resident_User": "111995", + "email_otp": "111111", + "mosip_idrepo_app_id": "idrepo", + "esignetMockBaseURL": "esignet-insurance.", + "keycloakAuthURL": "/auth/realms/master/protocol/openid-connect/token", + "packetUtilityBaseUrl": "http://packetcreator.packetcreator/v1/packetcreator", + "zoneNameUrl": "/v1/masterdata/zones/zonename", + "FetchRegCent_URI": "/v1/masterdata/registrationcenters", + "mosip.test.persona.facedatapath": "/profile_resource/face_data", + "Other": "OTH", + "sendOtp": "/v1/authmanager/authenticate/sendotp", + "dialect": "org.hibernate.dialect.PostgreSQLDialect", + "partner_username": "postgres", + "DB_PORT": "", + "audit_url": "jdbc:postgresql://api-internal.cellbox1.mosip.net:30090/mosip_audit", + "s3-account": "dslreports", + "mosip.test.persona.templatesdatapath": "/profile_resource/templates_data", + "mosip.test.persona.largedocumentpath": "/profile_resource/documents_data/", + "FetchDevice_id_lang_URI": "/v1/masterdata/devices/{languagecode}/{deviceType}", + "syncMdatawithRegCentIdKeyIndex": "/v1/syncdata/clientsettings/{regcenterid}", + "userzonecode": "TZT", + "mountPathForScenario": "${mountPath}", + "introducerBiometrics": "introducerBiometrics", + "updatePreRegStatus": "preregistration/v1/applications/prereg/status/", + "FetchDocumentCategories_URI": "/v1/masterdata/documentcategories/{langcode}", + "validateGenderByName": "/v1/masterdata/gendertypes/validate/{gendername}", + "mosip_idrepo_client_id": "mosip-idrepo-client", + "mosip.test.regclient.supervisorid": "${userID}", + "FetchHolidays_id_lang_URI": "/v1/masterdata/holidays/{holidayid}/{langcode}", + "FetchGenderType_id_lang_URI": "/v1/masterdata/gendertypes/{langcode}", + "actuatorMasterDataEndpoint": "/v1/masterdata/actuator/env", + "mosip_resident_app_id": "resident", + "ridStageStatus": "v1/admin/packetstatusupdate", + "getIndividualType": "/v1/masterdata/individualtypes", + "getDocType_DocCatByAppID": "/v1/masterdata/applicanttype/{applicantId}/languages", + "FetchRegCent_loc_lang_URI": "/v1/masterdata/getlocspecificregistrationcenters/{langcode}/{locationcode}", + "threadCount": "1", + "FetchHolidays_id_URI": "/v1/masterdata/holidays/{holidayid}", + "consent": "", + "mosip_pms_client_id": "mosip-pms-client", + "FetchApplication_id_lang_URI": "/v1/masterdata/applicationtypes/{code}/{langcode}", + "IDSchemaVersion": "IDSchemaVersion", + "mosip_testrig_client_id": "mosip-testrig-client", + "mosip_hotlist_client_id": "mosip-hotlist-client", + "name": "fullName", + "mosip.test.regclient.userid": "${userID}", + "introducerName": "introducerName", + "FetchLocationHierarchy_URI_locationcode": "/v1/masterdata/locations/{locationcode}/{langcode}", + "roles": "GLOBAL_ADMIN,ID_AUTHENTICATION,REGISTRATION_ADMIN,REGISTRATION_SUPERVISOR,ZONAL_ADMIN,AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_SUPERVISOR,DATA_READ", + "AuthAppID": "resident", + "preregValidateOtp": "/preregistration/v1/login/validateOtp", + "actuatorEndpoint": "/resident/v1/actuator/env", + "new_Resident_Password": "${residentPassword}", + "validateBindingEndpoint": "esignet-binding", + "getApplicantType": "/v1/masterdata/getApplicantType", + "mosip_resident_client_secret": "${secretKeyResident}", + "servicesNotDeployed": "", + "auditActuatorEndpoint": "/v1/auditmanager/actuator/info", + "AuthClientSecret": "${authClientSecretkey}", + "FetchLocationHierarchy_URI_withlangCode": "/v1/masterdata/locations/{langcode}", + "reportLogPath": "automationLogAndReport", + "mosip_regclient_app_id": "registrationclient", + "FetchBlackListedWord_URI": "/v1/masterdata/blacklistedwords/{langcode}", + "invalidCertFlag": false, + "mosip.test.baseurl": "https://api-internal.${serverIP}/", + "mountPath": "${mountPath}", + "mosip.version": "1.2", + "mosip_idrepo_client_secret": "${idrepoSecretkey}", + "keycloak-realm-id": "mosip", + "mosip.test.persona.irisdatapath": "/profile_resource/iris_data/", + "invalidCheckSum": "", + "prereg.password": "${password}", + "s3-user-secret": "minioadmin", + "prereg.operatorId": "${userID}", + "esignetWellKnownEndPoint": "/v1/esignet/oidc/.well-known/openid-configuration", + "preregSendOtp": "/preregistration/v1/login/sendOtp/langcode", + "publicKey": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnkuJmoLUkpO5nGlLs8nZdpdzMHsBv03DQTqBZzxNgmE6H1FGIupdQwAflmE68btbAzJmmwyvOBCbjtyntyP6Zaf1Z2dzV8olFlCPaBXDCgckJzIXxxQnGYzgRfjmCvywnvLAGochqQmimxGejtS+5thU0FX//0p1WU4Zi7pzptOLb4jrXCPoBMZ5sbCGycgMyml5Q5dNtRIvMUvw6zGXutU+9fYiVFQ3d0SdJMXk15ygXyydvRLaYZ7gUdoIu7nbFV1eONJbtmsi+OVZrdc2+UzPqTHVRr1ovYUTOkm7Kz39QmlxeRo8Aos3keCIgjZTl/zH+nFJwQLm+STiLhEkiwIDAQAB", + "mosip_admin_client_secret": "${adminSecretKey}", + "attempt": "10", + "centerId1": "${centerID}", + "usermasterdata-0": "masterdata-sanjay0", + "fetchImmediateChildLocation": "/v1/masterdata/locations/immediatechildren/{locationcode}/{langcode}", + "fetchIncrementalData": "/v1/syncjob/syncjobdef", + "s3-user-key": "admin", + "uingenerator": "/v1/idgenerator/uin", + "keycloak_Password": "${keycloakPassword}", + "reportExpirationInDays": "3", + "preconfiguredOtp": "111111", + "mosip.test.persona.documentsdatapath": "/profile_resource/documents_data/templates/", + "fetchmasterdata": "/v1/syncdata/masterdata", + "FetchHolidays_URI": "/v1/masterdata/holidays", + "generatePrivateKey": false, + "RIDGenerator_URI": "/v1/ridgenerator/generate/rid/{centerid}/{machineid}", + "FetchDeviceSpec_id_lang_URI": "/v1/masterdata/devicespecifications/{langcode}/{devicetypecode}", + "audit_password": "${auditPassword}", + "introducerRID": "introducerRID", + "regclient.centerid": "${centerID}", + "mosip_hotlist_app_id": "hotlist", + "zoneMappingUrl": "/v1/masterdata/zoneuser", + "zoneMappingActivateUrl": "/v1/masterdata/zoneuser", + "urlBase": "https://api-internal.${serverIP}/", + "authCertsPath": "${authCertsPath}", + "new_Resident_Role": "default-roles-mosip,PARTNER_ADMIN", + "dob": "dateOfBirth", + "db-su-user": "postgres", + "keycloak-external-url": "https://iam.${ServerIP}", + "pwd": "${password}", + "fetchRegCenter": "/v1/masterdata/registrationcenters/validate/{id}/{langCode}/{timestamp}", + "zoneCode": "TZT", + "postgresqlUser": "postgresql", + "gender": "gender", + "uploadpublickey": "/v1/syncdata/tpm/publickey", + "admin_zone_userName": "globaladmin", + "langCode": "eng", + "getRIDByUserId": "/v1/authmanager/rid/{appid}/{userid}", + "master_db_schema": "master", + "mosip_admin_client_id": "mosip-admin-client", + "otpNotifier": "/v1/otpnotifier/otp/send", + "resident_esignet": "v1/esignet/actuator/health", + "SyncPublicKeyToRegClient_URI": "/v1/keymanager/publickey/", + "validateLocationByName": "/v1/masterdata/locations/validate/{locationname}", + "individualBiometrics": "individualBiometrics", + "FetchRegCent_prox_lang_URI": "/v1/masterdata/getcoordinatespecificregistrationcenters/{langcode}/{longitude}/{latitude}/{proximitydistance}", + "mosip_reg_client_secret": "${regClientSecretkey}", + "userCenterMappingUrl": "/v1/masterdata/usercentermapping", + "machineSpecId": "0c0e49eb-7b05-453e-a107-083ec51f8586", + "invalidIdSchemaFlag": "", + "hibernate.current_session_context_class": "thread", + "FetchRegCentHistory_URI": "/v1/masterdata/registrationcentershistory/{registrationCenterId}/{langcode}/{effectiveDate}", + "user1": "${userID}", + "ida_db_schema": "ida", + "user0": "sanjay0", + "appendedkey": "1", + "partner_url": "jdbc:postgresql://api-internal.cellbox1.mosip.net:30090/mosip_ida", + "licKeyGenerator": "/v1/keymanager/license/generate", + "FetchGenderType_URI": "/v1/masterdata/gendertypes", + "installation-domain": "", + "mosip_hotlist_client_secret": "nnEhTOcpGW83WFAS", + "FetchMachine_URI": "/v1/masterdata/machines", + "iam-users-to-create": "111997,111998,220005,111992,globaladmin", + "syncMdatawithKeyIndex": "/v1/syncdata/clientsettings", + "actuatorAdminEndpoint": "/v1/admin/actuator/env", + "FetchBiometricAttribute_URI": "/v1/masterdata/getbiometricattributesbyauthtype/{langcode}/{biometrictypecode}", + "encrypt_URI": "/v1/keymanager/encrypt", + "hibernate.connection.pool_size": "1", + "partner_password": "G7zMqBaSJg", + "reportIgnoredTestCases": "no", + "hibernate.dialect": "org.hibernate.dialect.PostgreSQLDialect", + "mosip_regproc_client_id": "mosip-regproc-client", + "emailId": "email", + "OTPValidation": "/v1/otpmanager/otp/validate", + "machineName": "DSL0327152708202", + "userpassword": "${password}", + "EmailNotification_URI": "/v1/notifier/email/send", + "roles.111995": "PARTNER_ADMIN,default-roles-mosip", + "otpTargetEmail": "prereg-dsl9@gmail.com", + "roles.111997": "AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_SUPERVISOR", + "current_session_context_class": "thread", + "currentUserURI": "/#/uinservices/viewhistory", + "fetchDeviceHistory": "/v1/masterdata/deviceshistories/{id}/{langcode}/{effdatetimes}", + "driver_class": "org.postgresql.Driver", + "templateIDMeta": "/profile_resource/templates_data/IDMetaInfo.json", + "FetchTemplate_lang_URI": "/v1/masterdata/templates/{langcode}", + "FetchMachine_id_lang_URI": "/v1/masterdata/machines/{id}/{langcode}", + "audit_default_schema": "audit", + "db-port": "5432", + "pms_db_schema": "pms", + "uploaddocument": "preregistration/v1/documents/", + "iam-users-password": "mosip123,mosip123,mosip123,mosip123,mosip123", + "admin_password": "${password}", + "authDemoServicePort": "80", + "getDocTypeDocCatByLangCode": "/v1/masterdata/validdocuments/{languagecode}", + "FetchIDlist_URI": "/v1/masterdata/idtypes/{langcode}", + "audit_db_schema": "audit", + "mosip.test.regclient.centerid": "${centerID}", + "FetchMachine_lang_URI": "/v1/masterdata/machines/{langcode}", + "CentetMachineUserMappingToMasterData_uri": "/v1/masterdata/registrationmachineusermappings", + "fetchmasterdatawithRID": "/v1/syncdata/masterdata/{regcenterId}", + "OTPGeneration": "/v1/otpmanager/otp/generate", + "AuthClientID": "mosip-resident-client", + "FetchRegCent_hir_name_lang_URI": "/v1/masterdata/registrationcenters/{langcode}/{hierarchylevel}/{name}", + "mosip.test.temp": "/packets/", + "authenticationInternal": "/v1/authmanager/authenticate/internal/useridPwd", + "enableDebug": "yes", + "km_db_schema": "keymgr", + "FetchTemplate_id_lang_URI": "/v1/masterdata/templates/{langcode}/{templatetypecode}", + "postgresql-password": "${postgresPassword}", + "scenariosToExecute": "2", + "keycloak_UserName": "admin", + "FetchTemplate_URI": "/v1/masterdata/templates", + "changeSupervisorNameToDiffCase": false, + "SmsNotification_URI": "/v1/notifier/sms/send", + "introducerUIN": "introducerUIN", + "mosip_admin_app_id": "admin", + "FetchBiometricAuthType_URI": "/v1/masterdata/biometrictypes/{langcode}", + "fetchRegistrationCenterDeviceHistory": "/v1/masterdata/registrationcenterdevicehistory/{regcenterid}/{deviceid}/{effdatetimes}", + "master_default_schema": "master", + "OTPTimeOut": "181", + "hibernate.show_sql": "true", + "mosip.test.persona.fingerprintdatapath": "/profile_resource/fp_data", + "admin_zone_appid": "admin", + "mosip_pms_client_secret": "${pmsClientSecretkey}", + "mosip.test.prereg.centerid": "10005", + "mosip.test.persona.namesdatapath": "/profile_resource/names_data", + "mosip_testrig_client_secret": "${testrigClientSecretkey}", + "authentication": "/v1/authmanager/authenticate/useridPwd", + "policytest_userName": "111998", + "authDemoServiceBaseURL": "http://authdemo.authdemo", + "useridOTP": "/v1/authmanager/authenticate/useridOTP", + "partner_default_schema": "partner", + "policytest_password": "${password}", + "usePreConfiguredOtp": "true", + "FetchDocumentTypes_URI": "/v1/masterdata/documenttypes/{documentcategorycode}/{langcode}", + "authclientidsecretkeyURL": "/v1/authmanager/authenticate/clientidsecretkey", + "mapLicenseKey": "/v1/keymanager/license/permission", + "validUIN": "createnew", + "tokenIdGenerator_URI": "/v1/keymanager/{uin}/{partnercode}", + "mosip.test.regclient.supervisorpwd": "${password}", + "mosip.test.regclient.machineid": "${machineID}", + "deleteMockAbisExpectations": "v1/mock-abis-service/config/expectation", + "mosip.test.regclient.password": "${password}", + "centerId2": "10424", + "user2" : "sanjay2", + "ageCategory" : "${'INFANT'\:'0-5','MINOR'\:'6-17','ADULT'\:'18-200'}", + "skipBiometricClassificationFlag" : "", + "enableDebug" : "yes", + "skipApplicantDocumentsFlag" : "", + "signature" : "valid" +} + = + + + + ${packetUtilityServerIP} + ${packetUtilityPortNo} + http + + v1/packetcreator/context/server/${contextKeyValue} + POST + true + false + true + false + + + + + + + + + Content-Type + application/json + + + + + + + true + + + Assertion.response_data + false + 2 + + + + + 200 + + + Assertion.response_code + false + 2 + + + + true + + + def contextKeyDemo = "api-internal.cellbox1.mosip.net_S0${__threadNum}_context" +vars.put('contextKeyValue',contextKeyDemo) + groovy + + + + + true + ${packetCreationCountPerUser} + + + + true + + + + false + { + "requests": { + "PR_ResidentAttribute": { + "Iris": "true", + "Finger": "true", + "Gender": "Female", + "Face": "true", + "Age": "RA_Adult" + } + } +} + = + + + + ${packetUtilityServerIP} + ${packetUtilityPortNo} + http + + /v1/packetcreator/persona/generate/${contextKeyValue} + POST + true + false + true + false + + + + + + + + + Content-Type + application/json + + + + + + + "status":"SUCCESS + + + Assertion.response_data + false + 2 + + + + + 200 + + + Assertion.response_code + false + 2 + + + + false + personaPath + path":"(.*?)", + $1$ + personaPath not found + 1 + + + + + true + + + + false + { + "personaFilePath": [ + "${personaPath}" + ] +} + = + + + + ${packetUtilityServerIP} + ${packetUtilityPortNo} + http + + /v1/packetcreator/packet/template/${process}/81/true/${contextKeyValue} + POST + true + false + true + false + + + + + + + + + Content-Type + application/json + + + + + + + {"path":" + + + Assertion.response_data + false + 2 + + + + + 200 + + + Assertion.response_code + false + 2 + + + + false + templatePath + path":"(.*?)", + $1$ + templatePath not found + 1 + + + + + true + + + + false + { + "process": "${process}", + "idJsonPath": "${templatePath}/REGISTRATION_CLIENT/NEW/rid_id/ID.json", + "source": "REGISTRATION_CLIENT", + "templatePath": "${templatePath}" +} + = + + + + ${packetUtilityServerIP} + ${packetUtilityPortNo} + http + + v1/packetcreator/packetcreator/${contextKeyValue} + POST + true + false + true + false + + + + + + + + + Content-Type + application/json + + + + + + + 200 + + + Assertion.response_code + false + 2 + + + + + Failed! + + + Assertion.response_data + false + 6 + + + + false + packetPath + (?s)(^.+$) + $1$ + packetPath not found + 1 + + + + false + + + import java.io.File; +import java.io.IOException; +import org.apache.commons.io.FileUtils; + + +String file = vars.get("packetPath"); +String path = file.replaceAll("\\\\", "/"); +vars.put("newPath", path); + + + + false + + + ${__StringToFile(${runTimeFilePath}/store_packet_path.txt,${newPath}\,${process}\,${contextKeyValue}\n,true,)} + + + + + + + 1 + 1 + true + continue + + false + 1 + + false + + + + + + ${runTimeFilePath}./authorization_token_regproc.txt + + authTokenRegproc + false + , + false + true + false + shareMode.all + + + + /home/ubuntu/performance-testing-aws-ebs-volume/apache-jmeter-5.6.3/bin/regproc-scripts/regproc-scripts/runtime-files/store_packet_path.txt + UTF-8 + loadpacketPath,process,contextKeyValue + true + , + false + true + false + shareMode.group + + + + true + + + + false + {"process":"${process}","phone":"phone","name":"name","supervisorComment":"supervisorComment","containerPath":"${loadpacketPath}","supervisorStatus":"APPROVED","email":"email"} + = + + + + ${packetUtilityServerIP} + ${packetUtilityPortNo} + http + + /v1/packetcreator/ridsyncreq/${contextKeyValue} + POST + true + false + true + false + + + + + + + + + Content-Type + application/json + + + cookie + Authorization=${authTokenRegproc} + + + + + + + 200 + + + Assertion.response_code + false + 2 + + + + false + timeStamp + "timestamp":"(.*?)"} + $1$ + Center-Machine-RefId Not Found + 1 + + + + false + machineRefId + Center-Machine-RefId":"(.*?)" + $1$ + Center-Machine-RefId Not Found + 1 + + + + false + requestBody + requestBody":"(.*?)" + $1$ + requestBody Not Found + 1 + + + + + + false + ${__StringToFile(${runTimeFilePath}/request_body_sync_packet.txt,${machineRefId}&${requestBody}&${timeStamp}&${loadpacketPath}\n,true,)} + + + + + + + 1 + ${testDuration} + true + continue + + false + 1 + + 1 + false + + + + + ${runTimeFilePath}./authorization_token_regproc.txt + + authTokenRegproc + false + , + false + true + false + shareMode.all + + + + ${runTimeFilePath}./authorization_token_resident.txt + + authTokenResident + false + , + false + true + false + shareMode.all + + + + /home/ubuntu/performance-testing-aws-ebs-volume/apache-jmeter-5.6.3/bin/regproc-scripts/regproc-scripts/support-files/request_body_sync_packet.txt + + machineRefId,encryptedData,timeStamp,uploadLoadpacketPath + true + & + false + true + false + shareMode.all + + + + true + + + + false + "${encryptedData}" + = + + + + ${serverIPInternal} + ${serverPortNo} + ${protocol} + + registrationprocessor/v1/registrationstatus/syncV2 + POST + true + false + true + false + + + + + + + + + content-type + application/json + + + cookie + Authorization=${authTokenResident} + + + Center-Machine-RefId + ${machineRefId} + + + timestamp + ${timeStamp} + + + + + + + "errors":null + + + Assertion.response_data + false + 2 + + + + + 200 + + + Assertion.response_code + false + 2 + + + + false + regId + registrationId":"(.*?)" + $1$ + requestBody Not Found + 1 + + + + + + false + ${__StringToFile(${runTimeFilePath}/reg_id.txt,${regId}\n,true,)} + + + + + + + + + ${uploadLoadpacketPath} + file + application/zip + + + + + + + false + + = + true + + + + ${serverIPInternal} + ${serverPortNo} + ${protocol} + + registrationprocessor/v1/packetreceiver/registrationpackets + POST + true + false + true + true + + + + + + + + + Accept-Encoding + gzip, deflate + + + Accept-Language + en-US,en;q=0.9,hi;q=0.8,und;q=0.7 + + + Cache-Control + no-cache + + + Connection + keep-alive + + + Pragma + no-cache + + + User-Agent + Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 + + + Cookie + Authorization=${authTokenResident} + + + accept + application/json + + + + + + + Packet has reached Packet Receiver + + + Assertion.response_data + false + 2 + + + + + 200 + + + Assertion.response_code + false + 2 + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + 500 + false + .*Endpoint.* + + + + true + false + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + 500 + false + + .*Endpoint.* + + + false + true + + + + + diff --git a/performance-test/scripts/Reults_Script.jmx b/performance-test/scripts/Reults_Script.jmx new file mode 100644 index 00000000000..6b2a0aa3686 --- /dev/null +++ b/performance-test/scripts/Reults_Script.jmx @@ -0,0 +1,2695 @@ + + + + + + false + true + false + + + + + + + + + + rampUp + 1 + = + + + testDuration + 10 + = + + + testStart + 2025-06-06 00:00:00.000 + = + + + testEnd + 2025-06-07 00:00:00.000 + = + + + dbHost + 172.31.9.158 + = + + + dbPort + 5432 + = + + + regprocDbName + mosip_regprc + = + + + credentialDbName + mosip_credential + = + + + dbUser + postgres + = + + + dbPassword + 797mKZO1Bo + = + + + runTimeFilePath + ./runtime-files + = + + + loopCount + 500 + = + + + + + + true + select 1 + 5000 + regprocConnection + jdbc:postgresql://${dbHost}:${dbPort}/${regprocDbName} + org.postgresql.Driver + true + 797mKZO1Bo + 50 + 10000 + DEFAULT + 6000 + ${dbUser} + + false + + + + + true + select 1 + 5000 + credentialConnection + jdbc:postgresql://${dbHost}:${dbPort}/${credentialDbName} + org.postgresql.Driver + true + 797mKZO1Bo + 50 + 10000 + DEFAULT + 6000 + ${dbUser} + + false + + + + + , + + C:/Users/akhilesh.moogi/OneDrive - Technoforte Software Private Limited/Documents/Jmeter Scripts/RegProc Async/reg_id.txt + true + false + false + shareMode.thread + true + regId + + + + continue + + false + ${loopCount} + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes1 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'SECUREZONE_NOTIFICATION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + + + id,reg_id,cr_dtimes1 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + prev.setIgnore() + + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes2 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'UPLOAD_PACKET' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes2 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + all + success + + + + groovy + + + true + import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.time.Duration + +// Fetch timestamps from JMeter variables +String createdTime=vars.get("cr_dtimes1_1"); +String updatedTime=vars.get("cr_dtimes2_1"); + +if (createdTime == null || updatedTime == null) { + + vars.put("timeDifferenceMs", "0"); + vars.put("status","FAIL"); +} else { + + createdTime = createdTime.replaceAll(/\.(\d{3})\d*/, '.$1') + updatedTime = updatedTime.replaceAll(/\.(\d{3})\d*/, '.$1') + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") + + // Parse timestamps + LocalDateTime dt1 = LocalDateTime.parse(createdTime, formatter) + LocalDateTime dt2 = LocalDateTime.parse(updatedTime, formatter) + + // Calculate the difference in milliseconds + long millisDiff = Duration.between(dt1, dt2).toMillis() + + // Store the result in a JMeter variable + vars.put("timeDifferenceMs", String.valueOf(millisDiff)) + + // Log output + //log.info("Time Difference: ${millisDiff} milliseconds") + vars.put("status","PASS"); +} +prev.setIgnore(); + + + + + false + true + 200 + OK + + ${status} + ${timeDifferenceMs} + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + true + + + def data=vars.get("status"); + + +if(data.equals("PASS")) +{ + SampleResult.setSuccessful(true); +} +else +{ + SampleResult.setSuccessful(false); +} + + groovy + + + + + + continue + + false + ${loopCount} + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes1 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'UPLOAD_PACKET' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + + + id,reg_id,cr_dtimes1 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + prev.setIgnore() + + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes2 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'VALIDATE_PACKET' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes2 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.time.Duration + +// Fetch timestamps from JMeter variables +String createdTime=vars.get("cr_dtimes1_1"); +String updatedTime=vars.get("cr_dtimes2_1"); + +if (createdTime == null || updatedTime == null) { + + vars.put("timeDifferenceMs", "0"); + vars.put("status","FAIL"); +} else { + + createdTime = createdTime.replaceAll(/\.(\d{3})\d*/, '.$1') + updatedTime = updatedTime.replaceAll(/\.(\d{3})\d*/, '.$1') + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") + + // Parse timestamps + LocalDateTime dt1 = LocalDateTime.parse(createdTime, formatter) + LocalDateTime dt2 = LocalDateTime.parse(updatedTime, formatter) + + // Calculate the difference in milliseconds + long millisDiff = Duration.between(dt1, dt2).toMillis() + + // Store the result in a JMeter variable + vars.put("timeDifferenceMs", String.valueOf(millisDiff)) + + // Log output + //log.info("Time Difference: ${millisDiff} milliseconds") + vars.put("status","PASS"); +} +prev.setIgnore(); + + + + + false + true + 200 + OK + + ${status} + ${timeDifferenceMs} + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + true + + + def data=vars.get("status"); + + +if(data.equals("PASS")) +{ + SampleResult.setSuccessful(true); +} +else +{ + SampleResult.setSuccessful(false); +} + + groovy + + + + + + continue + + false + ${loopCount} + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes1 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'VALIDATE_PACKET' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + + + id,reg_id,cr_dtimes1 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + prev.setIgnore() + + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes2 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'PACKET_CLASSIFICATION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes2 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.time.Duration + +// Fetch timestamps from JMeter variables +String createdTime=vars.get("cr_dtimes1_1"); +String updatedTime=vars.get("cr_dtimes2_1"); + +if (createdTime == null || updatedTime == null) { + + vars.put("timeDifferenceMs", "0"); + vars.put("status","FAIL"); +} else { + + createdTime = createdTime.replaceAll(/\.(\d{3})\d*/, '.$1') + updatedTime = updatedTime.replaceAll(/\.(\d{3})\d*/, '.$1') + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") + + // Parse timestamps + LocalDateTime dt1 = LocalDateTime.parse(createdTime, formatter) + LocalDateTime dt2 = LocalDateTime.parse(updatedTime, formatter) + + // Calculate the difference in milliseconds + long millisDiff = Duration.between(dt1, dt2).toMillis() + + // Store the result in a JMeter variable + vars.put("timeDifferenceMs", String.valueOf(millisDiff)) + + // Log output + //log.info("Time Difference: ${millisDiff} milliseconds") + vars.put("status","PASS"); +} +prev.setIgnore(); + + + + + false + true + 200 + OK + + ${status} + ${timeDifferenceMs} + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + true + + + def data=vars.get("status"); + + +if(data.equals("PASS")) +{ + SampleResult.setSuccessful(true); +} +else +{ + SampleResult.setSuccessful(false); +} + + groovy + + + + + + continue + + false + ${loopCount} + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes1 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'PACKET_CLASSIFICATION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + + + id,reg_id,cr_dtimes1 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + prev.setIgnore() + + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes2 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'CMD_VALIDATION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes2 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.time.Duration + +// Fetch timestamps from JMeter variables +String createdTime=vars.get("cr_dtimes1_1"); +String updatedTime=vars.get("cr_dtimes2_1"); + +if (createdTime == null || updatedTime == null) { + + vars.put("timeDifferenceMs", "0"); + vars.put("status","FAIL"); +} else { + + createdTime = createdTime.replaceAll(/\.(\d{3})\d*/, '.$1') + updatedTime = updatedTime.replaceAll(/\.(\d{3})\d*/, '.$1') + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") + + // Parse timestamps + LocalDateTime dt1 = LocalDateTime.parse(createdTime, formatter) + LocalDateTime dt2 = LocalDateTime.parse(updatedTime, formatter) + + // Calculate the difference in milliseconds + long millisDiff = Duration.between(dt1, dt2).toMillis() + + // Store the result in a JMeter variable + vars.put("timeDifferenceMs", String.valueOf(millisDiff)) + + // Log output + //log.info("Time Difference: ${millisDiff} milliseconds") + vars.put("status","PASS"); +} +prev.setIgnore(); + + + + + false + true + 200 + OK + + ${status} + ${timeDifferenceMs} + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + true + + + def data=vars.get("status"); + + +if(data.equals("PASS")) +{ + SampleResult.setSuccessful(true); +} +else +{ + SampleResult.setSuccessful(false); +} + + groovy + + + + + + continue + + false + ${loopCount} + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes1 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'CMD_VALIDATION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + + + id,reg_id,cr_dtimes1 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + prev.setIgnore() + + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes2 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'OPERATOR_VALIDATION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes2 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.time.Duration + +// Fetch timestamps from JMeter variables +String createdTime=vars.get("cr_dtimes1_1"); +String updatedTime=vars.get("cr_dtimes2_1"); + +if (createdTime == null || updatedTime == null) { + + vars.put("timeDifferenceMs", "0"); + vars.put("status","FAIL"); +} else { + + createdTime = createdTime.replaceAll(/\.(\d{3})\d*/, '.$1') + updatedTime = updatedTime.replaceAll(/\.(\d{3})\d*/, '.$1') + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") + + // Parse timestamps + LocalDateTime dt1 = LocalDateTime.parse(createdTime, formatter) + LocalDateTime dt2 = LocalDateTime.parse(updatedTime, formatter) + + // Calculate the difference in milliseconds + long millisDiff = Duration.between(dt1, dt2).toMillis() + + // Store the result in a JMeter variable + vars.put("timeDifferenceMs", String.valueOf(millisDiff)) + + // Log output + //log.info("Time Difference: ${millisDiff} milliseconds") + vars.put("status","PASS"); +} +prev.setIgnore(); + + + + + false + true + 200 + OK + + ${status} + ${timeDifferenceMs} + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + true + + + def data=vars.get("status"); + + +if(data.equals("PASS")) +{ + SampleResult.setSuccessful(true); +} +else +{ + SampleResult.setSuccessful(false); +} + + groovy + + + + + + continue + + false + ${loopCount} + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes1 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'OPERATOR_VALIDATION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + + + id,reg_id,cr_dtimes1 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + prev.setIgnore() + + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes2 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'SUPERVISOR_VALIDATION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes2 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.time.Duration + +// Fetch timestamps from JMeter variables +String createdTime=vars.get("cr_dtimes1_1"); +String updatedTime=vars.get("cr_dtimes2_1"); + +if (createdTime == null || updatedTime == null) { + + vars.put("timeDifferenceMs", "0"); + vars.put("status","FAIL"); +} else { + + createdTime = createdTime.replaceAll(/\.(\d{3})\d*/, '.$1') + updatedTime = updatedTime.replaceAll(/\.(\d{3})\d*/, '.$1') + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") + + // Parse timestamps + LocalDateTime dt1 = LocalDateTime.parse(createdTime, formatter) + LocalDateTime dt2 = LocalDateTime.parse(updatedTime, formatter) + + // Calculate the difference in milliseconds + long millisDiff = Duration.between(dt1, dt2).toMillis() + + // Store the result in a JMeter variable + vars.put("timeDifferenceMs", String.valueOf(millisDiff)) + + // Log output + //log.info("Time Difference: ${millisDiff} milliseconds") + vars.put("status","PASS"); +} +prev.setIgnore(); + + + + + false + true + 200 + OK + + ${status} + ${timeDifferenceMs} + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + true + + + def data=vars.get("status"); + + +if(data.equals("PASS")) +{ + SampleResult.setSuccessful(true); +} +else +{ + SampleResult.setSuccessful(false); +} + + groovy + + + + + + continue + + false + ${loopCount} + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes1 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'SUPERVISOR_VALIDATION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes1 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + prev.setIgnore() + + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes2 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'QUALITY_CLASSIFIER' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes2 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.time.Duration + +// Fetch timestamps from JMeter variables +String createdTime=vars.get("cr_dtimes1_1"); +String updatedTime=vars.get("cr_dtimes2_1"); + +if (createdTime == null || updatedTime == null) { + + vars.put("timeDifferenceMs", "0"); + vars.put("status","FAIL"); +} else { + + createdTime = createdTime.replaceAll(/\.(\d{3})\d*/, '.$1') + updatedTime = updatedTime.replaceAll(/\.(\d{3})\d*/, '.$1') + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") + + // Parse timestamps + LocalDateTime dt1 = LocalDateTime.parse(createdTime, formatter) + LocalDateTime dt2 = LocalDateTime.parse(updatedTime, formatter) + + // Calculate the difference in milliseconds + long millisDiff = Duration.between(dt1, dt2).toMillis() + + // Store the result in a JMeter variable + vars.put("timeDifferenceMs", String.valueOf(millisDiff)) + + // Log output + //log.info("Time Difference: ${millisDiff} milliseconds") + vars.put("status","PASS"); +} +prev.setIgnore(); + + + + + false + true + 200 + OK + + ${status} + ${timeDifferenceMs} + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + true + + + def data=vars.get("status"); + + +if(data.equals("PASS")) +{ + SampleResult.setSuccessful(true); +} +else +{ + SampleResult.setSuccessful(false); +} + + groovy + + + + + + continue + + false + ${loopCount} + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes1 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'QUALITY_CLASSIFIER' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes1 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + prev.setIgnore() + + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes2 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'DEMOGRAPHIC_VERIFICATION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes2 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.time.Duration + +// Fetch timestamps from JMeter variables +String createdTime=vars.get("cr_dtimes1_1"); +String updatedTime=vars.get("cr_dtimes2_1"); + +if (createdTime == null || updatedTime == null) { + + vars.put("timeDifferenceMs", "0"); + vars.put("status","FAIL"); +} else { + + createdTime = createdTime.replaceAll(/\.(\d{3})\d*/, '.$1') + updatedTime = updatedTime.replaceAll(/\.(\d{3})\d*/, '.$1') + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") + + // Parse timestamps + LocalDateTime dt1 = LocalDateTime.parse(createdTime, formatter) + LocalDateTime dt2 = LocalDateTime.parse(updatedTime, formatter) + + // Calculate the difference in milliseconds + long millisDiff = Duration.between(dt1, dt2).toMillis() + + // Store the result in a JMeter variable + vars.put("timeDifferenceMs", String.valueOf(millisDiff)) + + // Log output + //log.info("Time Difference: ${millisDiff} milliseconds") + vars.put("status","PASS"); +} +prev.setIgnore(); + + + + + false + true + 200 + OK + + ${status} + ${timeDifferenceMs} + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + true + + + def data=vars.get("status"); + + +if(data.equals("PASS")) +{ + SampleResult.setSuccessful(true); +} +else +{ + SampleResult.setSuccessful(false); +} + + groovy + + + + + + continue + + false + ${loopCount} + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes1 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'DEMOGRAPHIC_VERIFICATION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes1 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + prev.setIgnore() + + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes2 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'BIOGRAPHIC_VERIFICATION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes2 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.time.Duration + +// Fetch timestamps from JMeter variables +String createdTime=vars.get("cr_dtimes1_1"); +String updatedTime=vars.get("cr_dtimes2_1"); + +if (createdTime == null || updatedTime == null) { + + vars.put("timeDifferenceMs", "0"); + vars.put("status","FAIL"); +} else { + + createdTime = createdTime.replaceAll(/\.(\d{3})\d*/, '.$1') + updatedTime = updatedTime.replaceAll(/\.(\d{3})\d*/, '.$1') + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") + + // Parse timestamps + LocalDateTime dt1 = LocalDateTime.parse(createdTime, formatter) + LocalDateTime dt2 = LocalDateTime.parse(updatedTime, formatter) + + // Calculate the difference in milliseconds + long millisDiff = Duration.between(dt1, dt2).toMillis() + + // Store the result in a JMeter variable + vars.put("timeDifferenceMs", String.valueOf(millisDiff)) + + // Log output + //log.info("Time Difference: ${millisDiff} milliseconds") + vars.put("status","PASS"); +} +prev.setIgnore(); + + + + + false + true + 200 + OK + + ${status} + ${timeDifferenceMs} + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + true + + + def data=vars.get("status"); + + +if(data.equals("PASS")) +{ + SampleResult.setSuccessful(true); +} +else +{ + SampleResult.setSuccessful(false); +} + + groovy + + + + + + continue + + false + ${loopCount} + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes1 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'BIOGRAPHIC_VERIFICATION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + + + id,reg_id,cr_dtimes1 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + prev.setIgnore() + + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes2 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'UIN_GENERATOR' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes2 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.time.Duration + +// Fetch timestamps from JMeter variables +String createdTime=vars.get("cr_dtimes1_1"); +String updatedTime=vars.get("cr_dtimes2_1"); + +if (createdTime == null || updatedTime == null) { + + vars.put("timeDifferenceMs", "0"); + vars.put("status","FAIL"); +} else { + + createdTime = createdTime.replaceAll(/\.(\d{3})\d*/, '.$1') + updatedTime = updatedTime.replaceAll(/\.(\d{3})\d*/, '.$1') + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") + + // Parse timestamps + LocalDateTime dt1 = LocalDateTime.parse(createdTime, formatter) + LocalDateTime dt2 = LocalDateTime.parse(updatedTime, formatter) + + // Calculate the difference in milliseconds + long millisDiff = Duration.between(dt1, dt2).toMillis() + + // Store the result in a JMeter variable + vars.put("timeDifferenceMs", String.valueOf(millisDiff)) + + // Log output + //log.info("Time Difference: ${millisDiff} milliseconds") + vars.put("status","PASS"); +} +prev.setIgnore(); + + + + + false + true + 200 + OK + + ${status} + ${timeDifferenceMs} + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + true + + + def data=vars.get("status"); + + +if(data.equals("PASS")) +{ + SampleResult.setSuccessful(true); +} +else +{ + SampleResult.setSuccessful(false); +} + + groovy + + + + + + continue + + false + ${loopCount} + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes1 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'UIN_GENERATOR' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + + + id,reg_id,cr_dtimes1 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + prev.setIgnore() + + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes2 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'BIOMETRIC_EXTRACTION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes2 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.time.Duration + +// Fetch timestamps from JMeter variables +String createdTime=vars.get("cr_dtimes1_1"); +String updatedTime=vars.get("cr_dtimes2_1"); + +if (createdTime == null || updatedTime == null) { + + vars.put("timeDifferenceMs", "0"); + vars.put("status","FAIL"); +} else { + + createdTime = createdTime.replaceAll(/\.(\d{3})\d*/, '.$1') + updatedTime = updatedTime.replaceAll(/\.(\d{3})\d*/, '.$1') + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") + + // Parse timestamps + LocalDateTime dt1 = LocalDateTime.parse(createdTime, formatter) + LocalDateTime dt2 = LocalDateTime.parse(updatedTime, formatter) + + // Calculate the difference in milliseconds + long millisDiff = Duration.between(dt1, dt2).toMillis() + + // Store the result in a JMeter variable + vars.put("timeDifferenceMs", String.valueOf(millisDiff)) + + // Log output + //log.info("Time Difference: ${millisDiff} milliseconds") + vars.put("status","PASS"); +} +prev.setIgnore(); + + + + + false + true + 200 + OK + + ${status} + ${timeDifferenceMs} + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + true + + + def data=vars.get("status"); + + +if(data.equals("PASS")) +{ + SampleResult.setSuccessful(true); +} +else +{ + SampleResult.setSuccessful(false); +} + + groovy + + + + + + continue + + false + ${loopCount} + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes1 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'BIOMETRIC_EXTRACTION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + + + id,reg_id,cr_dtimes1 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + prev.setIgnore() + + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes2 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'FINALIZATION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes2 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.time.Duration + +// Fetch timestamps from JMeter variables +String createdTime=vars.get("cr_dtimes1_1"); +String updatedTime=vars.get("cr_dtimes2_1"); + +if (createdTime == null || updatedTime == null) { + + vars.put("timeDifferenceMs", "0"); + vars.put("status","FAIL"); +} else { + + createdTime = createdTime.replaceAll(/\.(\d{3})\d*/, '.$1') + updatedTime = updatedTime.replaceAll(/\.(\d{3})\d*/, '.$1') + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") + + // Parse timestamps + LocalDateTime dt1 = LocalDateTime.parse(createdTime, formatter) + LocalDateTime dt2 = LocalDateTime.parse(updatedTime, formatter) + + // Calculate the difference in milliseconds + long millisDiff = Duration.between(dt1, dt2).toMillis() + + // Store the result in a JMeter variable + vars.put("timeDifferenceMs", String.valueOf(millisDiff)) + + // Log output + //log.info("Time Difference: ${millisDiff} milliseconds") + vars.put("status","PASS"); +} +prev.setIgnore(); + + + + + false + true + 200 + OK + + ${status} + ${timeDifferenceMs} + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + true + + + def data=vars.get("status"); + + +if(data.equals("PASS")) +{ + SampleResult.setSuccessful(true); +} +else +{ + SampleResult.setSuccessful(false); +} + + groovy + + + + + + continue + + false + ${loopCount} + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes1 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'FINALIZATION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + + + id,reg_id,cr_dtimes1 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + prev.setIgnore() + + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes2 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'PRINT_SERVICE' and status_code = 'PROCESSED' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes2 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.time.Duration + +// Fetch timestamps from JMeter variables +String createdTime=vars.get("cr_dtimes1_1"); +String updatedTime=vars.get("cr_dtimes2_1"); + +if (createdTime == null || updatedTime == null) { + + vars.put("timeDifferenceMs", "0"); + vars.put("status","FAIL"); +} else { + + createdTime = createdTime.replaceAll(/\.(\d{3})\d*/, '.$1') + updatedTime = updatedTime.replaceAll(/\.(\d{3})\d*/, '.$1') + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") + + // Parse timestamps + LocalDateTime dt1 = LocalDateTime.parse(createdTime, formatter) + LocalDateTime dt2 = LocalDateTime.parse(updatedTime, formatter) + + // Calculate the difference in milliseconds + long millisDiff = Duration.between(dt1, dt2).toMillis() + + // Store the result in a JMeter variable + vars.put("timeDifferenceMs", String.valueOf(millisDiff)) + + // Log output + //log.info("Time Difference: ${millisDiff} milliseconds") + vars.put("status","PASS"); +} +prev.setIgnore(); + + + + + false + true + 200 + OK + + ${status} + ${timeDifferenceMs} + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + true + + + def data=vars.get("status"); + + +if(data.equals("PASS")) +{ + SampleResult.setSuccessful(true); +} +else +{ + SampleResult.setSuccessful(false); +} + + groovy + + + + + + continue + + false + ${loopCount} + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes1 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'PRINT_SERVICE' and status_code = 'PROCESSED' order by cr_dtimes desc limit 1; + + + + + id,reg_id,cr_dtimes1 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + prev.setIgnore() + + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes2 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'INTERNAL_WORKFLOW_ACTION' and status_code = 'PROCESSED' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes2 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.time.Duration + +// Fetch timestamps from JMeter variables +String createdTime=vars.get("cr_dtimes1_1"); +String updatedTime=vars.get("cr_dtimes2_1"); + +if (createdTime == null || updatedTime == null) { + + vars.put("timeDifferenceMs", "0"); + vars.put("status","FAIL"); +} else { + + createdTime = createdTime.replaceAll(/\.(\d{3})\d*/, '.$1') + updatedTime = updatedTime.replaceAll(/\.(\d{3})\d*/, '.$1') + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") + + // Parse timestamps + LocalDateTime dt1 = LocalDateTime.parse(createdTime, formatter) + LocalDateTime dt2 = LocalDateTime.parse(updatedTime, formatter) + + // Calculate the difference in milliseconds + long millisDiff = Duration.between(dt1, dt2).toMillis() + + // Store the result in a JMeter variable + vars.put("timeDifferenceMs", String.valueOf(millisDiff)) + + // Log output + //log.info("Time Difference: ${millisDiff} milliseconds") + vars.put("status","PASS"); +} +prev.setIgnore(); + + + + + false + true + 200 + OK + + ${status} + ${timeDifferenceMs} + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + true + + + def data=vars.get("status"); + + +if(data.equals("PASS")) +{ + SampleResult.setSuccessful(true); +} +else +{ + SampleResult.setSuccessful(false); +} + + groovy + + + + + + continue + + false + ${loopCount} + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes1 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'SECUREZONE_NOTIFICATION' and status_code = 'SUCCESS' order by cr_dtimes desc limit 1; + + + + + id,reg_id,cr_dtimes1 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + prev.setIgnore() + + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes2 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'INTERNAL_WORKFLOW_ACTION' and status_code = 'PROCESSED' order by cr_dtimes desc limit 1; + + + id,reg_id,cr_dtimes2 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.time.Duration + +// Fetch timestamps from JMeter variables +String createdTime=vars.get("cr_dtimes1_1"); +String updatedTime=vars.get("cr_dtimes2_1"); + +if (createdTime == null || updatedTime == null) { + + vars.put("timeDifferenceMs", "0"); + vars.put("status","FAIL"); +} else { + + createdTime = createdTime.replaceAll(/\.(\d{3})\d*/, '.$1') + updatedTime = updatedTime.replaceAll(/\.(\d{3})\d*/, '.$1') + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") + + // Parse timestamps + LocalDateTime dt1 = LocalDateTime.parse(createdTime, formatter) + LocalDateTime dt2 = LocalDateTime.parse(updatedTime, formatter) + + // Calculate the difference in milliseconds + long millisDiff = Duration.between(dt1, dt2).toMillis() + + // Store the result in a JMeter variable + vars.put("timeDifferenceMs", String.valueOf(millisDiff)) + + // Log output + //log.info("Time Difference: ${millisDiff} milliseconds") + vars.put("status","PASS"); +} +prev.setIgnore(); + + + + + false + true + 200 + OK + + ${status} + ${timeDifferenceMs} + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + true + + + def data=vars.get("status"); + + +if(data.equals("PASS")) +{ + SampleResult.setSuccessful(true); +} +else +{ + SampleResult.setSuccessful(false); +} + + groovy + + + + + + continue + + false + ${loopCount} + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT distinct id, reg_id, cr_dtimes as cr_dtimes1 + FROM regprc.registration_transaction where reg_id = '${regId}' and trn_type_code = 'SECUREZONE_NOTIFICATION'; + + + id,reg_id,cr_dtimes1 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + prev.setIgnore() + + + + + credentialConnection + Select Statement + SELECT id, upd_dtimes as upd_dtimes2 + FROM credential.credential_transaction where id = '${regId}-PDF' and status_code = 'STORED'; + + + id,upd_dtimes2 + + + Store as String + + + + + + id + + + Assertion.response_data + false + 2 + + + + groovy + + + true + import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.time.Duration + +// Fetch timestamps from JMeter variables +String createdTime=vars.get("cr_dtimes1_1"); +String updatedTime=vars.get("upd_dtimes2_1"); + +if (createdTime == null || updatedTime == null) { + + vars.put("timeDifferenceMs", "0"); + vars.put("status","FAIL"); +} else { + + createdTime = createdTime.replaceAll(/\.(\d{3})\d*/, '.$1') + updatedTime = updatedTime.replaceAll(/\.(\d{3})\d*/, '.$1') + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") + + // Parse timestamps + LocalDateTime dt1 = LocalDateTime.parse(createdTime, formatter) + LocalDateTime dt2 = LocalDateTime.parse(updatedTime, formatter) + + // Calculate the difference in milliseconds + long millisDiff = Duration.between(dt1, dt2).toMillis() + + // Store the result in a JMeter variable + vars.put("timeDifferenceMs", String.valueOf(millisDiff)) + + // Log output + //log.info("Time Difference: ${millisDiff} milliseconds") + vars.put("status","PASS"); +} +prev.setIgnore(); + + + + + false + true + 200 + OK + + ${status} + ${timeDifferenceMs} + 0 + 0 + + org.apache.jmeter.samplers.SampleResult + + + + true + + + def data=vars.get("status"); + + +if(data.equals("PASS")) +{ + SampleResult.setSuccessful(true); +} +else +{ + SampleResult.setSuccessful(false); +} + + groovy + + + + + + continue + + false + 1 + + 1 + 1 + false + + + true + + + + regprocConnection + Select Statement + SELECT count(*) + FROM regprc.registration where upd_dtimes between '${testStart}' and '${testEnd}' and status_code = 'PROCESSED'; + + + + + + Store as String + + + + + + count + + + Assertion.response_data + false + 2 + + + + + regprocConnection + Select Statement + SELECT count(*) + FROM regprc.registration where upd_dtimes between '${testStart}' and '${testEnd}' and status_code = 'FAILED'; + + + + + + Store as String + + + + + + count + + + Assertion.response_data + false + 2 + + + + + credentialConnection + Select Statement + SELECT distinct count(*) FROM credential.credential_transaction where upd_dtimes between '${testStart}' and '${testEnd}' and status_code = 'STORED'; + + + + + + Store as String + + + + + + count + + + Assertion.response_data + false + 2 + + + + + credentialConnection + Select Statement + SELECT distinct count(*) FROM credential.credential_transaction where upd_dtimes between '${testStart}' and '${testEnd}' and status_code = 'FAILED'; + + + + + + Store as String + + + + + + count + + + Assertion.response_data + false + 2 + + + + + + true + + saveConfig + + + false + true + true + + true + true + true + true + false + true + true + true + false + false + true + false + false + false + false + 0 + true + true + true + true + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + + diff --git a/performance-test/support-files/context_details.csv b/performance-test/support-files/context_details.csv new file mode 100644 index 00000000000..91e731b7b75 --- /dev/null +++ b/performance-test/support-files/context_details.csv @@ -0,0 +1 @@ +sanjay1,88131,10423,Techno@123 \ No newline at end of file diff --git a/registration-processor/core-processor/registration-processor-abis-handler-stage/DockerfileNotUsed b/registration-processor/core-processor/registration-processor-abis-handler-stage/DockerfileNotUsed index 7f6ac37cd5d..9f91f74606f 100644 --- a/registration-processor/core-processor/registration-processor-abis-handler-stage/DockerfileNotUsed +++ b/registration-processor/core-processor/registration-processor-abis-handler-stage/DockerfileNotUsed @@ -43,7 +43,7 @@ CMD if [ "$is_glowroot_env" = "present" ]; then \ apt-get update && apt-get install -y unzip ; \ unzip glowroot.zip ; \ rm -rf glowroot.zip ; \ - + sed -i 's//registration-processor-abis-handler-stage/g' glowroot/glowroot.properties ; \ java -jar -javaagent:glowroot/glowroot.jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-abis-handler-stage.jar ; \ else \ diff --git a/registration-processor/core-processor/registration-processor-abis/Dockerfile b/registration-processor/core-processor/registration-processor-abis/Dockerfile index 58b97124b3c..2f90a6ad1ab 100644 --- a/registration-processor/core-processor/registration-processor-abis/Dockerfile +++ b/registration-processor/core-processor/registration-processor-abis/Dockerfile @@ -83,14 +83,4 @@ RUN chown -R ${container_user}:${container_user} /home/${container_user} # select container user for all tasks USER ${container_user_uid}:${container_user_gid} -CMD if [ "$is_glowroot_env" = "present" ]; then \ - wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \ - unzip glowroot.zip ; \ - rm -rf glowroot.zip ; \ - sed -i 's//registration-processor-abis/g' glowroot/glowroot.properties ; \ - java -jar -javaagent:glowroot/glowroot.jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-abis.jar ; \ - else \ - java -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-abis.jar ; \ - fi - -#CMD ["java","-Dspring.cloud.config.label=${spring_config_label_env}","-Dspring.profiles.active=${active_profile_env}","-Dspring.cloud.config.uri=${spring_config_url_env}","-jar","registration-processor-abis.jar"] +CMD java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-abis.jar ; \ diff --git a/registration-processor/core-processor/registration-processor-abis/pom.xml b/registration-processor/core-processor/registration-processor-abis/pom.xml index 60cac7e89a4..02aa31faaf5 100644 --- a/registration-processor/core-processor/registration-processor-abis/pom.xml +++ b/registration-processor/core-processor/registration-processor-abis/pom.xml @@ -97,7 +97,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true diff --git a/registration-processor/core-processor/registration-processor-biometric-authentication-stage/src/main/java/io/mosip/registration/processor/biometric/authentication/config/BiometricAuthConfigBean.java b/registration-processor/core-processor/registration-processor-biometric-authentication-stage/src/main/java/io/mosip/registration/processor/biometric/authentication/config/BiometricAuthConfigBean.java index 605d8c078f8..187d2adf236 100644 --- a/registration-processor/core-processor/registration-processor-biometric-authentication-stage/src/main/java/io/mosip/registration/processor/biometric/authentication/config/BiometricAuthConfigBean.java +++ b/registration-processor/core-processor/registration-processor-biometric-authentication-stage/src/main/java/io/mosip/registration/processor/biometric/authentication/config/BiometricAuthConfigBean.java @@ -12,7 +12,6 @@ import io.mosip.kernel.biosdk.provider.factory.BioAPIFactory; import io.mosip.kernel.core.crypto.spi.CryptoCoreSpec; import io.mosip.kernel.crypto.jce.core.CryptoCore; -import io.mosip.kernel.keygenerator.bouncycastle.KeyGenerator; import io.mosip.registration.processor.packet.storage.utils.BioSdkUtil; @Configuration @@ -23,10 +22,6 @@ public BioSdkUtil getBioSdkUtil() { return new BioSdkUtil(); } - @Bean - public KeyGenerator getKeyGenerator() { - return new KeyGenerator(); - } @Bean @Primary diff --git a/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java b/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java index fd94304312a..b320e3315da 100644 --- a/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java +++ b/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java @@ -463,35 +463,48 @@ public MessageDTO process(MessageDTO object) { return object; } - private void loadDemographicIdentity(Map fieldMap, JSONObject demographicIdentity) throws IOException, JSONException { - for (Map.Entry e : fieldMap.entrySet()) { - if (e.getValue() != null) { - String value = e.getValue().toString(); - if (value != null) { - Object json = new JSONTokener(value).nextValue(); - if (json instanceof org.json.JSONObject) { - HashMap hashMap = objectMapper.readValue(value, HashMap.class); - demographicIdentity.putIfAbsent(e.getKey(), hashMap); - } - else if (json instanceof JSONArray) { - List jsonList = new ArrayList<>(); - JSONArray jsonArray = new JSONArray(value); - for (int i = 0; i < jsonArray.length(); i++) { - Object obj = jsonArray.get(i); - HashMap hashMap = objectMapper.readValue(obj.toString(), HashMap.class); - if(trimWhitespaces && hashMap.get("value") instanceof String) { - hashMap.put("value",((String)hashMap.get("value")).trim()); - } - jsonList.add(hashMap); - } - demographicIdentity.putIfAbsent(e.getKey(), jsonList); - } else - demographicIdentity.putIfAbsent(e.getKey(), value); - } else - demographicIdentity.putIfAbsent(e.getKey(), value); - } - } - } + private void loadDemographicIdentity(Map fieldMap, JSONObject demographicIdentity) throws IOException, JSONException { + for (Map.Entry e : fieldMap.entrySet()) { + if (e.getValue() == null) { + continue; + } + + String value = e.getValue().toString(); + if (value == null) { + demographicIdentity.putIfAbsent(e.getKey(), value); + continue; + } + + Object json = new JSONTokener(value).nextValue(); + if (json instanceof org.json.JSONObject) { + HashMap hashMap = objectMapper.readValue(value, HashMap.class); + demographicIdentity.putIfAbsent(e.getKey(), hashMap); + continue; + } + + if (json instanceof JSONArray) { + List jsonList = new ArrayList<>(); + JSONArray jsonArray = new JSONArray(value); + for (int i = 0; i < jsonArray.length(); i++) { + Object obj = jsonArray.get(i); + if (obj instanceof String) { + jsonList.add(obj); + } else { + HashMap hashMap = objectMapper.readValue(obj.toString(), HashMap.class); + + if (trimWhitespaces && hashMap.containsKey("value") && hashMap.get("value") instanceof String) { + hashMap.put("value", ((String) hashMap.get("value")).trim()); + } + jsonList.add(hashMap); + } + } + demographicIdentity.putIfAbsent(e.getKey(), jsonList); + } + else { + demographicIdentity.putIfAbsent(e.getKey(), value); + } + } + } /** * Send id repo with uin. diff --git a/registration-processor/core-processor/registration-processor-uin-generator-stage/src/test/java/io/mosip/registration/processor/stages/uigenerator/UinGeneratorStageTest.java b/registration-processor/core-processor/registration-processor-uin-generator-stage/src/test/java/io/mosip/registration/processor/stages/uigenerator/UinGeneratorStageTest.java index 2a2ed521a14..3b0cab79928 100644 --- a/registration-processor/core-processor/registration-processor-uin-generator-stage/src/test/java/io/mosip/registration/processor/stages/uigenerator/UinGeneratorStageTest.java +++ b/registration-processor/core-processor/registration-processor-uin-generator-stage/src/test/java/io/mosip/registration/processor/stages/uigenerator/UinGeneratorStageTest.java @@ -2483,4 +2483,92 @@ public void testUinGenerationSuccessWithEmptyName() throws Exception { assertFalse(result.getInternalError()); assertTrue(result.getIsValid()); } + + @Test + public void testUinGenerationSuccessWithSelectedHanhle() throws Exception { + ReflectionTestUtils.setField(uinGeneratorStage,"trimWhitespaces",true); + Map fieldMap = new HashMap<>(); + fieldMap.put("selectedHandles","[\n" + + " \"nrcId\",\n" + + " \"email\",\n" + + " \"phoneNumber\"\n" + + " ]"); + fieldMap.put("email", "mono@mono.com"); + fieldMap.put("phoneNumber", "23456"); + fieldMap.put("dob", "11/11/2011"); + when(packetManagerService.getFields(any(),any(),any(),any())).thenReturn(fieldMap); + ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(IdRequestDto.class); + + MessageDTO messageDTO = new MessageDTO(); + messageDTO.setRid("27847657360002520181210094052"); + messageDTO.setReg_type(RegistrationType.NEW.name()); + + IdResponseDTO idResponseDTO = new IdResponseDTO(); + ResponseDTO responseDTO = new ResponseDTO(); + responseDTO.setStatus("ACTIVATED"); + idResponseDTO.setErrors(null); + idResponseDTO.setId("mosip.id.update"); + idResponseDTO.setResponse(responseDTO); + idResponseDTO.setResponsetime("2019-01-17T06:29:01.940Z"); + idResponseDTO.setVersion("1.0"); + + when(idrepoDraftService.idrepoUpdateDraft(anyString(), any(), any())).thenReturn(idResponseDTO); + when(utility.getRegistrationProcessorMappingJson(MappingJsonConstants.IDENTITY)).thenReturn(identityObj); + when(utility.getRegistrationProcessorMappingJson(MappingJsonConstants.DOCUMENT)).thenReturn(documentObj); + + MessageDTO result = uinGeneratorStage.process(messageDTO); + verify(idrepoDraftService).idrepoUpdateDraft(any(), any(), argumentCaptor.capture()); + ObjectMapper objectMapper = new ObjectMapper(); + String jsonobject=objectMapper.writeValueAsString(argumentCaptor.getAllValues().get(0).getRequest().getIdentity()); + JsonNode jsonNode=objectMapper.readTree(jsonobject); + + assertEquals("nrcId",jsonNode.get("selectedHandles").get(0).asText()); + assertEquals("email",jsonNode.get("selectedHandles").get(1).asText()); + assertEquals("phoneNumber",jsonNode.get("selectedHandles").get(2).asText()); + assertFalse(result.getInternalError()); + assertTrue(result.getIsValid()); + } + + @Test + public void testUinGenerationSuccessWithObjectDataType () throws Exception { + ReflectionTestUtils.setField(uinGeneratorStage,"trimWhitespaces",true); + Map fieldMap = new HashMap<>(); + fieldMap.put("individualBiometrics","{\n" + + " \"format\": \"cbeff\",\n" + + " \"value\": \"individualBiometrics_bio_CBEFF\",\n" + + " \"version\": 1\n" + + " }"); + fieldMap.put("email", "mono@mono.com"); + fieldMap.put("phoneNumber", "23456"); + fieldMap.put("dob", "11/11/2011"); + when(packetManagerService.getFields(any(),any(),any(),any())).thenReturn(fieldMap); + ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(IdRequestDto.class); + + MessageDTO messageDTO = new MessageDTO(); + messageDTO.setRid("27847657360002520181210094052"); + messageDTO.setReg_type(RegistrationType.NEW.name()); + + IdResponseDTO idResponseDTO = new IdResponseDTO(); + ResponseDTO responseDTO = new ResponseDTO(); + responseDTO.setStatus("ACTIVATED"); + idResponseDTO.setErrors(null); + idResponseDTO.setId("mosip.id.update"); + idResponseDTO.setResponse(responseDTO); + idResponseDTO.setResponsetime("2019-01-17T06:29:01.940Z"); + idResponseDTO.setVersion("1.0"); + + when(idrepoDraftService.idrepoUpdateDraft(anyString(), any(), any())).thenReturn(idResponseDTO); + when(utility.getRegistrationProcessorMappingJson(MappingJsonConstants.IDENTITY)).thenReturn(identityObj); + when(utility.getRegistrationProcessorMappingJson(MappingJsonConstants.DOCUMENT)).thenReturn(documentObj); + + MessageDTO result = uinGeneratorStage.process(messageDTO); + verify(idrepoDraftService).idrepoUpdateDraft(any(), any(), argumentCaptor.capture()); + ObjectMapper objectMapper = new ObjectMapper(); + String jsonobject=objectMapper.writeValueAsString(argumentCaptor.getAllValues().get(0).getRequest().getIdentity()); + JsonNode jsonNode=objectMapper.readTree(jsonobject); + + assertEquals("cbeff",jsonNode.get("individualBiometrics").get("format").asText()); + assertFalse(result.getInternalError()); + assertTrue(result.getIsValid()); + } } \ No newline at end of file diff --git a/registration-processor/init/registration-processor-packet-receiver-stage/Dockerfile b/registration-processor/init/registration-processor-packet-receiver-stage/Dockerfile index 14b1cdb81d6..f190bf18f21 100644 --- a/registration-processor/init/registration-processor-packet-receiver-stage/Dockerfile +++ b/registration-processor/init/registration-processor-packet-receiver-stage/Dockerfile @@ -33,16 +33,4 @@ COPY ./target/registration-processor-packet-receiver-stage-*.jar registration-pr EXPOSE 8081 EXPOSE 4001 -CMD if [ "$active_profile_env" = "preprod" ]; then \ - wget 'http://13.71.87.138:8040/artifactory/libs-release-local/io/mosip/testing/glowroot.zip' ; \ - apt-get update && apk add -q unzip wget ; \ - unzip glowroot.zip ; \ - rm -rf glowroot.zip ; \ - - sed -i 's//registration-processor-packet-receiver-stage/g' glowroot/glowroot.properties ; \ - java -jar -javaagent:glowroot/glowroot.jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-packet-receiver-stage.jar ; \ - else \ - java -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-packet-receiver-stage.jar ; \ - fi - -#CMD ["java","-Dspring.cloud.config.label=${spring_config_label_env}","-Dspring.profiles.active=${active_profile_env}","-Dspring.cloud.config.uri=${spring_config_url_env}","-jar","-javaagent:/home/Glowroot/glowroot.jar","registration-processor-packet-receiver-stage.jar"] +CMD java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-packet-receiver-stage.jar ; \ diff --git a/registration-processor/init/registration-processor-registration-status-service/Dockerfile b/registration-processor/init/registration-processor-registration-status-service/Dockerfile index 6024db386db..dc9d88f97a7 100644 --- a/registration-processor/init/registration-processor-registration-status-service/Dockerfile +++ b/registration-processor/init/registration-processor-registration-status-service/Dockerfile @@ -81,17 +81,5 @@ RUN chown -R ${container_user}:${container_user} /home/${container_user} # select container user for all tasks USER ${container_user_uid}:${container_user_gid} -CMD if [ "$active_profile_env" = "preprod" ]; then \ - wget 'http://13.71.87.138:8040/artifactory/libs-release-local/io/mosip/testing/glowroot.zip' ; \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - #java -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-registration-status-service.jar; \ - unzip glowroot.zip ; \ - rm -rf glowroot.zip ; \ - sed -i 's//registration-processor-registration-status-service/g' glowroot/glowroot.properties ; \ - java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=1 -XX:+HeapDumpOnOutOfMemoryError -XX:+UseG1GC -XX:+UseStringDeduplication -jar -javaagent:glowroot/glowroot.jar -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-registration-status-service.jar ; \ - else \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - java -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-registration-status-service.jar; \ - fi - -#CMD ["java","-Dspring.cloud.config.label=${spring_config_label_env}","-Dspring.profiles.active=${active_profile_env}","-Dspring.cloud.config.uri=${spring_config_url_env}","-jar","-javaagent:/home/Glowroot/glowroot.jar","registration-processor-registration-status-service.jar"] +CMD wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ + java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-registration-status-service.jar; \ diff --git a/registration-processor/init/registration-processor-registration-status-service/pom.xml b/registration-processor/init/registration-processor-registration-status-service/pom.xml index 6122f4f8478..9c4eb621950 100644 --- a/registration-processor/init/registration-processor-registration-status-service/pom.xml +++ b/registration-processor/init/registration-processor-registration-status-service/pom.xml @@ -74,7 +74,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true ZIP @@ -105,7 +104,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true ZIP @@ -163,6 +161,45 @@ false + + maven-deploy-plugin + ${maven.deploy.plugin.version} + + true + + + + default-deploy + none + + deploy + + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true + + + default-deploy + none + + deploy + + + + + ossrh + https://oss.sonatype.org/ + false + + diff --git a/registration-processor/init/registration-processor-registration-status-service/src/test/java/io/mosip/registration/processor/status/api/controller/PacketExternalStatusControllerTest.java b/registration-processor/init/registration-processor-registration-status-service/src/test/java/io/mosip/registration/processor/status/api/controller/PacketExternalStatusControllerTest.java index 792d3803823..74db2973f12 100644 --- a/registration-processor/init/registration-processor-registration-status-service/src/test/java/io/mosip/registration/processor/status/api/controller/PacketExternalStatusControllerTest.java +++ b/registration-processor/init/registration-processor-registration-status-service/src/test/java/io/mosip/registration/processor/status/api/controller/PacketExternalStatusControllerTest.java @@ -57,6 +57,7 @@ import io.mosip.registration.processor.status.service.impl.SyncRegistrationServiceImpl; import io.mosip.registration.processor.status.utilities.RegistrationUtility; import io.mosip.registration.processor.status.validator.PacketExternalStatusRequestValidator; +import org.springframework.web.reactive.function.client.WebClient; @RunWith(SpringRunner.class) @SpringBootTest @@ -70,6 +71,10 @@ public class PacketExternalStatusControllerTest { @Qualifier("selfTokenRestTemplate") private RestTemplate restTemplate; + @MockBean + @Qualifier("selfTokenWebClient") + private WebClient webClient; + @InjectMocks PacketExternalStatusController packetExternalStatusController = new PacketExternalStatusController(); diff --git a/registration-processor/init/registration-processor-registration-status-service/src/test/java/io/mosip/registration/processor/status/api/controller/RegistrationExternalStatusControllerTest.java b/registration-processor/init/registration-processor-registration-status-service/src/test/java/io/mosip/registration/processor/status/api/controller/RegistrationExternalStatusControllerTest.java index 5fd47a6d62b..bf36eacfff5 100644 --- a/registration-processor/init/registration-processor-registration-status-service/src/test/java/io/mosip/registration/processor/status/api/controller/RegistrationExternalStatusControllerTest.java +++ b/registration-processor/init/registration-processor-registration-status-service/src/test/java/io/mosip/registration/processor/status/api/controller/RegistrationExternalStatusControllerTest.java @@ -39,6 +39,7 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.client.RestTemplate; import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.reactive.function.client.WebClient; import org.springframework.web.util.NestedServletException; import com.fasterxml.jackson.core.JsonProcessingException; @@ -80,6 +81,10 @@ public class RegistrationExternalStatusControllerTest { @Qualifier("selfTokenRestTemplate") private RestTemplate restTemplate; + @MockBean + @Qualifier("selfTokenWebClient") + private WebClient webClient; + @Autowired private MockMvc mockMvc; diff --git a/registration-processor/init/registration-processor-registration-status-service/src/test/java/io/mosip/registration/processor/status/api/controller/RegistrationStatusAndSyncControllerTest.java b/registration-processor/init/registration-processor-registration-status-service/src/test/java/io/mosip/registration/processor/status/api/controller/RegistrationStatusAndSyncControllerTest.java index d93f1e6cbc4..96b991549f4 100644 --- a/registration-processor/init/registration-processor-registration-status-service/src/test/java/io/mosip/registration/processor/status/api/controller/RegistrationStatusAndSyncControllerTest.java +++ b/registration-processor/init/registration-processor-registration-status-service/src/test/java/io/mosip/registration/processor/status/api/controller/RegistrationStatusAndSyncControllerTest.java @@ -70,6 +70,7 @@ import io.mosip.registration.processor.status.validator.LostRidRequestValidator; import io.mosip.registration.processor.status.validator.RegistrationStatusRequestValidator; import io.mosip.registration.processor.status.validator.RegistrationSyncRequestValidator; +import org.springframework.web.reactive.function.client.WebClient; /** * The Class RegistrationStatusControllerTest. @@ -88,6 +89,10 @@ public class RegistrationStatusAndSyncControllerTest { @Qualifier("selfTokenRestTemplate") private RestTemplate restTemplate; + @MockBean + @Qualifier("selfTokenWebClient") + private WebClient webClient; + /** The registration status controller. */ @InjectMocks RegistrationStatusController registrationStatusController = new RegistrationStatusController(); diff --git a/registration-processor/pom.xml b/registration-processor/pom.xml index e011abe4d89..5cbd687494c 100644 --- a/registration-processor/pom.xml +++ b/registration-processor/pom.xml @@ -44,10 +44,8 @@ 3.7.0.1746 3.2.0 3.3.0 - - - 3.2.3 - + 3.1.1 + 1.6.14 3.0.0 diff --git a/registration-processor/post-processor/registration-processor-registration-transaction-service/Dockerfile b/registration-processor/post-processor/registration-processor-registration-transaction-service/Dockerfile index 0d388bb95cf..0ec3f240551 100644 --- a/registration-processor/post-processor/registration-processor-registration-transaction-service/Dockerfile +++ b/registration-processor/post-processor/registration-processor-registration-transaction-service/Dockerfile @@ -96,18 +96,5 @@ USER ${container_user_uid}:${container_user_gid} EXPOSE 8110 -CMD if [ "$is_glowroot_env" = "present" ]; then \ - wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - #java -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-registration-transaction-service.jar; \ - unzip glowroot.zip ; \ - rm -rf glowroot.zip ; \ - sed -i 's//registration-processor-registration-transaction-service/g' glowroot/glowroot.properties ; \ - java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=1 -XX:+HeapDumpOnOutOfMemoryError -XX:+UseG1GC -XX:+UseStringDeduplication -jar -javaagent:glowroot/glowroot.jar -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-registration-transaction-service.jar ; \ - else \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - java -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-registration-transaction-service.jar; \ - fi - - -#CMD ["java","-Dspring.cloud.config.label=${spring_config_label_env}","-Dspring.profiles.active=${active_profile_env}","-Dspring.cloud.config.uri=${spring_config_url_env}","-jar","registration-processor-registration-transaction-service.jar"] +CMD wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ + java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-registration-transaction-service.jar; \ diff --git a/registration-processor/post-processor/registration-processor-registration-transaction-service/pom.xml b/registration-processor/post-processor/registration-processor-registration-transaction-service/pom.xml index c16f2973548..a97ba08e21f 100644 --- a/registration-processor/post-processor/registration-processor-registration-transaction-service/pom.xml +++ b/registration-processor/post-processor/registration-processor-registration-transaction-service/pom.xml @@ -79,7 +79,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true ZIP @@ -111,7 +110,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true ZIP @@ -169,6 +167,45 @@ false + + maven-deploy-plugin + ${maven.deploy.plugin.version} + + true + + + + default-deploy + none + + deploy + + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true + + + default-deploy + none + + deploy + + + + + ossrh + https://oss.sonatype.org/ + false + + diff --git a/registration-processor/pre-processor/registration-processor-packet-validator-stage/src/main/java/io/mosip/registration/processor/stages/utils/NotificationUtility.java b/registration-processor/pre-processor/registration-processor-packet-validator-stage/src/main/java/io/mosip/registration/processor/stages/utils/NotificationUtility.java index 92881b9ea38..25b6a60d647 100644 --- a/registration-processor/pre-processor/registration-processor-packet-validator-stage/src/main/java/io/mosip/registration/processor/stages/utils/NotificationUtility.java +++ b/registration-processor/pre-processor/registration-processor-packet-validator-stage/src/main/java/io/mosip/registration/processor/stages/utils/NotificationUtility.java @@ -394,10 +394,10 @@ private ResponseDto sendEmail(String mailTo, String subjectArtifact, String arti String apiHost = env.getProperty(ApiName.EMAILNOTIFIER.name()); UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(apiHost); - builder.queryParam("mailTo", mailTo); + params.add("mailTo", mailTo); - builder.queryParam("mailSubject", subjectArtifact); - builder.queryParam("mailContent", artifact); + params.add("mailSubject", subjectArtifact); + params.add("mailContent", artifact); params.add("attachments", null); diff --git a/registration-processor/registration-processor-common-camel-bridge/Dockerfile b/registration-processor/registration-processor-common-camel-bridge/Dockerfile index 1fcd0fd6c08..683d6e90e45 100644 --- a/registration-processor/registration-processor-common-camel-bridge/Dockerfile +++ b/registration-processor/registration-processor-common-camel-bridge/Dockerfile @@ -88,7 +88,7 @@ ENV loader_path_env=${loader_path} # copying shaded jar into docker image ADD ./target/*.jar ./target/ -RUN find target/ -regextype posix-extended -regex '.*registration-processor-common-camel-bridge-[0-9\.]+[-A-Za-z0-9]*\.jar' "-print0" | xargs "-0" cp -t ./ \ +RUN find target/ -regextype posix-extended -regex '.*registration-processor-common-camel-bridge-[0-9\.]+[-A-Za-z0-9\.]*\.jar' "-print0" | xargs "-0" cp -t ./ \ && rm -rf ./target \ && rm -rf original*.jar \ && rm -rf *-sources.jar \ @@ -101,18 +101,5 @@ RUN find target/ -regextype posix-extended -regex '.*registration-processor-comm # select container user for all tasks USER ${container_user_uid}:${container_user_gid} -CMD if [ "$is_glowroot_env" = "present" ]; then \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \ - unzip glowroot.zip ; \ - rm -rf glowroot.zip ; \ - sed -i 's//registration-processor-common-camel-bridge/g' glowroot/glowroot.properties ; \ - java -Dloader.path="${loader_path_env}" -jar -javaagent:glowroot/glowroot.jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dregistration.processor.zone="${zone_env}" registration-processor-common-camel-bridge.jar ; \ - else \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - java -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dregistration.processor.zone="${zone_env}" registration-processor-common-camel-bridge.jar ; \ - fi - - -# running java jar -#CMD java -jar -Dspring.cloud.config.label=${spring_config_label_env} -Dspring.profiles.active=${active_profile_env} -Dspring.cloud.config.uri=${spring_config_url_env} -Dregistration.processor.zone=${zone_env} registration-processor-common-camel-bridge.jar +CMD wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ + java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dregistration.processor.zone="${zone_env}" registration-processor-common-camel-bridge.jar ; \ diff --git a/registration-processor/registration-processor-common-camel-bridge/pom.xml b/registration-processor/registration-processor-common-camel-bridge/pom.xml index 10eb130d068..6874503d7ea 100644 --- a/registration-processor/registration-processor-common-camel-bridge/pom.xml +++ b/registration-processor/registration-processor-common-camel-bridge/pom.xml @@ -130,7 +130,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true io.mosip.registration.processor.camel.bridge.MosipCamelBridgeApplication @@ -145,6 +144,45 @@ + + maven-deploy-plugin + ${maven.deploy.plugin.version} + + true + + + + default-deploy + none + + deploy + + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true + + + default-deploy + none + + deploy + + + + + ossrh + https://oss.sonatype.org/ + false + + diff --git a/registration-processor/registration-processor-info-storage-service/src/main/java/io/mosip/registration/processor/packet/storage/config/PacketStorageBeanConfig.java b/registration-processor/registration-processor-info-storage-service/src/main/java/io/mosip/registration/processor/packet/storage/config/PacketStorageBeanConfig.java index 5bef45dfed6..b399548cba7 100644 --- a/registration-processor/registration-processor-info-storage-service/src/main/java/io/mosip/registration/processor/packet/storage/config/PacketStorageBeanConfig.java +++ b/registration-processor/registration-processor-info-storage-service/src/main/java/io/mosip/registration/processor/packet/storage/config/PacketStorageBeanConfig.java @@ -27,7 +27,6 @@ import io.mosip.kernel.crypto.jce.core.CryptoCore; import io.mosip.kernel.dataaccess.hibernate.config.HibernateDaoConfig; import io.mosip.kernel.dataaccess.hibernate.repository.impl.HibernateRepositoryImpl; -import io.mosip.kernel.keygenerator.bouncycastle.KeyGenerator; import io.mosip.registration.processor.core.packet.dto.Identity; import io.mosip.registration.processor.core.spi.packetmanager.PacketInfoManager; import io.mosip.registration.processor.packet.manager.idreposervice.IdRepoService; @@ -98,10 +97,6 @@ public BioSdkUtil getBioSdkUtil() { } - @Bean - public KeyGenerator getKeyGenerator() { - return new KeyGenerator(); - } @Bean @Primary diff --git a/registration-processor/registration-processor-landing-zone/Dockerfile b/registration-processor/registration-processor-landing-zone/Dockerfile index 9f0630a4458..cc6c9c2249d 100644 --- a/registration-processor/registration-processor-landing-zone/Dockerfile +++ b/registration-processor/registration-processor-landing-zone/Dockerfile @@ -78,17 +78,5 @@ RUN chown -R ${container_user}:${container_user} /home/${container_user} # select container user for all tasks USER ${container_user_uid}:${container_user_gid} -CMD if [ "$active_profile_env" = "preprod" ]; then \ - wget 'http://13.71.87.138:8040/artifactory/libs-release-local/io/mosip/testing/glowroot.zip' ; \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - #java -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-landing-zone.jar; \ - unzip glowroot.zip ; \ - rm -rf glowroot.zip ; \ - sed -i 's//registration-processor-registration-status-service/g' glowroot/glowroot.properties ; \ - java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=1 -XX:+HeapDumpOnOutOfMemoryError -XX:+UseG1GC -XX:+UseStringDeduplication -jar -javaagent:glowroot/glowroot.jar -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-landing-zone.jar ; \ - else \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - java -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-landing-zone.jar; \ - fi - -#CMD ["java","-Dspring.cloud.config.label=${spring_config_label_env}","-Dspring.profiles.active=${active_profile_env}","-Dspring.cloud.config.uri=${spring_config_url_env}","-jar","-javaagent:/home/Glowroot/glowroot.jar","registration-processor-landing-zone.jar"] +CMD wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ + java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-landing-zone.jar; \ diff --git a/registration-processor/registration-processor-landing-zone/pom.xml b/registration-processor/registration-processor-landing-zone/pom.xml index 7080c590eab..1bd1d1aa6d5 100644 --- a/registration-processor/registration-processor-landing-zone/pom.xml +++ b/registration-processor/registration-processor-landing-zone/pom.xml @@ -72,7 +72,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true ZIP @@ -86,6 +85,45 @@ + + maven-deploy-plugin + ${maven.deploy.plugin.version} + + true + + + + default-deploy + none + + deploy + + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true + + + default-deploy + none + + deploy + + + + + ossrh + https://oss.sonatype.org/ + false + + diff --git a/registration-processor/registration-processor-notification-service/Dockerfile b/registration-processor/registration-processor-notification-service/Dockerfile index 6d0707b4a9b..d48e7d0cfb4 100644 --- a/registration-processor/registration-processor-notification-service/Dockerfile +++ b/registration-processor/registration-processor-notification-service/Dockerfile @@ -86,18 +86,5 @@ RUN chown -R ${container_user}:${container_user} /home/${container_user} # select container user for all tasks USER ${container_user_uid}:${container_user_gid} -CMD if [ "$is_glowroot_env" = "present" ]; then \ - wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - #java -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-notification-service.jar; \ - unzip glowroot.zip ; \ - rm -rf glowroot.zip ; \ - sed -i 's//registration-processor-notification-service/g' glowroot/glowroot.properties ; \ - java -jar -javaagent:glowroot/glowroot.jar -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-notification-service.jar ; \ - else \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - java -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-notification-service.jar; \ - fi - -#CMD ["java","-Dspring.cloud.config.label=${spring_config_label_env}","-Dspring.profiles.active=${active_profile_env}","-Dspring.cloud.config.uri=${spring_config_url_env}","-jar","registration-processor-notification-service.jar"] - +CMD wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ + java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" registration-processor-notification-service.jar; \ diff --git a/registration-processor/registration-processor-notification-service/pom.xml b/registration-processor/registration-processor-notification-service/pom.xml index 62f6e821c9a..3684a9d2f95 100644 --- a/registration-processor/registration-processor-notification-service/pom.xml +++ b/registration-processor/registration-processor-notification-service/pom.xml @@ -106,7 +106,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true ZIP @@ -120,6 +119,45 @@ + + maven-deploy-plugin + ${maven.deploy.plugin.version} + + true + + + + default-deploy + none + + deploy + + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true + + + default-deploy + none + + deploy + + + + + ossrh + https://oss.sonatype.org/ + false + + diff --git a/registration-processor/registration-processor-registration-status-service-impl/pom.xml b/registration-processor/registration-processor-registration-status-service-impl/pom.xml index 4f0fe1ae22a..d7d78dd9431 100644 --- a/registration-processor/registration-processor-registration-status-service-impl/pom.xml +++ b/registration-processor/registration-processor-registration-status-service-impl/pom.xml @@ -104,5 +104,9 @@ powermock-api-mockito2 test + + org.springframework.boot + spring-boot-starter-webflux + diff --git a/registration-processor/registration-processor-registration-status-service-impl/src/main/java/io/mosip/registration/processor/status/service/impl/InternalAuthDelegateServiceImpl.java b/registration-processor/registration-processor-registration-status-service-impl/src/main/java/io/mosip/registration/processor/status/service/impl/InternalAuthDelegateServiceImpl.java index 6f34b871d06..6d9baa978d5 100644 --- a/registration-processor/registration-processor-registration-status-service-impl/src/main/java/io/mosip/registration/processor/status/service/impl/InternalAuthDelegateServiceImpl.java +++ b/registration-processor/registration-processor-registration-status-service-impl/src/main/java/io/mosip/registration/processor/status/service/impl/InternalAuthDelegateServiceImpl.java @@ -15,6 +15,7 @@ import org.springframework.http.MediaType; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; +import org.springframework.web.reactive.function.client.WebClient; import org.springframework.web.util.UriComponentsBuilder; import com.fasterxml.jackson.core.JsonProcessingException; @@ -63,6 +64,10 @@ public class InternalAuthDelegateServiceImpl implements InternalAuthDelegateServ @Qualifier("selfTokenRestTemplate") private RestTemplate restTemplate; + @Autowired + @Qualifier("selfTokenWebClient") + private WebClient webClient; + /** The internal auth uri. */ @Value("${ida-internal-auth-uri}") private String internalAuthUri; @@ -93,8 +98,7 @@ public AuthResponseDTO authenticate(AuthRequestDTO authRequestDTO, HttpHeaders h UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(internalAuthUri); HttpEntity httpRequestEntity = new HttpEntity(authRequestDTO, headers); - return postApi(builder.toUriString(), MediaType.APPLICATION_JSON, httpRequestEntity, AuthResponseDTO.class) - .getBody(); + return postApi(builder.toUriString(), MediaType.APPLICATION_JSON, httpRequestEntity, AuthResponseDTO.class); } /** @@ -115,12 +119,20 @@ public Object getCertificate(String applicationId, Optional referenceId, return restApiClient.getApi(builder.build().toUri(), Object.class); } - public HttpEntity postApi(String uri, MediaType mediaType, HttpEntity requestEntity, - Class responseClass) throws Exception { + public T postApi(String uri, MediaType mediaType, HttpEntity requestEntity, + Class responseClass) throws Exception { try { logger.info(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.APPLICATIONID.toString(), LoggerFileConstant.APPLICATIONID.toString(), uri); - return restTemplate.exchange(uri, HttpMethod.POST, requestEntity, responseClass); + return webClient.post() + .uri(uri) + .headers(httpHeaders -> { + requestEntity.getHeaders().forEach(httpHeaders::addAll); + }) + .bodyValue(requestEntity.getBody()) // Sends large JSON payload efficiently + .retrieve() + .bodyToMono(responseClass) + .block(); // Blocking call to get response (for synchronous behavior) } catch (Exception e) { logger.error(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.APPLICATIONID.toString(), LoggerFileConstant.APPLICATIONID.toString(), e.getMessage() + ExceptionUtils.getStackTrace(e)); diff --git a/registration-processor/registration-processor-registration-status-service-impl/src/test/java/io/mosip/registration/processor/status/service/InternalAuthDelegateServiceImplTest.java b/registration-processor/registration-processor-registration-status-service-impl/src/test/java/io/mosip/registration/processor/status/service/InternalAuthDelegateServiceImplTest.java index 863e1873970..ebe3f316683 100644 --- a/registration-processor/registration-processor-registration-status-service-impl/src/test/java/io/mosip/registration/processor/status/service/InternalAuthDelegateServiceImplTest.java +++ b/registration-processor/registration-processor-registration-status-service-impl/src/test/java/io/mosip/registration/processor/status/service/InternalAuthDelegateServiceImplTest.java @@ -1,13 +1,15 @@ package io.mosip.registration.processor.status.service; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; - -import java.util.Optional; - +import com.fasterxml.jackson.databind.ObjectMapper; +import io.mosip.registration.processor.core.auth.dto.AuthRequestDTO; +import io.mosip.registration.processor.core.auth.dto.AuthResponseDTO; +import io.mosip.registration.processor.core.auth.dto.IndividualIdDto; +import io.mosip.registration.processor.core.auth.dto.ResponseDTO; +import io.mosip.registration.processor.core.exception.ApisResourceAccessException; +import io.mosip.registration.processor.core.http.ResponseWrapper; +import io.mosip.registration.processor.core.spi.restclient.RegistrationProcessorRestClientService; +import io.mosip.registration.processor.rest.client.utils.RestApiClient; +import io.mosip.registration.processor.status.service.impl.InternalAuthDelegateServiceImpl; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -20,95 +22,110 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.util.ReflectionTestUtils; import org.springframework.web.client.RestTemplate; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Mono; -import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Optional; -import io.mosip.kernel.core.exception.NoSuchAlgorithmException; -import io.mosip.registration.processor.core.auth.dto.AuthRequestDTO; -import io.mosip.registration.processor.core.auth.dto.AuthResponseDTO; -import io.mosip.registration.processor.core.auth.dto.IndividualIdDto; -import io.mosip.registration.processor.core.auth.dto.ResponseDTO; -import io.mosip.registration.processor.core.exception.ApisResourceAccessException; -import io.mosip.registration.processor.core.http.ResponseWrapper; -import io.mosip.registration.processor.core.spi.restclient.RegistrationProcessorRestClientService; -import io.mosip.registration.processor.rest.client.utils.RestApiClient; -import io.mosip.registration.processor.status.service.impl.InternalAuthDelegateServiceImpl; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.ArgumentMatchers.*; @RunWith(SpringJUnit4ClassRunner.class) public class InternalAuthDelegateServiceImplTest { - @InjectMocks - InternalAuthDelegateServiceImpl internalAuthDelegateServiceImpl = new InternalAuthDelegateServiceImpl(); - - @Mock - RegistrationProcessorRestClientService restClientService; - - @Mock - private RestApiClient restApiClient; - - @Mock - RestTemplate restTemplate; - - @Mock - ObjectMapper mapper; - - AuthRequestDTO authRequestDTO = new AuthRequestDTO(); - AuthResponseDTO authResponse = new AuthResponseDTO(); - ResponseDTO responseDto = new ResponseDTO(); - - IndividualIdDto individualIdDto = new IndividualIdDto(); - ResponseWrapper response = new ResponseWrapper(); - - @Before - public void setup() throws Exception { - - ReflectionTestUtils.setField(internalAuthDelegateServiceImpl, "internalAuthUri", - "https://dev.mosip.net/idauthentication/v1/internal/auth"); - ReflectionTestUtils.setField(internalAuthDelegateServiceImpl, "getCertificateUri", - "https://dev.mosip.net/idauthentication/v1/internal/getCertificate"); - authRequestDTO.setEnv("Staging"); - authRequestDTO.setIndividualId("45128164920495"); - authRequestDTO.setIndividualIdType("UIN"); - authRequestDTO.setRequest("BFijjscahGoaaol"); - - responseDto.setAuthStatus(true); - authResponse.setId(""); - authResponse.setResponse(responseDto); - ResponseEntity entity = new ResponseEntity(authResponse, HttpStatus.OK); - Mockito.when(restApiClient.getRestTemplate()).thenReturn(restTemplate); - Mockito.when(restTemplate.exchange(anyString(), any(), any(), eq(AuthResponseDTO.class))).thenReturn(entity); - Mockito.when(mapper.writeValueAsString(any())).thenReturn(""); - Mockito.when(mapper.readValue(anyString(), eq(IndividualIdDto.class))).thenReturn(individualIdDto); - } - - @Test - public void authenticateSuccessTest() throws Exception { - - individualIdDto.setIndividualId("84953741281492"); - response.setResponse(individualIdDto); - response.setErrors(null); - Mockito.when(restClientService.getApi(any(), any(), anyString(), anyString(), any())).thenReturn(response); - AuthResponseDTO result = internalAuthDelegateServiceImpl.authenticate(authRequestDTO, new HttpHeaders()); - assertEquals(result.getResponse().isAuthStatus(), true); - } - - @Test(expected = ApisResourceAccessException.class) - public void authenticateIndividualIdNotFoundFailureTest() throws Exception { - - individualIdDto.setIndividualId("84953741281491"); - response.setResponse(individualIdDto); - Mockito.when(restClientService.getApi(any(), any(), anyString(), anyString(), any())).thenReturn(response); - internalAuthDelegateServiceImpl.authenticate(authRequestDTO, new HttpHeaders()); - } - - @Test - public void getCertificateSuccessTest() throws Exception { - - Optional referenceId = Optional.of("PROCESSOR"); - Mockito.when(restApiClient.getApi(any(), eq(Object.class))).thenReturn(new Object()); - Object result = internalAuthDelegateServiceImpl.getCertificate("REGISTRATIONCLIENT", - referenceId, new HttpHeaders()); - assertNotNull(result); - } + @InjectMocks + InternalAuthDelegateServiceImpl internalAuthDelegateServiceImpl = new InternalAuthDelegateServiceImpl(); + + @Mock + RegistrationProcessorRestClientService restClientService; + + @Mock + private RestApiClient restApiClient; + + @Mock + RestTemplate restTemplate; + + @Mock + WebClient webClient; + + @Mock + WebClient.RequestBodyUriSpec requestBodyUriSpec; + @Mock + WebClient.RequestHeadersSpec requestHeadersSpec; + @Mock + WebClient.ResponseSpec responseSpec; + + @Mock + ObjectMapper mapper; + + AuthRequestDTO authRequestDTO = new AuthRequestDTO(); + AuthResponseDTO authResponse = new AuthResponseDTO(); + ResponseDTO responseDto = new ResponseDTO(); + + IndividualIdDto individualIdDto = new IndividualIdDto(); + ResponseWrapper response = new ResponseWrapper(); + + @Before + public void setup() throws Exception { + + ReflectionTestUtils.setField(internalAuthDelegateServiceImpl, "internalAuthUri", + "https://dev.mosip.net/idauthentication/v1/internal/auth"); + ReflectionTestUtils.setField(internalAuthDelegateServiceImpl, "getCertificateUri", + "https://dev.mosip.net/idauthentication/v1/internal/getCertificate"); + authRequestDTO.setEnv("Staging"); + authRequestDTO.setIndividualId("45128164920495"); + authRequestDTO.setIndividualIdType("UIN"); + authRequestDTO.setRequest("BFijjscahGoaaol"); + + responseDto.setAuthStatus(true); + authResponse.setId(""); + authResponse.setResponse(responseDto); + ResponseEntity entity = new ResponseEntity(authResponse, HttpStatus.OK); + Mockito.when(restApiClient.getRestTemplate()).thenReturn(restTemplate); + Mockito.when(restTemplate.exchange(anyString(), any(), any(), eq(AuthResponseDTO.class))).thenReturn(entity); + Mockito.when(mapper.writeValueAsString(any())).thenReturn(""); + Mockito.when(mapper.readValue(anyString(), eq(IndividualIdDto.class))).thenReturn(individualIdDto); + + + Mockito.when(webClient.post()).thenReturn(requestBodyUriSpec); + Mockito.when(requestBodyUriSpec.uri(anyString())).thenReturn(requestBodyUriSpec); + Mockito.when(requestBodyUriSpec.headers(any())).thenReturn(requestBodyUriSpec); + Mockito.when(requestBodyUriSpec.bodyValue(any())).thenReturn(requestHeadersSpec); + Mockito.when(requestHeadersSpec.retrieve()).thenReturn(responseSpec); + + Mockito.when(responseSpec.bodyToMono(AuthResponseDTO.class)) + .thenReturn(Mono.just(authResponse)); + } + + @Test + public void authenticateSuccessTest() throws Exception { + + individualIdDto.setIndividualId("84953741281492"); + response.setResponse(individualIdDto); + response.setErrors(null); + Mockito.when(restClientService.getApi(any(), any(), anyString(), anyString(), any())).thenReturn(response); + AuthResponseDTO result = internalAuthDelegateServiceImpl.authenticate(authRequestDTO, new HttpHeaders()); + assertEquals(result.getResponse().isAuthStatus(), true); + } + + @Test(expected = ApisResourceAccessException.class) + public void authenticateIndividualIdNotFoundFailureTest() throws Exception { + + individualIdDto.setIndividualId("84953741281491"); + response.setResponse(individualIdDto); + Mockito.when(restClientService.getApi(any(), any(), anyString(), anyString(), any())).thenReturn(response); + internalAuthDelegateServiceImpl.authenticate(authRequestDTO, new HttpHeaders()); + } + + @Test + public void getCertificateSuccessTest() throws Exception { + + Optional referenceId = Optional.of("PROCESSOR"); + Mockito.when(restApiClient.getApi(any(), eq(Object.class))).thenReturn(new Object()); + Object result = internalAuthDelegateServiceImpl.getCertificate("REGISTRATIONCLIENT", + referenceId, new HttpHeaders()); + assertNotNull(result); + } } \ No newline at end of file diff --git a/registration-processor/stage-groups/pom.xml b/registration-processor/stage-groups/pom.xml index 7458823efd4..b8e88daade3 100644 --- a/registration-processor/stage-groups/pom.xml +++ b/registration-processor/stage-groups/pom.xml @@ -24,4 +24,47 @@ registration-processor-stage-group-6 registration-processor-stage-group-7 + + + + maven-deploy-plugin + ${maven.deploy.plugin.version} + + true + + + + default-deploy + none + + deploy + + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true + + + default-deploy + none + + deploy + + + + + ossrh + https://oss.sonatype.org/ + false + + + + \ No newline at end of file diff --git a/registration-processor/stage-groups/registration-processor-stage-group-1/Dockerfile b/registration-processor/stage-groups/registration-processor-stage-group-1/Dockerfile index 9a11f8d9cd4..278896d6afd 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-1/Dockerfile +++ b/registration-processor/stage-groups/registration-processor-stage-group-1/Dockerfile @@ -88,17 +88,6 @@ RUN chown -R ${container_user}:${container_user} /home/${container_user} # select container user for all tasks USER ${container_user_uid}:${container_user_gid} -CMD if [ "$is_glowroot_env" = "present" ]; then \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ +CMD wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ wget --no-parent "${artifactory_url_env}"/"${regproc_jars_env}" --directory-prefix "${loader_path_env}"/ ; \ - wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \ - apt-get update && apk add -q unzip wget ; \ - unzip glowroot.zip ; \ - rm -rf glowroot.zip ; \ - sed -i 's//registration-processor-external-stage/g' glowroot/glowroot.properties ; \ - java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} -jar -javaagent:glowroot/glowroot.jar ${group_name}.jar ; \ - else \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - wget --no-parent "${artifactory_url_env}"/"${regproc_jars_env}" --directory-prefix "${loader_path_env}"/ ; \ - java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} -jar ${group_name}.jar ; \ - fi + java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} -jar ${group_name}.jar ; \ diff --git a/registration-processor/stage-groups/registration-processor-stage-group-1/pom.xml b/registration-processor/stage-groups/registration-processor-stage-group-1/pom.xml index 7b1c2977c14..670aeb05790 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-1/pom.xml +++ b/registration-processor/stage-groups/registration-processor-stage-group-1/pom.xml @@ -40,7 +40,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true io.mosip.registration.processor.stages.executor.MosipStageExecutorApplication @@ -55,6 +54,45 @@ + + maven-deploy-plugin + ${maven.deploy.plugin.version} + + true + + + + default-deploy + none + + deploy + + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true + + + default-deploy + none + + deploy + + + + + ossrh + https://oss.sonatype.org/ + false + + diff --git a/registration-processor/stage-groups/registration-processor-stage-group-2/Dockerfile b/registration-processor/stage-groups/registration-processor-stage-group-2/Dockerfile index 04512853b24..9fe362b0290 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-2/Dockerfile +++ b/registration-processor/stage-groups/registration-processor-stage-group-2/Dockerfile @@ -100,14 +100,5 @@ USER ${container_user_uid}:${container_user_gid} ENTRYPOINT [ "./configure_start.sh" ] -CMD if [ "$is_glowroot_env" = "present" ]; then \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \ - unzip glowroot.zip ; \ - rm -rf glowroot.zip ; \ - sed -i 's//registration-processor-external-stage/g' glowroot/glowroot.properties ; \ - java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.io.Reader=ALL-UNNAMED --add-opens java.base/java.util.Optional=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED-jar -javaagent:glowroot/glowroot.jar ${group_name}.jar ; \ - else \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.io.Reader=ALL-UNNAMED --add-opens java.base/java.util.Optional=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED -jar ${group_name}.jar ; \ - fi +CMD wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ + java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.io.Reader=ALL-UNNAMED --add-opens java.base/java.util.Optional=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED -jar ${group_name}.jar ; \ diff --git a/registration-processor/stage-groups/registration-processor-stage-group-2/pom.xml b/registration-processor/stage-groups/registration-processor-stage-group-2/pom.xml index 40e18136a13..16857633169 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-2/pom.xml +++ b/registration-processor/stage-groups/registration-processor-stage-group-2/pom.xml @@ -49,7 +49,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true io.mosip.registration.processor.stages.executor.MosipStageExecutorApplication @@ -64,6 +63,45 @@ + + maven-deploy-plugin + ${maven.deploy.plugin.version} + + true + + + + default-deploy + none + + deploy + + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true + + + default-deploy + none + + deploy + + + + + ossrh + https://oss.sonatype.org/ + false + + diff --git a/registration-processor/stage-groups/registration-processor-stage-group-3/Dockerfile b/registration-processor/stage-groups/registration-processor-stage-group-3/Dockerfile index f6d652039c6..93165423824 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-3/Dockerfile +++ b/registration-processor/stage-groups/registration-processor-stage-group-3/Dockerfile @@ -85,14 +85,5 @@ RUN chown -R ${container_user}:${container_user} /home/${container_user} # select container user for all tasks USER ${container_user_uid}:${container_user_gid} -CMD if [ "$is_glowroot_env" = "present" ]; then \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \ - unzip glowroot.zip ; \ - rm -rf glowroot.zip ; \ - sed -i 's//registration-processor-external-stage/g' glowroot/glowroot.properties ; \ - java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} -jar -javaagent:glowroot/glowroot.jar ${group_name}.jar ; \ - else \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} -jar ${group_name}.jar ; \ - fi +CMD wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ + java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} -jar ${group_name}.jar ; \ diff --git a/registration-processor/stage-groups/registration-processor-stage-group-3/pom.xml b/registration-processor/stage-groups/registration-processor-stage-group-3/pom.xml index c0d10f732e6..64f42179c28 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-3/pom.xml +++ b/registration-processor/stage-groups/registration-processor-stage-group-3/pom.xml @@ -55,7 +55,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true io.mosip.registration.processor.stages.executor.MosipStageExecutorApplication @@ -70,6 +69,45 @@ + + maven-deploy-plugin + ${maven.deploy.plugin.version} + + true + + + + default-deploy + none + + deploy + + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true + + + default-deploy + none + + deploy + + + + + ossrh + https://oss.sonatype.org/ + false + + \ No newline at end of file diff --git a/registration-processor/stage-groups/registration-processor-stage-group-4/Dockerfile b/registration-processor/stage-groups/registration-processor-stage-group-4/Dockerfile index ee86e674ae4..629354ed7e6 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-4/Dockerfile +++ b/registration-processor/stage-groups/registration-processor-stage-group-4/Dockerfile @@ -100,15 +100,5 @@ USER ${container_user_uid}:${container_user_gid} ENTRYPOINT [ "./configure_start.sh" ] -CMD if [ "$is_glowroot_env" = "present" ]; then \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \ -#apt-get update && apk add -q unzip wget ; \ - unzip glowroot.zip ; \ - rm -rf glowroot.zip ; \ - sed -i 's//registration-processor-external-stage/g' glowroot/glowroot.properties ; \ - java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.io.Reader=ALL-UNNAMED --add-opens java.base/java.util.Optional=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED -jar -javaagent:glowroot/glowroot.jar ${group_name}.jar ; \ - else \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.io.Reader=ALL-UNNAMED --add-opens java.base/java.util.Optional=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED -jar ${group_name}.jar ; \ - fi +CMD wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ + java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.io.Reader=ALL-UNNAMED --add-opens java.base/java.util.Optional=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED -jar ${group_name}.jar ; \ diff --git a/registration-processor/stage-groups/registration-processor-stage-group-4/pom.xml b/registration-processor/stage-groups/registration-processor-stage-group-4/pom.xml index b2ab3910d03..4910fb61f65 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-4/pom.xml +++ b/registration-processor/stage-groups/registration-processor-stage-group-4/pom.xml @@ -45,7 +45,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true io.mosip.registration.processor.stages.executor.MosipStageExecutorApplication @@ -60,6 +59,45 @@ + + maven-deploy-plugin + ${maven.deploy.plugin.version} + + true + + + + default-deploy + none + + deploy + + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true + + + default-deploy + none + + deploy + + + + + ossrh + https://oss.sonatype.org/ + false + + \ No newline at end of file diff --git a/registration-processor/stage-groups/registration-processor-stage-group-5/Dockerfile b/registration-processor/stage-groups/registration-processor-stage-group-5/Dockerfile index e12007f5ce3..8262a17cb67 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-5/Dockerfile +++ b/registration-processor/stage-groups/registration-processor-stage-group-5/Dockerfile @@ -97,14 +97,5 @@ USER ${container_user_uid}:${container_user_gid} ENTRYPOINT [ "./configure_start.sh" ] -CMD if [ "$is_glowroot_env" = "present" ]; then \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \ - unzip glowroot.zip ; \ - rm -rf glowroot.zip ; \ - sed -i 's//registration-processor-external-stage/g' glowroot/glowroot.properties ; \ - java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.io.Reader=ALL-UNNAMED --add-opens java.base/java.util.Optional=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED -jar -javaagent:glowroot/glowroot.jar ${group_name}.jar ; \ - else \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.io.Reader=ALL-UNNAMED --add-opens java.base/java.util.Optional=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED -jar ${group_name}.jar ; \ - fi +CMD wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ + java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.io.Reader=ALL-UNNAMED --add-opens java.base/java.util.Optional=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED -jar ${group_name}.jar ; \ diff --git a/registration-processor/stage-groups/registration-processor-stage-group-5/pom.xml b/registration-processor/stage-groups/registration-processor-stage-group-5/pom.xml index d052e73e95f..9d1042cb24d 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-5/pom.xml +++ b/registration-processor/stage-groups/registration-processor-stage-group-5/pom.xml @@ -60,7 +60,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true io.mosip.registration.processor.stages.executor.MosipStageExecutorApplication @@ -75,6 +74,45 @@ + + maven-deploy-plugin + ${maven.deploy.plugin.version} + + true + + + + default-deploy + none + + deploy + + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true + + + default-deploy + none + + deploy + + + + + ossrh + https://oss.sonatype.org/ + false + + diff --git a/registration-processor/stage-groups/registration-processor-stage-group-6/Dockerfile b/registration-processor/stage-groups/registration-processor-stage-group-6/Dockerfile index e06cbab2b6c..919f2de1861 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-6/Dockerfile +++ b/registration-processor/stage-groups/registration-processor-stage-group-6/Dockerfile @@ -90,16 +90,6 @@ RUN chown -R ${container_user}:${container_user} /home/${container_user} # select container user for all tasks USER ${container_user_uid}:${container_user_gid} -CMD if [ "$is_glowroot_env" = "present" ]; then \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ +CMD wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ wget --no-parent "${artifactory_url_env}"/"${regproc_jars_env}" --directory-prefix "${loader_path_env}"/ ; \ - wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \ - unzip glowroot.zip ; \ - rm -rf glowroot.zip ; \ - sed -i 's//registration-processor-external-stage/g' glowroot/glowroot.properties ; \ - java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} -jar -javaagent:glowroot/glowroot.jar ${group_name}.jar ; \ - else \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - wget --no-parent "${artifactory_url_env}"/"${regproc_jars_env}" --directory-prefix "${loader_path_env}"/ ; \ - java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} -jar ${group_name}.jar ; \ - fi + java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} -jar ${group_name}.jar ; \ diff --git a/registration-processor/stage-groups/registration-processor-stage-group-6/pom.xml b/registration-processor/stage-groups/registration-processor-stage-group-6/pom.xml index 0d9f39deebb..6dc9a1491d7 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-6/pom.xml +++ b/registration-processor/stage-groups/registration-processor-stage-group-6/pom.xml @@ -48,7 +48,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true io.mosip.registration.processor.stages.executor.MosipStageExecutorApplication @@ -63,6 +62,45 @@ + + maven-deploy-plugin + ${maven.deploy.plugin.version} + + true + + + + default-deploy + none + + deploy + + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true + + + default-deploy + none + + deploy + + + + + ossrh + https://oss.sonatype.org/ + false + + diff --git a/registration-processor/stage-groups/registration-processor-stage-group-7/Dockerfile b/registration-processor/stage-groups/registration-processor-stage-group-7/Dockerfile index 1d10a397fc1..6430d280802 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-7/Dockerfile +++ b/registration-processor/stage-groups/registration-processor-stage-group-7/Dockerfile @@ -85,14 +85,5 @@ RUN chown -R ${container_user}:${container_user} /home/${container_user} # select container user for all tasks USER ${container_user_uid}:${container_user_gid} -CMD if [ "$is_glowroot_env" = "present" ]; then \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \ - unzip glowroot.zip ; \ - rm -rf glowroot.zip ; \ - sed -i 's//registration-processor-external-stage/g' glowroot/glowroot.properties ; \ - java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} -jar -javaagent:glowroot/glowroot.jar ${group_name}.jar ; \ - else \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} -jar ${group_name}.jar ; \ - fi +CMD wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ + java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dstage-group-name=${group_name} -jar ${group_name}.jar ; \ diff --git a/registration-processor/stage-groups/registration-processor-stage-group-7/pom.xml b/registration-processor/stage-groups/registration-processor-stage-group-7/pom.xml index a6f39e21d23..89124603e54 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-7/pom.xml +++ b/registration-processor/stage-groups/registration-processor-stage-group-7/pom.xml @@ -54,7 +54,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true io.mosip.registration.processor.stages.executor.MosipStageExecutorApplication @@ -69,6 +68,45 @@ + + maven-deploy-plugin + ${maven.deploy.plugin.version} + + true + + + + default-deploy + none + + deploy + + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true + + + default-deploy + none + + deploy + + + + + ossrh + https://oss.sonatype.org/ + false + + \ No newline at end of file diff --git a/registration-processor/workflow-engine/pom.xml b/registration-processor/workflow-engine/pom.xml index 62c93ccc868..df458124b3f 100644 --- a/registration-processor/workflow-engine/pom.xml +++ b/registration-processor/workflow-engine/pom.xml @@ -17,4 +17,47 @@ registration-processor-workflow-manager-service registration-processor-reprocessor + + + + maven-deploy-plugin + ${maven.deploy.plugin.version} + + true + + + + default-deploy + none + + deploy + + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true + + + default-deploy + none + + deploy + + + + + ossrh + https://oss.sonatype.org/ + false + + + + \ No newline at end of file diff --git a/registration-processor/workflow-engine/registration-processor-reprocessor/Dockerfile b/registration-processor/workflow-engine/registration-processor-reprocessor/Dockerfile index 1f3e73fd349..d54bdad4645 100644 --- a/registration-processor/workflow-engine/registration-processor-reprocessor/Dockerfile +++ b/registration-processor/workflow-engine/registration-processor-reprocessor/Dockerfile @@ -90,16 +90,5 @@ USER ${container_user_uid}:${container_user_gid} CMD wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/regproc-reprocessor-ceylon-cache-repo.zip ; \ unzip regproc-reprocessor-ceylon-cache-repo.zip ; \ rm -rf regproc-reprocessor-ceylon-cache-repo.zip ; \ - if [ "$is_glowroot_env" = "present" ]; then \ wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \ - unzip glowroot.zip ; \ - rm -rf glowroot.zip ; \ - sed -i 's//registration-processor-reprocessor/g' glowroot/glowroot.properties ; \ - java -jar -Dloader.path="${loader_path_env}" -javaagent:glowroot/glowroot.jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dceylon.cache.repo=./regproc-reprocessor-ceylon-cache-repo registration-processor-reprocessor.jar ; \ - else \ - wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - java -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dceylon.cache.repo=./regproc-reprocessor-ceylon-cache-repo registration-processor-reprocessor.jar ; \ - fi - -#CMD ["java","-Dspring.cloud.config.label=${spring_config_label_env}","-Dspring.profiles.active=${active_profile_env}","-Dspring.cloud.config.uri=${spring_config_url_env}","-jar","registration-processor-reprocessor.jar"] + java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dceylon.cache.repo=./regproc-reprocessor-ceylon-cache-repo registration-processor-reprocessor.jar ; \ diff --git a/registration-processor/workflow-engine/registration-processor-reprocessor/pom.xml b/registration-processor/workflow-engine/registration-processor-reprocessor/pom.xml index 2baefa80d28..6454548c143 100644 --- a/registration-processor/workflow-engine/registration-processor-reprocessor/pom.xml +++ b/registration-processor/workflow-engine/registration-processor-reprocessor/pom.xml @@ -101,7 +101,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true io.mosip.registration.processor.reprocessor.ReprocessorApplication @@ -116,6 +115,45 @@ + + maven-deploy-plugin + ${maven.deploy.plugin.version} + + true + + + + default-deploy + none + + deploy + + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true + + + default-deploy + none + + deploy + + + + + ossrh + https://oss.sonatype.org/ + false + + diff --git a/registration-processor/workflow-engine/registration-processor-workflow-manager-service/Dockerfile b/registration-processor/workflow-engine/registration-processor-workflow-manager-service/Dockerfile index cd65cb4c0f1..3784ae1a004 100644 --- a/registration-processor/workflow-engine/registration-processor-workflow-manager-service/Dockerfile +++ b/registration-processor/workflow-engine/registration-processor-workflow-manager-service/Dockerfile @@ -91,15 +91,5 @@ CMD wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testin wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ unzip regproc-reprocessor-ceylon-cache-repo.zip ; \ rm -rf regproc-reprocessor-ceylon-cache-repo.zip ; \ - if [ "$is_glowroot_env" = "present" ]; then \ - wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \ - unzip glowroot.zip ; \ - rm -rf glowroot.zip ; \ - sed -i 's//registration-processor-workflow-manager-service/g' glowroot/glowroot.properties ; \ - java -jar -javaagent:glowroot/glowroot.jar -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dceylon.cache.repo=./regproc-reprocessor-ceylon-cache-repo registration-processor-workflow-manager-service.jar ; \ - else \ wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \ - java -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dceylon.cache.repo=./regproc-reprocessor-ceylon-cache-repo registration-processor-workflow-manager-service.jar ; \ - fi - -#CMD ["java","-Dspring.cloud.config.label=${spring_config_label_env}","-Dspring.profiles.active=${active_profile_env}","-Dspring.cloud.config.uri=${spring_config_url_env}","-jar","registration-processor-workflow-manager-service.jar"] \ No newline at end of file + java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dceylon.cache.repo=./regproc-reprocessor-ceylon-cache-repo registration-processor-workflow-manager-service.jar ; \ diff --git a/registration-processor/workflow-engine/registration-processor-workflow-manager-service/pom.xml b/registration-processor/workflow-engine/registration-processor-workflow-manager-service/pom.xml index 698907201ca..8dbf2c3aaae 100644 --- a/registration-processor/workflow-engine/registration-processor-workflow-manager-service/pom.xml +++ b/registration-processor/workflow-engine/registration-processor-workflow-manager-service/pom.xml @@ -98,7 +98,6 @@ org.springframework.boot spring-boot-maven-plugin - ${spring.boot.version} true ZIP @@ -112,6 +111,45 @@ + + maven-deploy-plugin + ${maven.deploy.plugin.version} + + true + + + + default-deploy + none + + deploy + + + true + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true + + + default-deploy + none + + deploy + + + + + ossrh + https://oss.sonatype.org/ + false + +