Skip to content

Commit

Permalink
MOSIP-35176 Migrated to java21. (#1309)
Browse files Browse the repository at this point in the history
* MOSIP-35176 Added exclusion of hibernate auto config

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added cache auto config

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added exclusion

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Deleted keystore entity

Signed-off-by: kameshsr <[email protected]>

* Fixed startup isse

Signed-off-by: kameshsr <[email protected]>

* Fixed startup isse

Signed-off-by: kameshsr <[email protected]>

* Fixed startup isse

Signed-off-by: kameshsr <[email protected]>

* Fixed startup isse

Signed-off-by: kameshsr <[email protected]>

* Fixed startup isse

Signed-off-by: kameshsr <[email protected]>

* Fixed startup isse

Signed-off-by: kameshsr <[email protected]>

* Fixed startup isse

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed startup issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added properties

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed startup failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed startup failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed startup failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed circular dependency

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed circular dependency

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed circular dependency

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed circular dependency

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed circular dependency

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed startup failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed startup failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed startup failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed ida startup issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed ida startup issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed ida startup issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed ida startup issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed ida startup issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35178 Fixed ida startup failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35178 Fixed ida startup failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35178 Fixed ida startup failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35178 Fixed ida startup failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added exclusion

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed dependency issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed dependency issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Removed unnecesarry files

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed test case failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed test case failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed test case failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed test case failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added exclusion

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added exclusion

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added exclusion

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added exclusion

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added exclusion

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed ida starup failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed docker file issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed docker file issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed docker file issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed docker file issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed docker file issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed startup issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed docker issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed configure.sh

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed configure.sh

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed configure.sh

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed configure.sh

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed configure.sh

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed configure.sh

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed configure.sh

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed configure.sh

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed pom

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added Match type helper test class

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Test case fixes

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added base config

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Corrected class name

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Corrected class name

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added javadocs

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Combined EntityInfoHelper and map class

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Corrected package name

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed BioAuthServiceTest class

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed DemoAuthServiceTest class

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed DemoAuthServiceTest class

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed DemoAuthServiceTest class

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed OtpMatchingStrategy class

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed OTPServiceImpl class

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed IdInfoFetcherimplTest class

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed KycServiceImplTest class

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed KycServiceImplTest class

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed test case failure

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added author to new class

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Removed commented code

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added auth-adapter in docker

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added demosdk

Signed-off-by: kameshsr <[email protected]>

* Revert "MOSIP-35176 Added demosdk"

This reverts commit 01e8997.

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Removed commented code

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed Ida otp service crashloop issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added auth adapter in pom

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed caching issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added cache

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added cache

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added cache

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Changed version to 121 snapshot

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added Eckeypair class

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Removed debug log

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed docker file of otp service

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added Eckey class

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Migrated ida auth service

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed docker file issue in auth service

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Removed commented code in docker

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed docker file

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed docker file

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Changed version to 121 java21 snapshot

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added hardcoded value for topic and callback url

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Hardcoded secret

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added custom Websubconfig

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Removed custom Websubconfig

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added custom Websubconfig

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added custom Websubconfig

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Changed websub version to 1201

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Changed websub version to 121 java21 snapshot

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added dbscript

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Corrected dbscript

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added subscription request

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added debug statement

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Testing get callback api

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Reverted un-necessary code

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed websub issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed startup issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed startup issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 updated auth adapter version

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed websub issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added config

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Corrected config

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed slash issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed slash issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed slash issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added extra slash

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added slash

Signed-off-by: kameshsr <[email protected]>

* Removed extra slash

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added WebConfiguration

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added WebConfiguration

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added author

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Removed lob

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added debug log

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added debug

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed batch job issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed batch job issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Increased limit

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Increased limit

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added commit

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added file size limit

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added webflux class

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 corrected version

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added resttemplate

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added comments

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added debug log

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Refactor code

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Removed lazy annotation

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added debug

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added debug log

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added info log

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed ida auth issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added logger

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added logger

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed java.base error

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed java.base error

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed java.base error

Signed-off-by: kameshsr <[email protected]>

* MOISP-35176 COmmented for testing

Signed-off-by: kameshsr <[email protected]>

* MOISP-35176 COmmented for testing

Signed-off-by: kameshsr <[email protected]>

* MOISP-35176 Add loggers

Signed-off-by: kameshsr <[email protected]>

* MOISP-35176 Corrected if condition

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added java.base

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added debug statement

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Removed unnecessary log

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Changed keymanager version

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Changed karnel-core version

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Removed sensitive logging data

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Removed sensitive logging data

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Removed base config

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added properties

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added properties

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added properties

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added logs to check signature

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Enabled debug log

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added request

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added property

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added property

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added property

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added logs

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added logs

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Removed system.out.println

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added logs

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Removed multiple calls to chain filter

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added loggers

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added logs

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added check

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed digital signature failed issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Corrected version

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Corrected version

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Removed component from filter

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Corrected properties

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Corrected properties

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 removed component

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 removed component

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 removed id check for testing

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 removed id check for testing

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Removed component

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Reverted component removal

Signed-off-by: kameshsr <[email protected]>

* MOSIP-31576 added loggers

Signed-off-by: kameshsr <[email protected]>

* MOSIP-31576 added loggers

Signed-off-by: kameshsr <[email protected]>

* MOSIP-31576 added loggers

Signed-off-by: kameshsr <[email protected]>

* MOSIP-31576 removed component

Signed-off-by: kameshsr <[email protected]>

* MOSIP-31576 removed component

Signed-off-by: kameshsr <[email protected]>

* MOSIP-31576 removed component

Signed-off-by: kameshsr <[email protected]>

* MOSIP-31576 removed component

Signed-off-by: kameshsr <[email protected]>

* MOSIP-31576 removed component

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Moved Trailing slash filter class

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed kyc auth issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed kyc auth issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed kyc auth issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added gitattributes file

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added gitattributes file

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added normalize

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Changed code as per review comment

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Fixed actuator issue

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 commented push trigger

Signed-off-by: kameshsr <[email protected]>

---------

Signed-off-by: kameshsr <[email protected]>
Signed-off-by: kameshsr <[email protected]>
  • Loading branch information
kameshsr authored Oct 15, 2024
1 parent cb195ab commit 3182fa2
Show file tree
Hide file tree
Showing 100 changed files with 3,024 additions and 1,832 deletions.
218 changes: 109 additions & 109 deletions .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,112 +90,112 @@ jobs:
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

build-maven-apitest-auth:
uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21
with:
SERVICE_LOCATION: ./apitest
BUILD_ARTIFACT: apitest-auth
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_apitest_auth:
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-apitest-auth
uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master-java21
with:
SERVICE_LOCATION: ./apitest
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-apitest-auth-local:
needs: build-maven-apitest-auth
runs-on: ubuntu-latest
env:
NAMESPACE: ${{ secrets.dev_namespace_docker_hub }}
SERVICE_NAME: apitest-auth
SERVICE_LOCATION: apitest
BUILD_ARTIFACT: apitest-auth-local
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
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 the settings file for ossrh server
run: echo "<settings> <servers> <server> <id>ossrh</id> <username>${{secrets.ossrh_user}}</username> <password>${{secrets.ossrh_secret}}</password> </server> </servers> <profiles> <profile> <id>ossrh</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <gpg.executable>gpg2</gpg.executable> <gpg.passphrase>${{secrets.gpg_secret}}</gpg.passphrase> </properties> </profile> <profile> <id>allow-snapshots</id> <activation><activeByDefault>true</activeByDefault></activation> <repositories> <repository> <id>snapshots-repo</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases><enabled>false</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> <repository> <id>releases-repo</id> <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>false</enabled></snapshots> </repository> </repositories> </profile> <profile> <id>sonar</id> <properties> <sonar.sources>.</sonar.sources> <sonar.host.url>https://sonarcloud.io</sonar.host.url> </properties> <activation> <activeByDefault>false</activeByDefault> </activation> </profile> </profiles> </settings>" > $GITHUB_WORKSPACE/settings.xml
- name: Build Automationtests with Maven
run: |
cd ${{ env.SERVICE_LOCATION}}
mvn clean package -s $GITHUB_WORKSPACE/settings.xml
- name: Copy configuration files to target directory.
run: |
cp -r ${{ env.SERVICE_LOCATION}}/target/classes/config ${{ env.SERVICE_LOCATION}}/target/config
cp -r ${{ env.SERVICE_LOCATION}}/testNgXmlFiles ${{ env.SERVICE_LOCATION}}/target/testNgXmlFiles
- name: Ready the springboot artifacts
if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }}
run: |
## FIND JARS & COPY ONLY EXECUTABLE JARs STORED UNDER TARGET DIRECTORY
find ${{ env.SERVICE_LOCATION }} -path '*/target/*' -exec zip ${{ env.BUILD_ARTIFACT }}.zip {} +
- name: Upload the springboot jars
if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_ARTIFACT }}
path: ${{ env.BUILD_ARTIFACT }}.zip
- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,author,commit,workflow,job # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
if: failure() # Pick up events even if the job fails or is canceled.

build-dockers_apitest_auth:
needs: build-apitest-auth-local
strategy:
matrix:
include:
- SERVICE_LOCATION: 'apitest'
SERVICE_NAME: 'apitest-auth'
BUILD_ARTIFACT: 'apitest-auth-local'
ONLY_DOCKER: true
fail-fast: false
name: ${{ matrix.SERVICE_NAME }}
uses: mosip/kattu/.github/workflows/docker-build.yml@master-java21
with:
SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }}
SERVICE_NAME: ${{ matrix.SERVICE_NAME }}
BUILD_ARTIFACT: ${{ matrix.BUILD_ARTIFACT }}
ONLY_DOCKER: ${{ matrix.ONLY_DOCKER }}
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_apitest_auth:
needs: build-maven-apitest-auth
if: "${{ github.event_name != 'pull_request' }}"
uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master-java21
with:
SERVICE_LOCATION: ./apitest
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
ORG_KEY: ${{ secrets.ORG_KEY }}
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
# build-maven-apitest-auth:
# uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21
# with:
# SERVICE_LOCATION: ./apitest
# BUILD_ARTIFACT: apitest-auth
# 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_apitest_auth:
# 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-apitest-auth
# uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master-java21
# with:
# SERVICE_LOCATION: ./apitest
# 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-apitest-auth-local:
# needs: build-maven-apitest-auth
# runs-on: ubuntu-latest
# env:
# NAMESPACE: ${{ secrets.dev_namespace_docker_hub }}
# SERVICE_NAME: apitest-auth
# SERVICE_LOCATION: apitest
# BUILD_ARTIFACT: apitest-auth-local
# steps:
# - uses: actions/checkout@v3
# - name: Set up JDK 21
# uses: actions/setup-java@v3
# with:
# distribution: 'temurin'
# java-version: '21'
# 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 the settings file for ossrh server
# run: echo "<settings> <servers> <server> <id>ossrh</id> <username>${{secrets.ossrh_user}}</username> <password>${{secrets.ossrh_secret}}</password> </server> </servers> <profiles> <profile> <id>ossrh</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <gpg.executable>gpg2</gpg.executable> <gpg.passphrase>${{secrets.gpg_secret}}</gpg.passphrase> </properties> </profile> <profile> <id>allow-snapshots</id> <activation><activeByDefault>true</activeByDefault></activation> <repositories> <repository> <id>snapshots-repo</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases><enabled>false</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> <repository> <id>releases-repo</id> <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>false</enabled></snapshots> </repository> </repositories> </profile> <profile> <id>sonar</id> <properties> <sonar.sources>.</sonar.sources> <sonar.host.url>https://sonarcloud.io</sonar.host.url> </properties> <activation> <activeByDefault>false</activeByDefault> </activation> </profile> </profiles> </settings>" > $GITHUB_WORKSPACE/settings.xml
# - name: Build Automationtests with Maven
# run: |
# cd ${{ env.SERVICE_LOCATION}}
# mvn clean package -s $GITHUB_WORKSPACE/settings.xml
# - name: Copy configuration files to target directory.
# run: |
# cp -r ${{ env.SERVICE_LOCATION}}/target/classes/config ${{ env.SERVICE_LOCATION}}/target/config
# cp -r ${{ env.SERVICE_LOCATION}}/testNgXmlFiles ${{ env.SERVICE_LOCATION}}/target/testNgXmlFiles
# - name: Ready the springboot artifacts
# if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }}
# run: |
# ## FIND JARS & COPY ONLY EXECUTABLE JARs STORED UNDER TARGET DIRECTORY
# find ${{ env.SERVICE_LOCATION }} -path '*/target/*' -exec zip ${{ env.BUILD_ARTIFACT }}.zip {} +
# - name: Upload the springboot jars
# if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }}
# uses: actions/upload-artifact@v3
# with:
# name: ${{ env.BUILD_ARTIFACT }}
# path: ${{ env.BUILD_ARTIFACT }}.zip
# - uses: 8398a7/action-slack@v3
# with:
# status: ${{ job.status }}
# fields: repo,message,author,commit,workflow,job # selectable (default: repo,message)
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
# if: failure() # Pick up events even if the job fails or is canceled.
#
# build-dockers_apitest_auth:
# needs: build-apitest-auth-local
# strategy:
# matrix:
# include:
# - SERVICE_LOCATION: 'apitest'
# SERVICE_NAME: 'apitest-auth'
# BUILD_ARTIFACT: 'apitest-auth-local'
# ONLY_DOCKER: true
# fail-fast: false
# name: ${{ matrix.SERVICE_NAME }}
# uses: mosip/kattu/.github/workflows/docker-build.yml@master-java21
# with:
# SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }}
# SERVICE_NAME: ${{ matrix.SERVICE_NAME }}
# BUILD_ARTIFACT: ${{ matrix.BUILD_ARTIFACT }}
# ONLY_DOCKER: ${{ matrix.ONLY_DOCKER }}
# 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_apitest_auth:
# needs: build-maven-apitest-auth
# if: "${{ github.event_name != 'pull_request' }}"
# uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master-java21
# with:
# SERVICE_LOCATION: ./apitest
# 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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ public void validateExceptionTest2() throws IdAuthenticationBusinessException {
status.setLocked(true);
List<AuthtypeStatus> authtypeStatusList = new ArrayList<>();
authtypeStatusList.add(status);
System.out.println("1= "+authtypeStatusList);
IdAuthenticationBusinessException exception = new IdAuthenticationBusinessException(IdAuthenticationErrorConstants.AUTH_TYPE_LOCKED.getErrorCode(),
String.format(IdAuthenticationErrorConstants.AUTH_TYPE_LOCKED.getErrorMessage(),
MatchType.Category.SPIN.getType()));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
package io.mosip.authentication.childauthfilter.impl;

import io.mosip.authentication.authfilter.exception.IdAuthenticationFilterException;
import io.mosip.authentication.authfilter.spi.IMosipAuthFilter;
import io.mosip.authentication.common.service.util.AuthTypeUtil;
import io.mosip.authentication.core.constant.IdAuthCommonConstants;
import io.mosip.authentication.core.constant.IdAuthenticationErrorConstants;
import io.mosip.authentication.core.indauth.dto.AuthRequestDTO;
import io.mosip.authentication.core.indauth.dto.IdentityInfoDTO;
import io.mosip.kernel.core.util.DateUtils;
import org.springframework.beans.factory.annotation.Value;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
* The Class ChildAuthFilterImpl - implementation of auth filter for
* validating AuthType locked/unlocked status for an individual in the
* authentication request.
*
* @author Kamesh Shekhar Prasad
*/
public class ChildAuthFilterImpl implements IMosipAuthFilter {


private static final String ERROR_MSG_UNSUPPORTED_AUTH_TYPE = "Unsupported Authentication Type for child - %s";

/** The Constant OTP. */
private static final String OTP = "otp";

/** The Constant DEMO. */
private static final String DEMO = "demo";

/** The Constant BIO. */
private static final String BIO = "bio";

/** The Constant DEFAULT_CHILD_MAX_AGE. */
private static final int DEFAULT_CHILD_MAX_AGE = 6;

/** The date of birth attribute name. */
@Value("${ida.child-auth-filter.date-of-birth.attribute.name:dateOfBirth}")
private String dateOfBirthAttributeName;

/** The date of birth pattern. */
@Value("${ida.child-auth-filter.date-of-birth.pattern:" + IdAuthCommonConstants.DEFAULT_DOB_PATTERN + "}")
private String dateOfBirthPattern;

/** The child max age. */
@Value("${ida.child-auth-filter.child.max.age:" + DEFAULT_CHILD_MAX_AGE + "}")
private int childMaxAge;

/** The factors denied for child. */
@Value("${ida.child-auth-filter.factors.denied:otp,bio}")
private String[] factorsDeniedForChild;

/**
* Initializes the filter.
*
* @throws IdAuthenticationFilterException the id authentication filter exception
*/
public void init() throws IdAuthenticationFilterException {
}

/**
* Test method that executes predicate test condition on the given arguments.
*
* @param authRequest the auth request
* @param identityData the identity data
* @param properties the properties
* @throws IdAuthenticationFilterException the id authentication filter exception
*/
public void validate(AuthRequestDTO authRequest, Map<String, List<IdentityInfoDTO>> identityData,
Map<String, Object> properties) throws IdAuthenticationFilterException {
LocalDate dob = getDateOfBirth(identityData.get(dateOfBirthAttributeName));
if(dob.plusYears(childMaxAge).isAfter(LocalDate.now())) {
checkDeniedFactorsForChild(authRequest);
}
}

/**
* Check denied factors for child.
*
* @param authRequest the auth request
* @throws IdAuthenticationFilterException the id authentication filter exception
*/
private void checkDeniedFactorsForChild(AuthRequestDTO authRequest) throws IdAuthenticationFilterException{
List<Object> deniedFactors = Stream.of(factorsDeniedForChild)
.map(String::toLowerCase)
.collect(Collectors.toList());
if(deniedFactors.contains(OTP) && AuthTypeUtil.isOtp(authRequest)) {
throw new IdAuthenticationFilterException(
IdAuthenticationErrorConstants.AUTH_TYPE_NOT_SUPPORTED.getErrorCode(),
String.format(ERROR_MSG_UNSUPPORTED_AUTH_TYPE, OTP));
}

if(deniedFactors.contains(DEMO) && AuthTypeUtil.isDemo(authRequest)) {
throw new IdAuthenticationFilterException(
IdAuthenticationErrorConstants.AUTH_TYPE_NOT_SUPPORTED.getErrorCode(),
String.format(ERROR_MSG_UNSUPPORTED_AUTH_TYPE, DEMO));
}

if(deniedFactors.contains(BIO) && AuthTypeUtil.isBio(authRequest)) {
throw new IdAuthenticationFilterException(
IdAuthenticationErrorConstants.AUTH_TYPE_NOT_SUPPORTED.getErrorCode(),
String.format(ERROR_MSG_UNSUPPORTED_AUTH_TYPE, BIO));
}

}

/**
* Gets the date of birth.
*
* @param dobData the dob data
* @return the date of birth
* @throws IdAuthenticationFilterException the id authentication filter exception
*/
private LocalDate getDateOfBirth(List<IdentityInfoDTO> dobData) throws IdAuthenticationFilterException {
if(dobData == null || dobData.isEmpty()) {
throw new IdAuthenticationFilterException(IdAuthenticationErrorConstants.ID_NOT_AVAILABLE.getErrorCode(), String.format(IdAuthenticationErrorConstants.ID_NOT_AVAILABLE.getErrorMessage(), dateOfBirthAttributeName));
}

IdentityInfoDTO identityInfoDTO = dobData.get(0);
String dob = identityInfoDTO.getValue();

if(dob == null || dob.trim().isEmpty()) {
throw new IdAuthenticationFilterException(IdAuthenticationErrorConstants.ID_NOT_AVAILABLE.getErrorCode(), String.format(IdAuthenticationErrorConstants.ID_NOT_AVAILABLE.getErrorMessage(), dateOfBirthAttributeName));
}

try {
return DateUtils.parseDateToLocalDateTime(DateUtils.parseToDate(dob, dateOfBirthPattern)).toLocalDate();
} catch (Exception e) {
throw new IdAuthenticationFilterException(IdAuthenticationErrorConstants.UNABLE_TO_PROCESS.getErrorCode(), "Request could not be processed. Unable to parse " + dateOfBirthAttributeName + " from DB.");
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public Map<String, Object> getMasterDataTitles() throws IdAuthenticationBusiness
* @return the master data template
* @throws IdAuthenticationBusinessException the id authentication business exception
*/
@Cacheable(cacheNames = MASTERDATA_TEMPLATES, key = "#template")
@Cacheable(cacheNames = MASTERDATA_TEMPLATES)
public Map<String, Object> getMasterDataTemplate(String template) throws IdAuthenticationBusinessException {
try {
RestRequestDTO request = restFactory
Expand Down
Loading

0 comments on commit 3182fa2

Please sign in to comment.