diff --git a/.github/workflows/db-test.yml b/.github/workflows/db-test.yml
new file mode 100644
index 00000000000..8d3c454576b
--- /dev/null
+++ b/.github/workflows/db-test.yml
@@ -0,0 +1,39 @@
+name: PostgreSQL Test
+
+on:
+ release:
+ types: [published]
+ pull_request:
+ types: [opened, reopened, synchronize]
+ workflow_dispatch:
+ inputs:
+ message:
+ description: 'Message for manually triggering'
+ required: false
+ default: 'Triggered for Updates'
+ type: string
+ push:
+ branches:
+ - '!release-branch'
+ - release*
+ - master
+ - 1.*
+ - develop*
+ - MOSIP*
+ paths:
+ - 'db_scripts/**'
+
+jobs:
+ build-db-test:
+ strategy:
+ matrix:
+ include:
+ - DB_LOCATION: 'db_scripts/mosip_hotlist'
+ DB_NAME: 'mosip_hotlist'
+ - DB_LOCATION: 'db_scripts/mosip_master'
+ DB_NAME: 'mosip_master'
+ fail-fast: false
+ name: ${{ matrix.DB_NAME }}
+ uses: mosip/kattu/.github/workflows/db-test.yml@master
+ with:
+ DB_LOCATION: ${{ matrix.DB_LOCATION}}
diff --git a/.github/workflows/postgres-init_trigger.yml b/.github/workflows/postgres-init_trigger.yml
deleted file mode 100644
index 3de4c6f32c5..00000000000
--- a/.github/workflows/postgres-init_trigger.yml
+++ /dev/null
@@ -1,83 +0,0 @@
-name: Trigger postgres-init repo upon db scripts updates
-
-on:
- push:
- branches:
- - master
- - 1.*
- - develop
- - release*
- paths:
- - db_release_scripts/**
- - db_scripts/**
-
-jobs:
- paths-filter:
- runs-on: ubuntu-latest
- outputs:
- db_release_scripts: ${{ steps.filter.outputs.db_release_scripts }}
- db_scripts: ${{ steps.filter.outputs.db_scripts }}
- steps:
- - uses: actions/checkout@v2
- - uses: dorny/paths-filter@v2
- id: filter
- with:
- base: ${{ github.ref }}
- filters: |
- db_release_scripts:
- - 'db_release_scripts/**'
- db_scripts:
- - 'db_scripts/**'
-
- # run only if 'db_release_scripts' files were changed
- db_release_scripts_updates:
- needs: paths-filter
- if: needs.paths-filter.outputs.db_release_scripts == 'true'
- runs-on: ubuntu-latest
- steps:
- - name: Check for updates
- run: echo "Updates are present in db_release_scripts directory, Triggering postgres-init repo"
- - uses: 8398a7/action-slack@v3
- with:
- status: ${{ job.status }}
- fields: repo,message,commit,author,job,took,ref # selectable (default: repo,message)
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_DEVOPS }} # required
- if: success() # Pick up events when the job is successful.
-
- # run only if not 'db_release_scripts' files were changed
- - name: Check for no updates
- if: needs.paths-filter.outputs.db_release_scripts != 'true'
- run: echo "Updates are not present in db_release_scripts directory"
-
- # run only if 'db_scripts' files were changed
- db_scripts_updates:
- needs: paths-filter
- if: needs.paths-filter.outputs.db_scripts == 'true'
- runs-on: ubuntu-latest
- steps:
- - name: Check for updates
- run: echo "Updates are present in db_scripts directory, Triggering postgres-init repo"
- - uses: 8398a7/action-slack@v3
- with:
- status: ${{ job.status }}
- fields: repo,message,commit,author,job,took,ref # selectable (default: repo,message)
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_DEVOPS }} # required
- if: success() # Pick up events when the job is successful.
-
- # run only if not 'db_scripts' files were changed
- - name: Check for no updates
- if: needs.paths-filter.outputs.db_scripts != 'true'
- run: echo "Updates are not present in db_scripts directory"
-
- # This job is to trigger postgres-init repo.
- trigger-postgres_init_repo:
- runs-on: ubuntu-latest
- steps:
- - uses: peter-evans/repository-dispatch@v2
- with:
- token: ${{ secrets.ACTION_PAT }}
- repository: mosip/postgres-init
- base: ${{ github.ref }}
- event-type: db-event
diff --git a/.github/workflows/push-trigger.yml b/.github/workflows/push-trigger.yml
new file mode 100644
index 00000000000..c0e79f091a7
--- /dev/null
+++ b/.github/workflows/push-trigger.yml
@@ -0,0 +1,94 @@
+name: Maven Package upon a push
+
+on:
+ release:
+ types: [published]
+ pull_request:
+ types: [opened, reopened, synchronize]
+ workflow_dispatch:
+ inputs:
+ message:
+ description: 'Message for manually triggering'
+ required: false
+ default: 'Triggered for Updates'
+ type: string
+ push:
+ branches:
+ - '!release-branch'
+ - release-1*
+ - master
+ - 1.*
+ - develop
+ - MOSIP*
+
+jobs:
+ build-maven-admin-services:
+ uses: mosip/kattu/.github/workflows/maven-build.yml@master
+ with:
+ SERVICE_LOCATION: ./admin
+ BUILD_ARTIFACT: admin
+ secrets:
+ OSSRH_USER: ${{ secrets.OSSRH_USER }}
+ OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
+ OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
+ GPG_SECRET: ${{ secrets.GPG_SECRET }}
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
+
+ publish_to_nexus:
+ if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' && github.event_name != 'release' && github.event_name != 'prerelease' && github.event_name != 'publish' }}"
+ needs: build-maven-admin-services
+ uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master
+ with:
+ SERVICE_LOCATION: ./admin
+ secrets:
+ OSSRH_USER: ${{ secrets.OSSRH_USER }}
+ OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
+ OSSRH_URL: ${{ secrets.OSSRH_SNAPSHOT_URL }}
+ OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
+ GPG_SECRET: ${{ secrets.GPG_SECRET }}
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
+
+ build-dockers:
+ needs: build-maven-admin-services
+ strategy:
+ matrix:
+ include:
+ - SERVICE_LOCATION: 'admin/admin-service'
+ SERVICE_NAME: 'admin-service'
+ BUILD_ARTIFACT: 'admin'
+ - SERVICE_LOCATION: 'admin/hotlist-service'
+ SERVICE_NAME: 'hotlist-service'
+ BUILD_ARTIFACT: 'admin'
+ - SERVICE_LOCATION: 'admin/kernel-masterdata-service'
+ SERVICE_NAME: 'kernel-masterdata-service'
+ BUILD_ARTIFACT: 'admin'
+ - SERVICE_LOCATION: 'admin/kernel-syncdata-service'
+ SERVICE_NAME: 'kernel-syncdata-service'
+ BUILD_ARTIFACT: 'admin'
+ fail-fast: false
+ name: ${{ matrix.SERVICE_NAME }}
+ uses: mosip/kattu/.github/workflows/docker-build.yml@master
+ with:
+ SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }}
+ SERVICE_NAME: ${{ matrix.SERVICE_NAME }}
+ BUILD_ARTIFACT: ${{ matrix.BUILD_ARTIFACT }}
+ secrets:
+ DEV_NAMESPACE_DOCKER_HUB: ${{ secrets.DEV_NAMESPACE_DOCKER_HUB }}
+ ACTOR_DOCKER_HUB: ${{ secrets.ACTOR_DOCKER_HUB }}
+ RELEASE_DOCKER_HUB: ${{ secrets.RELEASE_DOCKER_HUB }}
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
+
+ sonar_analysis:
+ needs: build-maven-admin-services
+ if: "${{ github.event_name != 'pull_request' }}"
+ uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master
+ with:
+ SERVICE_LOCATION: ./admin
+ secrets:
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+ ORG_KEY: ${{ secrets.ORG_KEY }}
+ OSSRH_USER: ${{ secrets.OSSRH_USER }}
+ OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
+ OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
+ GPG_SECRET: ${{ secrets.GPG_SECRET }}
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
diff --git a/.github/workflows/push_trigger.yml b/.github/workflows/push_trigger.yml
deleted file mode 100644
index 75f5b34d2ad..00000000000
--- a/.github/workflows/push_trigger.yml
+++ /dev/null
@@ -1,466 +0,0 @@
-
-name: Maven Package upon a push
-
-on:
- push:
- branches:
- - '!release-branch'
- - release-1*
- - master
- - 1.*
- - develop
-
-jobs:
- build:
-
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 11
- uses: actions/setup-java@v1
- with:
- ref: ${{ github.ref }}
- java-version: 11
- server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
- settings-path: ${{ github.workspace }} # location for the settings.xml file
-
-
- - name: Setup branch and env
- run: |
- # Strip git ref prefix from version
- echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
- echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
-
- - name: Setup branch and GPG public key
- run: |
- # Strip git ref prefix from version
- echo ${{ env.BRANCH_NAME }}
- echo ${{ env.GPG_TTY }}
- sudo apt-get --yes install gnupg2
- gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg
- gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg
-
- - uses: actions/cache@v1
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-${{ env.BRANCH_NAME }}
-
- - name: Setup the settings file for ossrh server
- run: echo " ossrh ${{secrets.ossrh_user}} ${{secrets.ossrh_secret}} ossrh true gpg2 ${{secrets.gpg_secret}} allow-snapshots true snapshots-repo https://oss.sonatype.org/content/repositories/snapshots false true releases-repo https://oss.sonatype.org/service/local/staging/deploy/maven2 true false staged-releases https://oss.sonatype.org/service/local/staging/deploy/maven2/ sonar . https://sonarcloud.io false " > $GITHUB_WORKSPACE/settings.xml
-
- - name: Install xmllint
- run: |
- sudo apt-get update
- sudo apt-get install libxml2-utils
- - name: Build with Maven
- run: |
- cd admin
- mvn -B -U package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml
- - name: Ready the springboot artifacts
- run: find -name '*.jar' -executable -type f -exec zip release.zip {} +
-
- - name: Upload the springboot jars
- uses: actions/upload-artifact@v1
- with:
- name: release
- path: ./release.zip
-
- - uses: 8398a7/action-slack@v3
- with:
- status: ${{ job.status }}
- fields: repo,message,commit,workflow,job # selectable (default: repo,message)
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
- if: failure() # Pick up events even if the job fails or is canceled.
-
- publish_to_nexus:
- if: "!contains(github.ref, 'master')"
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 11
- uses: actions/setup-java@v1
- with:
- ref: ${{ github.ref }}
- java-version: 11
- server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
- settings-path: ${{ github.workspace }} # location for the settings.xml file
-
- - name: Setup branch and env
- run: |
- # Strip git ref prefix from version
- echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
- echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
-
- - name: Setup branch and GPG public key
- run: |
- # Strip git ref prefix from version
-
- echo ${{ env.BRANCH_NAME }}
-
- echo ${{ env.GPG_TTY }}
- sudo apt-get --yes install gnupg2
- gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg
- gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg
-
- - uses: actions/cache@v1
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-${{ env.BRANCH_NAME }}
-
- - name: Setup the settings file for ossrh server
- run: echo " ossrh ${{secrets.ossrh_user}} ${{secrets.ossrh_secret}} ossrh true gpg2 ${{secrets.gpg_secret}} allow-snapshots true snapshots-repo https://oss.sonatype.org/content/repositories/snapshots false true releases-repo https://oss.sonatype.org/service/local/staging/deploy/maven2 true false staged-releases https://oss.sonatype.org/service/local/staging/deploy/maven2/ sonar . https://sonarcloud.io false " > $GITHUB_WORKSPACE/settings.xml
-
- - name: Install xmllint
- run: |
- sudo apt-get update
- sudo apt-get install libxml2-utils
- - name: Build with Maven
- run: |
- cd admin
- mvn -B -U package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml
-
- - name: Publish the maven package
- run: |
- cd admin && mvn deploy -DaltDeploymentRepository=ossrh::default::${{ secrets.OSSRH_SNAPSHOT_URL }} -s $GITHUB_WORKSPACE/settings.xml -f pom.xml
- env:
- GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
- GPG_TTY: $(tty)
-
- # - uses: 8398a7/action-slack@v3
- # with:
- # status: ${{ job.status }}
- # fields: repo,message,commit,workflow,job # selectable (default: repo,message)
- # env:
- # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEVOPS_WEBHOOK }} # required
- # if: failure() # Pick up events even if the job fails or is canceled.
-
- docker-admin-service:
- needs: build
-
- runs-on: ubuntu-latest
- env:
- NAMESPACE: ${{ secrets.dev_namespace_docker_hub }}
- SERVICE_NAME: admin-service
- SERVICE_LOCATION: admin/admin-service
-
- steps:
- - uses: actions/checkout@v2
- - uses: actions/download-artifact@v1
- with:
- name: release
- path: ./
-
- - name: Setup branch name
- run: |
- # Strip git ref prefix from version
- echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
- echo ${{ env.BRANCH_NAME }}
-
- - name: Get version info from pom
- id: getPomVersion
- uses: mavrosxristoforos/get-xml-info@1.0
- with:
- xml-file: ./${{ env.SERVICE_LOCATION }}/pom.xml
- xpath: /*[local-name()="project"]/*[local-name()="version"]
-
- - name: Unzip and extract the admin-service
- run: unzip -uj "release.zip" "${{ env.SERVICE_LOCATION }}/target/*" -d "./${{ env.SERVICE_LOCATION }}/target"
-
- - name: Get current date
- id: date
- run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
-
- - name: Build image
- run: |
- cd "./${{env.SERVICE_LOCATION}}"
- docker build . --file Dockerfile --build-arg SOURCE=mosip --build-arg COMMIT_HASH=$(git rev-parse HEAD) --build-arg COMMIT_ID=$(git rev-parse --short HEAD) --build-arg BUILD_TIME=${{steps.date.outputs.date}} --tag ${{ env.SERVICE_NAME }}
- - name: Log into registry
- run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin
-
- - name: Push image
- run: |
- IMAGE_ID=$NAMESPACE/$SERVICE_NAME
-
- # Change all uppercase to lowercase
- IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
- echo "push version ${{steps.getPomVersion.outputs.info}}"
- if [[ $BRANCH_NAME == master ]]; then
- VERSION=latest
- else
- VERSION=$BRANCH_NAME
- fi
- echo IMAGE_ID=$IMAGE_ID
- echo VERSION=$VERSION
- docker tag $SERVICE_NAME $IMAGE_ID:$VERSION
- docker push $IMAGE_ID:$VERSION
- - uses: 8398a7/action-slack@v3
- with:
- status: ${{ job.status }}
- fields: repo,message,commit,workflow,job # selectable (default: repo,message)
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEVOPS_WEBHOOK }} # required
- if: failure() # Pick up events even if the job fails or is canceled.
-
- docker-kernel-masterdata-service:
- needs: build
-
- runs-on: ubuntu-latest
- env:
- NAMESPACE: ${{ secrets. dev_namespace_docker_hub }}
- SERVICE_NAME: kernel-masterdata-service
- SERVICE_LOCATION: admin/kernel-masterdata-service
-
- steps:
- - uses: actions/checkout@v2
- - uses: actions/download-artifact@v1
- with:
- name: release
- path: ./
-
- - name: Setup branch name
- run: |
- # Strip git ref prefix from version
- echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
- echo ${{ env.BRANCH_NAME }}
-
- - name: Get version info from pom
- id: getPomVersion
- uses: mavrosxristoforos/get-xml-info@1.0
- with:
- xml-file: ./${{ env.SERVICE_LOCATION }}/pom.xml
- xpath: /*[local-name()="project"]/*[local-name()="version"]
-
- - name: Unzip and extract the id-repository-vid-service
- run: unzip -uj "release.zip" "${{ env.SERVICE_LOCATION }}/target/*" -d "./${{ env.SERVICE_LOCATION }}/target"
-
- - name: Get current date
- id: date
- run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
-
- - name: Build image
- run: |
- cd "./${{env.SERVICE_LOCATION}}"
- docker build . --file Dockerfile --build-arg SOURCE=mosip --build-arg COMMIT_HASH=$(git rev-parse HEAD) --build-arg COMMIT_ID=$(git rev-parse --short HEAD) --build-arg BUILD_TIME=${{steps.date.outputs.date}} --tag ${{ env.SERVICE_NAME }}
-
- - name: Log into registry
- run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin
-
- - name: Push image
- run: |
- IMAGE_ID=$NAMESPACE/$SERVICE_NAME
-
- # Change all uppercase to lowercase
- IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
- echo "push version ${{steps.getPomVersion.outputs.info}}"
- if [[ $BRANCH_NAME == master ]]; then
- VERSION=latest
- else
- VERSION=$BRANCH_NAME
- fi
- echo IMAGE_ID=$IMAGE_ID
- echo VERSION=$VERSION
- docker tag $SERVICE_NAME $IMAGE_ID:$VERSION
- docker push $IMAGE_ID:$VERSION
- - uses: 8398a7/action-slack@v3
- with:
- status: ${{ job.status }}
- fields: repo,message,commit,workflow,job # selectable (default: repo,message)
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEVOPS_WEBHOOK }} # required
- if: failure() # Pick up events even if the job fails or is canceled.
-
- docker-kernel-syncdata-service:
- needs: build
-
- runs-on: ubuntu-latest
- env:
- NAMESPACE: ${{ secrets. dev_namespace_docker_hub }}
- SERVICE_NAME: kernel-syncdata-service
- SERVICE_LOCATION: admin/kernel-syncdata-service
-
- steps:
- - uses: actions/checkout@v2
- - uses: actions/download-artifact@v1
- with:
- name: release
- path: ./
-
- - name: Setup branch name
- run: |
- # Strip git ref prefix from version
- echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
- echo ${{ env.BRANCH_NAME }}
-
- - name: Get version info from pom
- id: getPomVersion
- uses: mavrosxristoforos/get-xml-info@1.0
- with:
- xml-file: ./${{ env.SERVICE_LOCATION }}/pom.xml
- xpath: /*[local-name()="project"]/*[local-name()="version"]
-
- - name: Unzip and extract the id-repository-vid-service
- run: unzip -uj "release.zip" "${{ env.SERVICE_LOCATION }}/target/*" -d "./${{ env.SERVICE_LOCATION }}/target"
-
- - name: Get current date
- id: date
- run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
-
- - name: Build image
- run: |
- cd "./${{env.SERVICE_LOCATION}}"
- docker build . --file Dockerfile --build-arg SOURCE=mosip --build-arg COMMIT_HASH=$(git rev-parse HEAD) --build-arg COMMIT_ID=$(git rev-parse --short HEAD) --build-arg BUILD_TIME=${{steps.date.outputs.date}} --tag ${{ env.SERVICE_NAME }}
-
- - name: Log into registry
- run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin
-
- - name: Push image
- run: |
- IMAGE_ID=$NAMESPACE/$SERVICE_NAME
-
- # Change all uppercase to lowercase
- IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
- echo "push version ${{steps.getPomVersion.outputs.info}}"
- if [[ $BRANCH_NAME == master ]]; then
- VERSION=latest
- else
- VERSION=$BRANCH_NAME
- fi
- echo IMAGE_ID=$IMAGE_ID
- echo VERSION=$VERSION
- docker tag $SERVICE_NAME $IMAGE_ID:$VERSION
- docker push $IMAGE_ID:$VERSION
- - uses: 8398a7/action-slack@v3
- with:
- status: ${{ job.status }}
- fields: repo,message,commit,workflow,job # selectable (default: repo,message)
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEVOPS_WEBHOOK }} # required
- if: failure() # Pick up events even if the job fails or is canceled.
-
- docker-hotlist-service:
- needs: build
-
- runs-on: ubuntu-latest
- env:
- NAMESPACE: ${{ secrets. dev_namespace_docker_hub }}
- SERVICE_NAME: hotlist-service
- SERVICE_LOCATION: admin/hotlist-service
-
- steps:
- - uses: actions/checkout@v2
- - uses: actions/download-artifact@v1
- with:
- name: release
- path: ./
-
- - name: Setup branch name
- run: |
- # Strip git ref prefix from version
- echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
- echo ${{ env.BRANCH_NAME }}
-
- - name: Get version info from pom
- id: getPomVersion
- uses: mavrosxristoforos/get-xml-info@1.0
- with:
- xml-file: ./${{ env.SERVICE_LOCATION }}/pom.xml
- xpath: /*[local-name()="project"]/*[local-name()="version"]
-
- - name: Unzip and extract the hotlist-service
- run: unzip -uj "release.zip" "${{ env.SERVICE_LOCATION }}/target/*" -d "./${{ env.SERVICE_LOCATION }}/target"
-
- - name: Get current date
- id: date
- run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
-
- - name: Build image
- run: |
- cd "./${{env.SERVICE_LOCATION}}"
- docker build . --file Dockerfile --build-arg SOURCE=mosip --build-arg COMMIT_HASH=$(git rev-parse HEAD) --build-arg COMMIT_ID=$(git rev-parse --short HEAD) --build-arg BUILD_TIME=${{steps.date.outputs.date}} --tag ${{ env.SERVICE_NAME }}
-
- - name: Log into registry
- run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin
-
- - name: Push image
- run: |
- IMAGE_ID=$NAMESPACE/$SERVICE_NAME
-
- # Change all uppercase to lowercase
- IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
- echo "push version ${{steps.getPomVersion.outputs.info}}"
- if [[ $BRANCH_NAME == master ]]; then
- VERSION=latest
- else
- VERSION=$BRANCH_NAME
- fi
- echo IMAGE_ID=$IMAGE_ID
- echo VERSION=$VERSION
- docker tag $SERVICE_NAME $IMAGE_ID:$VERSION
- docker push $IMAGE_ID:$VERSION
- - uses: 8398a7/action-slack@v3
- with:
- status: ${{ job.status }}
- fields: repo,message,commit,workflow,job # selectable (default: repo,message)
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEVOPS_WEBHOOK }} # required
- if: failure() # Pick up events even if the job fails or is canceled.
-
- sonar_analysis:
-
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 11
- uses: actions/setup-java@v1
- with:
- ref: ${{ github.ref }}
- java-version: 11
- server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
- settings-path: ${{ github.workspace }} # location for the settings.xml file
-
-
- - name: Setup branch and env
- run: |
- # Strip git ref prefix from version
- echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
- echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
-
- - uses: actions/cache@v1
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-${{ env.BRANCH_NAME }}
-
- - name: Setup the settings file for ossrh server
- run: echo " ossrh ${{secrets.ossrh_user}} ${{secrets.ossrh_secret}} ossrh true gpg2 ${{secrets.gpg_secret}} allow-snapshots true snapshots-repo https://oss.sonatype.org/content/repositories/snapshots false true releases-repo https://oss.sonatype.org/service/local/staging/deploy/maven2 true false staged-releases https://oss.sonatype.org/service/local/staging/deploy/maven2/ sonar . https://sonarcloud.io false " > $GITHUB_WORKSPACE/settings.xml
-
- - name: Install xmllint
- run: |
- sudo apt-get update
- sudo apt-get install libxml2-utils
-
- - name: Build with Maven
- run: |
- cd admin
- mvn -B -U package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml
-
- - name: Analyze with SonarCloud
- run: |
- cd admin
- mvn -B -Dgpg.skip verify sonar:sonar -Dsonar.projectKey=mosip_${{ github.event.repository.name }} -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }}
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- - uses: 8398a7/action-slack@v3
- with:
- status: ${{ job.status }}
- fields: repo,message,commit,workflow,job # selectable (default: repo,message)
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEVOPS_WEBHOOK }} # required
- if: failure() # Pick up events even if the job fails or is canceled.
diff --git a/.github/workflows/release_changes.yml b/.github/workflows/release_changes.yml
deleted file mode 100644
index cc9c2956d9e..00000000000
--- a/.github/workflows/release_changes.yml
+++ /dev/null
@@ -1,56 +0,0 @@
-name: Release/pre-release Preparation.
-
-on:
- workflow_dispatch:
- inputs:
- message:
- description: 'Triggered for release or pe-release'
- required: false
- default: 'Release Preparation'
- releaseTags:
- description: 'tag to update'
- required: true
- snapshotTags:
- description: 'tag to be replaced'
- required: true
- base:
- description: 'base branch for PR'
- required: true
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Setup branch and env
- run: |
- # Strip git ref prefix from version
- echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
- echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
-
- - name: Mannualy changing the pom versions
- run: find . -type f -name "*pom.xml" -print0 | xargs -0 sed -i "s/${{ github.event.inputs.snapshotTags }}/${{ github.event.inputs.releaseTags }}/g"
-
- - name: Updating the Release URL in POM
- run: |
- cd .github/workflows
- sed -i 's/OSSRH_SNAPSHOT_URL/RELEASE_URL/g' push_trigger.yml
-
- - name: Updating libs-snapshot-local to libs-release local for artifactory URL's.
- run: find . -type f -name "*Dockerfile" -print0 | xargs -0 sed -i "s/libs-snapshot-local/libs-release-local/g"
-
- - name: removing -DskipTests
- run: find . -type f -name "*push_trigger.yml" -print0 | xargs -0 sed -i "s/"-DskipTests"//g"
-
-# - name: removing --Dgpg.skip
-# run: find . -type f -name "*push_trigger.yml" -print0 | xargs -0 sed -i "s/"-Dgpg.skip"//g"
-
- - name: Create Pull Request
- uses: peter-evans/create-pull-request@v3
- with:
- token: ${{ secrets.ACTION_PAT }}
- commit-message: Updated Pom versions for release changes
- title: Release changes
- body: Automated PR for ${{ github.event.inputs.releaseTags }} release.
- branch: release-branch
- delete-branch: true
- base: ${{ github.event.inputs.base }}
diff --git a/.github/workflows/release_trigger.yml b/.github/workflows/release_trigger.yml
deleted file mode 100644
index 62d100157f2..00000000000
--- a/.github/workflows/release_trigger.yml
+++ /dev/null
@@ -1,326 +0,0 @@
-
-name: Release maven packages and docker upon a release
-
-on:
- release:
- types: [published]
-
-jobs:
- build:
-
- runs-on: ubuntu-latest
- if: github.event.pull_request.merged == true
-
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 11
- uses: actions/setup-java@v1
- with:
- ref: ${{ github.ref }}
- java-version: 11
- server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
- settings-path: ${{ github.workspace }} # location for the settings.xml file
-
- - name: Setup branch and GPG public key
- run: |
- # Strip git ref prefix from version
- echo "::set-env name=BRANCH_NAME::$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')"
- echo ${{ env.BRANCH_NAME }}
- echo "::set-env name=GPG_TTY::$(tty)"
- echo ${{ env.GPG_TTY }}
- sudo apt-get --yes install gnupg2
- gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg
- gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg
-
- - uses: actions/cache@v1
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-${{ env.BRANCH_NAME }}
-
- - name: Setup the settings file for ossrh server
- run: echo " ossrh ${{secrets.ossrh_user}} ${{secrets.ossrh_secret}} ossrh true gpg2 ${{secrets.gpg_secret}} allow-snapshots true snapshots-repo https://oss.sonatype.org/content/repositories/snapshots false true releases-repo https://oss.sonatype.org/service/local/staging/deploy/maven2 true false sonar . https://sonarcloud.io false " > $GITHUB_WORKSPACE/settings.xml
-
- - name: Install xmllint
- run: |
- sudo apt-get update
- sudo apt-get install libxml2-utils
- - name: Build with Maven
- run: |
- cd admin
- mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml
- - name: Ready the springboot artifacts
- run: find -name '*.jar' -executable -type f -exec zip release.zip {} +
-
- - name: Upload the springboot jars
- uses: actions/upload-artifact@v1
- with:
- name: release
- path: ./release.zip
-
- publish_to_nexus:
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 11
- uses: actions/setup-java@v1
- with:
- ref: ${{ github.ref }}
- java-version: 11
- server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
- settings-path: ${{ github.workspace }} # location for the settings.xml file
-
- - name: Setup branch and GPG public key
- run: |
- # Strip git ref prefix from version
- echo "::set-env name=BRANCH_NAME::$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')"
- echo ${{ env.BRANCH_NAME }}
- echo "::set-env name=GPG_TTY::$(tty)"
- echo ${{ env.GPG_TTY }}
- sudo apt-get --yes install gnupg2
- gpg2 --import ./.github/keys/mosipgpgkey_pub.gpg
- gpg2 --quiet --batch --passphrase=${{secrets.gpg_secret}} --allow-secret-key-import --import ./.github/keys/mosipgpgkey_sec.gpg
-
- - uses: actions/cache@v1
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-${{ env.BRANCH_NAME }}
-
- - name: Setup the settings file for ossrh server
- run: echo " ossrh ${{secrets.ossrh_user}} ${{secrets.ossrh_secret}} ossrh true gpg2 ${{secrets.gpg_secret}} allow-snapshots true snapshots-repo https://oss.sonatype.org/content/repositories/snapshots false true releases-repo https://oss.sonatype.org/service/local/staging/deploy/maven2 true false sonar . https://sonarcloud.io false " > $GITHUB_WORKSPACE/settings.xml
-
- - name: Install xmllint
- run: |
- sudo apt-get update
- sudo apt-get install libxml2-utils
- - name: Build with Maven
- run: |
- cd admin
- mvn -B package -s $GITHUB_WORKSPACE/settings.xml --file pom.xml
- - name: Publish the maven package
- run: |
- chmod +x ./deploy.sh
- ./deploy.sh admin $GITHUB_WORKSPACE/settings.xml .*
- env:
- GPG_TTY: $(tty)
- - name: Analyze with SonarCloud
- run: |
- cd admin
- mvn -B verify sonar:sonar -Dsonar.projectKey=${{ secrets.PROJECT_KEY }} -Dsonar.organization=${{ secrets.ORG_KEY }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }}
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- docker-admin-service:
- needs: build
-
- runs-on: ubuntu-latest
- env:
- NAMESPACE: ${{ secrets.dev_namespace_docker_hub }}
- SERVICE_NAME: admin-service
- SERVICE_LOCATION: admin/admin-service
-
- steps:
- - uses: actions/checkout@v2
- - uses: actions/download-artifact@v1
- with:
- name: release
- path: ./
-
- - name: Setup branch name
- run: |
- # Strip git ref prefix from version
- echo "::set-env name=BRANCH_NAME::$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')"
- echo ${{ env.BRANCH_NAME }}
- - name: Get version info from pom
- id: getPomVersion
- uses: mavrosxristoforos/get-xml-info@1.0
- with:
- xml-file: ./${{ env.SERVICE_LOCATION }}/pom.xml
- xpath: /*[local-name()="project"]/*[local-name()="version"]
-
- - name: Unzip and extract the admin-service
- run: unzip -uj "release.zip" "${{ env.SERVICE_LOCATION }}/target/*" -d "./${{ env.SERVICE_LOCATION }}/target"
-
- - name: Build image
- run: |
- cd "./${{env.SERVICE_LOCATION}}"
- docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }}
- - name: Log into registry
- run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin
-
- - name: Push image
- run: |
- IMAGE_ID=$NAMESPACE/$SERVICE_NAME
-
- # Change all uppercase to lowercase
- IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
- echo "push version ${{steps.getPomVersion.outputs.info}}"
- VERSION=$BRANCH_NAME
- echo IMAGE_ID=$IMAGE_ID
- echo VERSION=$VERSION
- docker tag $SERVICE_NAME $IMAGE_ID:$VERSION
- docker push $IMAGE_ID:$VERSION
-
- docker-kernel-masterdata-service:
- needs: build
-
- runs-on: ubuntu-latest
- env:
- NAMESPACE: ${{ secrets. dev_namespace_docker_hub }}
- SERVICE_NAME: kernel-masterdata-service
- SERVICE_LOCATION: admin/kernel-masterdata-service
-
- steps:
- - uses: actions/checkout@v2
- - uses: actions/download-artifact@v1
- with:
- name: release
- path: ./
-
- - name: Setup branch name
- run: |
- # Strip git ref prefix from version
- echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
- echo ${{ env.BRANCH_NAME }}
-
- - name: Get version info from pom
- id: getPomVersion
- uses: mavrosxristoforos/get-xml-info@1.0
- with:
- xml-file: ./${{ env.SERVICE_LOCATION }}/pom.xml
- xpath: /*[local-name()="project"]/*[local-name()="version"]
-
- - name: Unzip and extract the id-repository-vid-service
- run: unzip -uj "release.zip" "${{ env.SERVICE_LOCATION }}/target/*" -d "./${{ env.SERVICE_LOCATION }}/target"
-
- - name: Build image
- run: |
- cd "./${{env.SERVICE_LOCATION}}"
- docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }}
-
- - name: Log into registry
- run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin
-
- - name: Push image
- run: |
- IMAGE_ID=$NAMESPACE/$SERVICE_NAME
-
- # Change all uppercase to lowercase
- IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
- echo "push version ${{steps.getPomVersion.outputs.info}}"
- VERSION=$BRANCH_NAME
- echo IMAGE_ID=$IMAGE_ID
- echo VERSION=$VERSION
- docker tag $SERVICE_NAME $IMAGE_ID:$VERSION
- docker push $IMAGE_ID:$VERSION
-
- docker-kernel-syncdata-service:
- needs: build
-
- runs-on: ubuntu-latest
- env:
- NAMESPACE: ${{ secrets. dev_namespace_docker_hub }}
- SERVICE_NAME: kernel-syncdata-service
- SERVICE_LOCATION: kernel/kernel-syncdata-service
-
- steps:
- - uses: actions/checkout@v2
- - uses: actions/download-artifact@v1
- with:
- name: release
- path: ./
-
- - name: Setup branch name
- run: |
- # Strip git ref prefix from version
- echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
- echo ${{ env.BRANCH_NAME }}
-
- - name: Get version info from pom
- id: getPomVersion
- uses: mavrosxristoforos/get-xml-info@1.0
- with:
- xml-file: ./${{ env.SERVICE_LOCATION }}/pom.xml
- xpath: /*[local-name()="project"]/*[local-name()="version"]
-
- - name: Unzip and extract the id-repository-vid-service
- run: unzip -uj "release.zip" "${{ env.SERVICE_LOCATION }}/target/*" -d "./${{ env.SERVICE_LOCATION }}/target"
-
- - name: Build image
- run: |
- cd "./${{env.SERVICE_LOCATION}}"
- docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }}
-
- - name: Log into registry
- run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin
-
- - name: Push image
- run: |
- IMAGE_ID=$NAMESPACE/$SERVICE_NAME
-
- # Change all uppercase to lowercase
- IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
- echo "push version ${{steps.getPomVersion.outputs.info}}"
- VERSION=$BRANCH_NAME
- echo IMAGE_ID=$IMAGE_ID
- echo VERSION=$VERSION
- docker tag $SERVICE_NAME $IMAGE_ID:$VERSION
- docker push $IMAGE_ID:$VERSION
-
- docker-hotlist-service:
- needs: build
-
- runs-on: ubuntu-latest
- env:
- NAMESPACE: ${{ secrets. dev_namespace_docker_hub }}
- SERVICE_NAME: hotlist-service
- SERVICE_LOCATION: kernel/hotlist-service
-
- steps:
- - uses: actions/checkout@v2
- - uses: actions/download-artifact@v1
- with:
- name: release
- path: ./
-
- - name: Setup branch name
- run: |
- # Strip git ref prefix from version
- echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
- echo ${{ env.BRANCH_NAME }}
-
- - name: Get version info from pom
- id: getPomVersion
- uses: mavrosxristoforos/get-xml-info@1.0
- with:
- xml-file: ./${{ env.SERVICE_LOCATION }}/pom.xml
- xpath: /*[local-name()="project"]/*[local-name()="version"]
-
- - name: Unzip and extract the hotlist-service
- run: unzip -uj "release.zip" "${{ env.SERVICE_LOCATION }}/target/*" -d "./${{ env.SERVICE_LOCATION }}/target"
-
- - name: Build image
- run: |
- cd "./${{env.SERVICE_LOCATION}}"
- docker build . --file Dockerfile --tag ${{ env.SERVICE_NAME }}
-
- - name: Log into registry
- run: echo "${{ secrets.release_docker_hub }}" | docker login -u ${{ secrets.actor_docker_hub }} --password-stdin
-
- - name: Push image
- run: |
- IMAGE_ID=$NAMESPACE/$SERVICE_NAME
-
- # Change all uppercase to lowercase
- IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
- echo "push version ${{steps.getPomVersion.outputs.info}}"
- VERSION=$BRANCH_NAME
- echo IMAGE_ID=$IMAGE_ID
- echo VERSION=$VERSION
- docker tag $SERVICE_NAME $IMAGE_ID:$VERSION
- docker push $IMAGE_ID:$VERSION
\ No newline at end of file
diff --git a/admin/admin-service/pom.xml b/admin/admin-service/pom.xml
index 967984a7c10..72c33550af4 100644
--- a/admin/admin-service/pom.xml
+++ b/admin/admin-service/pom.xml
@@ -25,6 +25,36 @@
io.mosip.kernel
kernel-core
${kernel.version}
+
+
+ org.apache.logging.log4j
+ log4j-to-slf4j
+
+
+ org.apache.logging.log4j
+ log4j-api
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ 2.12.0
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ 2.12.0
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ 2.12.0
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-xml
+ 2.12.0
org.projectlombok
@@ -43,12 +73,6 @@
org.apache.poi
poi-ooxml
5.2.2
-
-
- log4j
- log4j
-
-
org.springframework.batch.extensions
@@ -125,11 +149,16 @@
-
+
+ javax.validation
+ validation-api
+ 2.0.1.Final
+
+
io.mosip.commons
commons-packet-manager
- ${kernel.version}
+ 1.2.0.1-SNAPSHOT
org.springframework.cloud
diff --git a/admin/admin-service/src/main/java/io/mosip/admin/constant/LostRidErrorCode.java b/admin/admin-service/src/main/java/io/mosip/admin/constant/LostRidErrorCode.java
index 783f27de948..3d848a4761f 100644
--- a/admin/admin-service/src/main/java/io/mosip/admin/constant/LostRidErrorCode.java
+++ b/admin/admin-service/src/main/java/io/mosip/admin/constant/LostRidErrorCode.java
@@ -3,7 +3,10 @@
public enum LostRidErrorCode {
UNABLE_TO_RETRIEVE_LOSTRID("ADMN-LRID-001", "Unable to find the lost rid.."),
+
LOST_RID_DATE_RANGE_EXCEEDED("ADMN-LRID-002","searching between date should be less than %s days");
+ UNABLE_TO_RETRIEVE_LOSTRID_DATA("ADMN-LRID-002", "Unable to find the lost rid data"),
+ UNABLE_TO_RETRIEVE_APPLICANT_PHOTO("ADMN-LRID-003", "Unable to retrieve applicantPhoto");
private final String errorCode;
private final String errorMessage;
diff --git a/admin/admin-service/src/main/java/io/mosip/admin/controller/AdminController.java b/admin/admin-service/src/main/java/io/mosip/admin/controller/AdminController.java
index f473f74d01d..92a6263b2fc 100644
--- a/admin/admin-service/src/main/java/io/mosip/admin/controller/AdminController.java
+++ b/admin/admin-service/src/main/java/io/mosip/admin/controller/AdminController.java
@@ -3,15 +3,11 @@
import java.util.ArrayList;
import java.util.List;
+import io.mosip.admin.dto.*;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-
-import io.mosip.admin.dto.ErrorDTO;
-import io.mosip.admin.dto.LostRidExtnDto;
-import io.mosip.admin.dto.LostRidResponseDto;
-import io.mosip.admin.dto.SearchInfo;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
import io.mosip.admin.packetstatusupdater.util.AuditUtil;
import io.mosip.admin.packetstatusupdater.util.EventEnum;
import io.mosip.admin.service.AdminService;
@@ -28,13 +24,24 @@ public class AdminController {
@Autowired
AuditUtil auditUtil;
+ @PreAuthorize("hasAnyRole(@authorizedRoles.getPostlostRid())")
@PostMapping("/lostRid")
- private ResponseWrapper lostRid(@RequestBody RequestWrapper searchInfo) {
+ public ResponseWrapper lostRid(@RequestBody RequestWrapper searchInfo) {
auditUtil.setAuditRequestDto(EventEnum.LOST_RID_API_CALLED,null);
LostRidResponseDto lostRidResponseDto = adminService.lostRid(searchInfo.getRequest());
auditUtil.setAuditRequestDto(EventEnum.LOST_RID_SUCCESS,null);
return buildLostRidResponse(lostRidResponseDto);
}
+
+ @PreAuthorize("hasAnyRole(@authorizedRoles.getGetlostRiddetailsrid())")
+ @GetMapping("/lostRid/details/{rid}")
+ public ResponseWrapper getLostRidDetails(@PathVariable("rid") String rid) {
+ auditUtil.setAuditRequestDto(EventEnum.LOST_RID_API_CALLED,null);
+ ResponseWrapper responseWrapper = new ResponseWrapper<>();
+ responseWrapper.setResponse(adminService.getLostRidDetails(rid));
+ auditUtil.setAuditRequestDto(EventEnum.LOST_RID_SUCCESS,null);
+ return responseWrapper;
+ }
private ResponseWrapper buildLostRidResponse(LostRidResponseDto lostRidResponseDto) {
ResponseWrapper responseWrapper = new ResponseWrapper<>();
diff --git a/admin/admin-service/src/main/java/io/mosip/admin/controller/ApplicantDetailsController.java b/admin/admin-service/src/main/java/io/mosip/admin/controller/ApplicantDetailsController.java
index ef208ad49e3..51f3f37be64 100644
--- a/admin/admin-service/src/main/java/io/mosip/admin/controller/ApplicantDetailsController.java
+++ b/admin/admin-service/src/main/java/io/mosip/admin/controller/ApplicantDetailsController.java
@@ -27,7 +27,8 @@ public class ApplicantDetailsController {
@Autowired
ApplicantDetailService applicantDetailService;
- @PreAuthorize("hasRole('DIGITALCARD_ADMIN')")
+ //@PreAuthorize("hasRole('DIGITALCARD_ADMIN')")
+ @PreAuthorize("hasAnyRole(@authorizedRoles.getGetapplicantDetailsrid())")
@GetMapping("/applicantDetails/{rid}")
public ResponseWrapper getApplicantDetails(@PathVariable("rid") String rid) throws Exception {
auditUtil.setAuditRequestDto(EventEnum.APPLICANT_VERIFICATION_API_CALLED,null);
@@ -37,8 +38,9 @@ public ResponseWrapper getApplicantDetails(@PathVariable("r
return responseWrapper;
}
- @PreAuthorize("hasRole('DIGITALCARD_ADMIN')")
- @GetMapping("/applicantDetails/getLoginDetails")
+ // @PreAuthorize("hasRole('DIGITALCARD_ADMIN')")
+ @PreAuthorize("hasAnyRole(@authorizedRoles.getGetapplicantDetailsgetLoginDetails())")
+ @GetMapping("/applicantDetails/getLoginDetails")
public ResponseWrapper getApplicantUserDetails() throws Exception {
auditUtil.setAuditRequestDto(EventEnum.APPLICANT_LOGIN_DETAILS_API_CALLED,null);
ResponseWrapper responseWrapper = new ResponseWrapper<>();
@@ -47,7 +49,8 @@ public ResponseWrapper getApplicantUserDetails() throws
return responseWrapper;
}
- @PreAuthorize("hasRole('DIGITALCARD_ADMIN')")
+ // @PreAuthorize("hasRole('DIGITALCARD_ADMIN')")
+ @PreAuthorize("hasAnyRole(@authorizedRoles.getGetriddigitalcardrid())")
@GetMapping("/rid-digital-card/{rid}")
public ResponseEntity