From 39e6d35e3c928eee05fdc6d5420ab87686c638d9 Mon Sep 17 00:00:00 2001 From: Ivanmeneges Date: Wed, 1 Jul 2026 12:01:27 +0530 Subject: [PATCH] Fix Dockerfile base image and use-pr-linker workflow Signed-off-by: Ivanmeneges --- .github/keys/mosipgpgkey_pub.gpg | Bin 1270 -> 0 bytes .github/keys/mosipgpgkey_sec.gpg | Bin 2663 -> 0 bytes .github/workflows/chart-lint-publish.yml | 62 --- .github/workflows/push-trigger.yml | 85 ---- .github/workflows/release-changes.yml | 29 -- .github/workflows/tag.yml | 35 -- .github/workflows/use-pr-linker.yml | 21 + .gitignore | 3 - LICENSE | 373 --------------- README.md | 13 - biosdk-services/Dockerfile | 2 +- biosdk-services/README.md | 73 --- biosdk-services/configure_biosdk.sh | 51 -- biosdk-services/docs/spec_1_0.md | 351 -------------- biosdk-services/pom.xml | 315 ------------- biosdk-services/sample-docker-compose.yml | 12 - .../mosip/biosdk/services/SdkApplication.java | 11 - .../services/config/BioSdkLibConfig.java | 49 -- .../biosdk/services/config/LoggerConfig.java | 19 - .../services/config/SecurityConfig.java | 19 - .../biosdk/services/config/SwaggerConfig.java | 58 --- .../services/constants/AppConstants.java | 6 - .../services/constants/ErrorMessages.java | 21 - .../services/constants/ResponseStatus.java | 36 -- .../services/controller/MainController.java | 217 --------- .../services/dto/AuthorizedRolesDTO.java | 20 - .../mosip/biosdk/services/dto/ErrorDto.java | 20 - .../mosip/biosdk/services/dto/RequestDto.java | 15 - .../biosdk/services/dto/ResponseDto.java | 31 -- .../services/exceptions/BioSDKException.java | 43 -- .../factory/BioSdkServiceFactory.java | 25 - .../BioSdkServiceProviderImpl_V_1_0.java | 264 ----------- .../dto/request/CheckQualityRequestDto.java | 21 - .../dto/request/ConvertFormatRequestDto.java | 24 - .../request/ExtractTemplateRequestDto.java | 21 - .../spec_1_0/dto/request/InitRequestDto.java | 17 - .../spec_1_0/dto/request/MatchRequestDto.java | 23 - .../dto/request/SegmentRequestDto.java | 21 - .../services/spi/BioSdkServiceProvider.java | 19 - .../biosdk/services/utils/ErrorCode.java | 28 -- .../io/mosip/biosdk/services/utils/Utils.java | 314 ------------- .../resources/application-local.properties | 10 - .../src/main/resources/application.properties | 33 -- .../src/main/resources/bootstrap.properties | 30 -- .../src/main/resources/logback.xml | 11 - deploy/README.md | 17 - deploy/copy_cm.sh | 24 - deploy/delete.sh | 30 -- deploy/install.sh | 36 -- deploy/values.yaml | 5 - helm/biosdk-service/.gitignore | 2 - helm/biosdk-service/.helmignore | 21 - helm/biosdk-service/Chart.yaml | 20 - helm/biosdk-service/README.md | 12 - helm/biosdk-service/templates/NOTES.txt | 1 - helm/biosdk-service/templates/_helpers.tpl | 60 --- helm/biosdk-service/templates/deployment.yaml | 139 ------ helm/biosdk-service/templates/extra-list.yaml | 4 - .../templates/service-account.yaml | 12 - helm/biosdk-service/templates/service.yaml | 28 -- .../templates/servicemonitor.yaml | 36 -- .../templates/virtualservice.yaml | 32 -- helm/biosdk-service/values.yaml | 435 ------------------ 63 files changed, 22 insertions(+), 3743 deletions(-) delete mode 100644 .github/keys/mosipgpgkey_pub.gpg delete mode 100644 .github/keys/mosipgpgkey_sec.gpg delete mode 100644 .github/workflows/chart-lint-publish.yml delete mode 100644 .github/workflows/push-trigger.yml delete mode 100644 .github/workflows/release-changes.yml delete mode 100644 .github/workflows/tag.yml create mode 100644 .github/workflows/use-pr-linker.yml delete mode 100644 .gitignore delete mode 100644 LICENSE delete mode 100644 README.md delete mode 100644 biosdk-services/README.md delete mode 100644 biosdk-services/configure_biosdk.sh delete mode 100644 biosdk-services/docs/spec_1_0.md delete mode 100644 biosdk-services/pom.xml delete mode 100644 biosdk-services/sample-docker-compose.yml delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/SdkApplication.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/config/BioSdkLibConfig.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/config/LoggerConfig.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/config/SecurityConfig.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/config/SwaggerConfig.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/constants/AppConstants.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/constants/ErrorMessages.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/constants/ResponseStatus.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/controller/MainController.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/dto/AuthorizedRolesDTO.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/dto/ErrorDto.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/dto/RequestDto.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/dto/ResponseDto.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/exceptions/BioSDKException.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/factory/BioSdkServiceFactory.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/BioSdkServiceProviderImpl_V_1_0.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/CheckQualityRequestDto.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/ConvertFormatRequestDto.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/ExtractTemplateRequestDto.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/InitRequestDto.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/MatchRequestDto.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/SegmentRequestDto.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/spi/BioSdkServiceProvider.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/utils/ErrorCode.java delete mode 100644 biosdk-services/src/main/java/io/mosip/biosdk/services/utils/Utils.java delete mode 100644 biosdk-services/src/main/resources/application-local.properties delete mode 100644 biosdk-services/src/main/resources/application.properties delete mode 100644 biosdk-services/src/main/resources/bootstrap.properties delete mode 100644 biosdk-services/src/main/resources/logback.xml delete mode 100644 deploy/README.md delete mode 100755 deploy/copy_cm.sh delete mode 100755 deploy/delete.sh delete mode 100755 deploy/install.sh delete mode 100644 deploy/values.yaml delete mode 100644 helm/biosdk-service/.gitignore delete mode 100644 helm/biosdk-service/.helmignore delete mode 100644 helm/biosdk-service/Chart.yaml delete mode 100644 helm/biosdk-service/README.md delete mode 100644 helm/biosdk-service/templates/NOTES.txt delete mode 100644 helm/biosdk-service/templates/_helpers.tpl delete mode 100644 helm/biosdk-service/templates/deployment.yaml delete mode 100644 helm/biosdk-service/templates/extra-list.yaml delete mode 100644 helm/biosdk-service/templates/service-account.yaml delete mode 100644 helm/biosdk-service/templates/service.yaml delete mode 100644 helm/biosdk-service/templates/servicemonitor.yaml delete mode 100644 helm/biosdk-service/templates/virtualservice.yaml delete mode 100644 helm/biosdk-service/values.yaml diff --git a/.github/keys/mosipgpgkey_pub.gpg b/.github/keys/mosipgpgkey_pub.gpg deleted file mode 100644 index 4bdb1a947beaa877a93b56a2074580cdd9bf0578..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1270 zcmbQq$jcHZy2y@^gW*i(B_ZoOO}xok8QrJ7Cf&}qetdqLrPuP}`P;)T-Y(VI_HkO_ z1{{w_f#RHj!qd-^bJoQmWM7;XW@lbzf|A4J(W)_uZi-T`J_?5k8I!A{8+V6Y2-?iCh1xP-B zIq6E*9lP}7Ro)kBJiO-Q-t)Wj;Fy-k3!e44+^24G7$(eOmrP(w-?^yl?-s_Lj~{U? z|Iz2Tvh0=vd*g}qnQnX5u8!QgWqQ&|20=y!#w{MX`Nf$93K}69nZ*h~1mWf;mZjz? zB&X(;6eZ>;6r~pAYbw})rSwvB6Ek!2@=G$)GE<8j(m_1E^d-NQtB%>uiS4{`PS#`d z!2|Vwjd%R@+!xB97yY%eDJ><;wy?==@1nw%l1YihOg~;t$!Xr>^ncmLm-3sEy5o&z z7@iA#{p{Nz<!2>s$RBXB1ov96vXdr)51sAImSU;o{c6)J0UM44_b zpVf0Mm{D=={>!vRIb z`z+?pC(SfW%+zuj?53RMyjoQ7Nu3fcuhg`sy#Fh4&J!iymvj-SznK9SLE*G_rU-{#+($YQM6^zA8 z7bu5adm9((&-Z%Wg4K*(CprHfSNpfyX0CO^G<~zxx?F0xdnCb$wUg0|MFN<_6quxW z@FgT>9}%#9~XsWKj>S1US}t8BZxbD3G^vqQ&Cgnpb7no=`QThyYOHDz_% zPyV~E60;&o^Q5#s6vChzi|I4kog5a!b&-`}rA>|>XChRoKXOCr47i%DqEc5_q84HM3=sTiyHYODL3TL5is59vl$0S z0P5K9i{z~+wleRGRKMl<*)5aQTBct*FFWudgJRnFET(72mrDmV9;Hd3jpVQFX^}_ z<1>tMeUoTe{<>j4Sl*F^S}yKjYuAJfUm#cR`9!vKOZ5~`EGDHTsLhjaIlqMT|ibes6-JO^oZ;_(fXz-}1m7;Fc0vih~S-l*y`s z+e5k`-!Lb8zU9?SFbX9+4ouyB(rl4dsSn9eZ>+47Ni+amQnP?qW_3)}M$~za7R04; z53Ze2D2hU@KbHu0VW)vjGwRC!h?o0NTvYJPnowNier5fN^RGavD@W6SlFN7T%Uk_? z)Kug6b;6#x>aVobJ+w9VJY5~dXH%QeShiu**;XY0ng6KwdZm5jz^Pnc%D>lM)53>1 z!3?ZAEf&{6G)k@P;r^{@3V=C8x85RXso6eNyC!J1CSl#`EU~oJ`r^Wk+YyME=`N(3 ziCwp&2o#9jpR$@LI5gNJ9beNRf^VuMq*v}9d_sP#cUvB~He+Rn;3Dk~4*CkC8&G~V z%~tY`L|5ag!SpFlU8?(%_VV<$YTX4Uy^Dul7axlELQ*oXu3eiyQeK!-oj{J40+xBF z0|G2&9orf8%9oX_mn(e5^m$)qWGjC1DYjO{$3E;5_NPQ_%87T*NZd1v0^1)L z{+VRC3G!nw5nVIcAg$?!W_)uPO21X^({O*ih~gvNHOYDo4^eYyT008jOUrh$;ZTx( zhuL7fM&N_Ou)#7)D1U62%-{F#i1&>2A;@_95W+(}17$*ef`gQ04E|NA``|sXfrOxN ztS{Cl)Wq+fN!>dLZ=1t0_cIn!4Pgvj=vWHWIx3L;^g9H69IvNASob7G(kj` zEy-wVWn`-ZOPdw6iZmT_^90Cq$|(!L#VPQg&uTK{*ilT^ot#xzcQ<#gZpPNx z*858Olsa4_9@r}Xw(4f$=+Vje8}RFjdAnAjrG9eIjx$jql1m@)r-Ov+G5IREVCCc0 zdTfsCs15mLk72P}+T@5N;#Eg`{E=4kk>y)7Kf!e`Cein%qhUy*QQNbSyW!cMVW9o> zoWP_vX2;L#*Q6V~NbazF%@Op*@~`*uyA-ZjW+9x!D(7*mEjW8|C@Y_OPn>(V;(jh& z929Tr0;FB`P1@pt3M7kmYYb=gHd4zLErQPU&ahIKyV$sFSi!CYqxX`)C3S zsFCL(dlRiaUqr^4bM)ZqF(5H0tPxE~H5^(o_l%?cIc1TOYQcIO>9?bSf zD^v%b0!>vGrcXEkWlP>wKgvP%H*kkasI!79#4x{u*`(6~6&tl#Q8bsJJnRPe+H)a% zUAwF-lkMWAer+YVwjv&2lrzjZ9vZwqJdyQ1u}X~3r1rb?^>7WdW=G@XJsqVrnMYsp z2NZa@y`U`va_m8*C|iUx*NJe7Bx z*utP~`8H~vQh>;Q&ZAyMR;xjYenPH>Hbsp~5&!1&f0b3$uLqw=?|68O5{qzlmCGvS zgv#+dZ2q)&*pYh=6U-6S!KZkYUUD6Y?fn@tFQxO?izh>1pzVEwbw8y87n+3`PF}4R zIxWRXV@q$jE=G%zsVfd3R!DxEO(&Ao-?hmv#ZNuSXh1M9y+}lK(1lCeA}%(IB-{A6 zgt)}E>^;uadQ#c9W8g|zMh*3bK#`K#(s)v|$Zi0qYoEh$$vgd(`ZQsW8>qe*C+)iVx)hWwg)zdwrEa{_G%_ z68Tp`giRFXQ_-f#h=?wT!d?kWbu-nR(edIm3M}h0=65#1d;N)74v&nWsbc$;;htvro%w;%G@v${ z*xxkDfW&$JAAsQh1+d5t!cvf!{3_=ofw(Xpom#0t9iu(hPFsH83m4iS5Xy;ra{iP~ z?1`I{(IE{)wYI0 zp?Lro`tclyiF&K_MBTH9kbUsg=yu-maA!*_U*}`HPj-_Wbh&ke5YP9M2PwKR~+0n z`yU!zDyk)lFb4N<72OjB)L)J#F`fE*5><~{u0AZpb_3h}4U&GS>wU*FJ#yt)=4Y@a SkkiE(Bh1Lh;14qU=Klc8TJt&p diff --git a/.github/workflows/chart-lint-publish.yml b/.github/workflows/chart-lint-publish.yml deleted file mode 100644 index c8d6ba3b..00000000 --- a/.github/workflows/chart-lint-publish.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Validate / Publish helm charts - -on: - release: - types: [published] - pull_request: - types: [opened, reopened, synchronize] - paths: - - 'helm/**' - workflow_dispatch: - inputs: - IGNORE_CHARTS: - description: 'Provide list of charts to be ignored separated by pipe(|)' - required: false - default: '""' - type: string - CHART_PUBLISH: - description: 'Chart publishing to gh-pages branch' - required: false - default: 'NO' - type: string - options: - - YES - - NO - INCLUDE_ALL_CHARTS: - description: 'Include all charts for Linting/Publishing (YES/NO)' - required: false - default: 'NO' - type: string - options: - - YES - - NO - push: - branches: - - '!release-branch' - - '!master' - - 1.* - - 0.* - - develop - - release* - paths: - - 'helm/**' - -jobs: - chart-lint-publish: - uses: mosip/kattu/.github/workflows/chart-lint-publish.yml@master - with: - CHARTS_DIR: ./helm - CHARTS_URL: https://mosip.github.io/mosip-helm - REPOSITORY: mosip-helm - BRANCH: gh-pages - INCLUDE_ALL_CHARTS: "${{ inputs.INCLUDE_ALL_CHARTS || 'NO' }}" - IGNORE_CHARTS: "${{ inputs.IGNORE_CHARTS || '\"\"' }}" - CHART_PUBLISH: "${{ inputs.CHART_PUBLISH || 'YES' }}" - LINTING_CHART_SCHEMA_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/chart-schema.yaml" - LINTING_LINTCONF_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/lintconf.yaml" - LINTING_CHART_TESTING_CONFIG_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/chart-testing-config.yaml" - LINTING_HEALTH_CHECK_SCHEMA_YAML_URL: "https://raw.githubusercontent.com/mosip/kattu/master/.github/helm-lint-configs/health-check-schema.yaml" - DEPENDENCIES: "mosip,https://mosip.github.io/mosip-helm;" - secrets: - TOKEN: ${{ secrets.ACTION_PAT }} - 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 3152134b..00000000 --- a/.github/workflows/push-trigger.yml +++ /dev/null @@ -1,85 +0,0 @@ -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* - - master - - 1.* - - develop - - MOSIP* - -jobs: - build-biosdk-services: - uses: mosip/kattu/.github/workflows/maven-build.yml@master - with: - SERVICE_LOCATION: ./biosdk-services - BUILD_ARTIFACT: biosdk-services - 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' }}" - needs: build-biosdk-services - uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master - with: - SERVICE_LOCATION: ./biosdk-services - secrets: - OSSRH_URL: ${{ secrets.RELEASE_URL }} - OSSRH_USER: ${{ secrets.OSSRH_USER }} - OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }} - OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} - GPG_SECRET: ${{ secrets.GPG_SECRET }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - - sonar_analysis: - needs: build-biosdk-services - if: "${{ github.event_name != 'pull_request' }}" - uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master - with: - SERVICE_LOCATION: ./biosdk-services - 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-dockers: - needs: build-biosdk-services - strategy: - matrix: - include: - - SERVICE_LOCATION: 'biosdk-services' - SERVICE_NAME: 'biosdk-server' - BUILD_ARTIFACT: 'biosdk-services' - fail-fast: false - uses: mosip/kattu/.github/workflows/docker-build.yml@master - name: ${{ matrix.SERVICE_NAME }} - 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 }} diff --git a/.github/workflows/release-changes.yml b/.github/workflows/release-changes.yml deleted file mode 100644 index 56f3842b..00000000 --- a/.github/workflows/release-changes.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Release/pre-release Preparation. - -on: - workflow_dispatch: - inputs: - MESSAGE: - description: 'Triggered for release or pe-release' - required: false - default: 'Release Preparation' - RELEASE_TAG: - description: 'tag to update' - required: true - SNAPSHOT_TAG: - description: 'tag to be replaced' - required: true - BASE: - description: 'base branch for PR' - required: true -jobs: - maven-release-preparation: - uses: mosip/kattu/.github/workflows/release-changes.yml@master - with: - MESSAGE: ${{ inputs.MESSAGE }} - RELEASE_TAG: ${{ inputs.RELEASE_TAG }} - SNAPSHOT_TAG: ${{ inputs.SNAPSHOT_TAG }} - BASE: ${{ inputs.BASE }} - secrets: - ACTION_PAT: ${{ secrets.ACTION_PAT }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml deleted file mode 100644 index 9a5b079f..00000000 --- a/.github/workflows/tag.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Tagging of repos - -on: - workflow_dispatch: - inputs: - TAG: - description: 'Tag to be published' - required: true - type: string - BODY: - description: 'Release body message' - required: true - default: 'Changes in this Release' - type: string - PRE_RELEASE: - description: 'Pre-release? True/False' - required: true - default: False - type: string - DRAFT: - description: 'Draft? True/False' - required: false - default: False - type: string - -jobs: - tag-branch: - uses: mosip/kattu/.github/workflows/tag.yml@master - with: - TAG: ${{ inputs.TAG }} - BODY: ${{ inputs.BODY }} - PRE_RELEASE: ${{ inputs.PRE_RELEASE }} - DRAFT: ${{ inputs.DRAFT }} - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file diff --git a/.github/workflows/use-pr-linker.yml b/.github/workflows/use-pr-linker.yml new file mode 100644 index 00000000..e0ce52f2 --- /dev/null +++ b/.github/workflows/use-pr-linker.yml @@ -0,0 +1,21 @@ +name: Auto link PR to Issues + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + - reopened + - closed + +permissions: + contents: read + issues: write + pull-requests: read + +jobs: + call-linker: + uses: mosip/kattu/.github/workflows/link-pr-to-issue.yml@develop + secrets: + ACTION_PAT: ${{ secrets.ACTION_PAT }} \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 41f8135e..00000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.idea -*/target* -*/logs \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index a612ad98..00000000 --- a/LICENSE +++ /dev/null @@ -1,373 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. diff --git a/README.md b/README.md deleted file mode 100644 index 0b1ef516..00000000 --- a/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[![Maven Package upon a push](https://github.com/mosip/biosdk-services/actions/workflows/push_trigger.yml/badge.svg?branch=release-1.2.0.1)](https://github.com/mosip/biosdk-services/actions/workflows/push_trigger.yml) -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?branch=release-1.2.0.1&project=mosip_biosdk-services&metric=alert_status)](https://sonarcloud.io/dashboard?branch=release-1.2.0.1&id=mosip_biosdk-services) - - -# Bio-SDK Service - -## Overview -This is reference service and provides a mock implementation of Bio-SDK REST Service. By default loads [Mock BIO SDK](https://github.com/mosip/mosip-mock-services/tree/master/mock-sdk) internally on the startup and exposes the endpoints to perform 1:1 match, extraction as per the [IBioAPI](https://github.com/mosip/commons/blob/master/kernel/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/spi/IBioApi.java). - -To know more about Biometric SDK, refer [biometric-sdk](https://docs.mosip.io/1.2.0/biometrics/biometric-sdk). - -### License -This project is licensed under the terms of [Mozilla Public License 2.0](LICENSE). diff --git a/biosdk-services/Dockerfile b/biosdk-services/Dockerfile index 732beac6..a7cbe657 100644 --- a/biosdk-services/Dockerfile +++ b/biosdk-services/Dockerfile @@ -1,4 +1,4 @@ -FROM openjdk:11 +FROM eclipse-temurin:11-jre-jammy ARG SOURCE ARG COMMIT_HASH diff --git a/biosdk-services/README.md b/biosdk-services/README.md deleted file mode 100644 index d5dae3cb..00000000 --- a/biosdk-services/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# Bio SDK services - -This service provides a mock implementation of Bio-SDK REST Service. It by default loads [Mock BIO SDK](https://github.com/mosip/mosip-mock-services/tree/master/mock-sdk) internally on the startup and exposes the endpoints to perform 1:N match, segmentation, extraction as per the [IBioAPI](https://github.com/mosip/commons/blob/master/kernel/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/spi/IBioApi.java). This can be configured to load a different JAR that has a different implementation of `IBioAPI`, provided its dependencies are in place. - -## Requirements: -* Java version = 11.X.X -* Maven version >= 3.6 - -## Run jar directly - -### Build - -Go to biosdk-services folder and run the below command, this will create a jar file in target folder -```text -mvn clean install -``` - -### Run jar - -```text -java -Dloader.path= -Dbiosdk_bioapi_impl= -jar biosdk-services-.jar -``` - -For example: -```text -java -Dloader.path=mock-sdk.jar -Dbiosdk_bioapi_impl=io.mosip.mock.sdk.impl.SampleSDK -jar biosdk-services-1.1.3.jar -``` - -### Check service status -```text -http://{host}:9099/biosdk-service - -In case of localhost: -http://localhost:9099/biosdk-service -``` -You will see response like -```text -Service is running... Fri Jan 29 08:49:28 UTC 2021 - -``` - -## Run as docker - -### Build docker image - -Build the Dockerfile to create docker image - -### Run docker image - -Run the docker image by providing: -* biosdk_zip_url (environment variable), url for third-party biosdk library zip file -* biosdk_bioapi_impl (environment variable) where biosdk_zip_url is the path of the class that implements IBioApi interface methods - - -### Check service status -```text -http://{host}:9099/biosdk-service - -In case of localhost: -http://localhost:9099/biosdk-service -``` -You will see response like -```text -Service is running... Fri Jan 29 08:49:28 UTC 2021 - -``` - -## Swagger UI for exposed APIs -```text -http://{host}:9099/biosdk-service/swagger-ui.html - -In case of localhost: -http://localhost:9099/biosdk-service/swagger-ui.html diff --git a/biosdk-services/configure_biosdk.sh b/biosdk-services/configure_biosdk.sh deleted file mode 100644 index 8c4b9505..00000000 --- a/biosdk-services/configure_biosdk.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# Built by MOSIP team -# Script to configure the BioSDK -set -e - -echo "starting downloading zip file $biosdk_zip_file_path" - -wget -q --show-progress "$biosdk_zip_file_path" -echo "Downloaded $biosdk_zip_file_path" - -FILE_NAME=${biosdk_zip_file_path##*/} - -echo $FILE_NAME - -DIR_NAME=$biosdk_local_dir_name - -#has_parent=$(zipinfo -1 "$FILE_NAME" | awk '{split($NF,a,"/");print a[1]}' | sort -u | wc -l) -#if test "$has_parent" -eq 1; then -# echo "Zip has a parent directory inside" -# dirname=$(zipinfo -1 "$FILE_NAME" | awk '{split($NF,a,"/");print a[1]}' | sort -u | head -n 1) -# echo "Unzip directory" -# unzip $FILE_NAME -# echo "Renaming directory" -# mv -v $dirname $DIR_NAME -#else -# echo "Zip has no parent directory inside" -# echo "Creating destination directory" -# mkdir "$DIR_NAME" -# echo "Unzip to destination directory" -# unzip -d "$DIR_NAME" $FILE_NAME -#fi - -unzip -d "$DIR_NAME" $FILE_NAME - -echo "Copying to loader path" -cp -R ./$DIR_NAME/* $loader_path_env -echo "Complete" -cd $work_dir - - -#echo "Configuring SDK" -#mkdir -p /biosdk -#cd /biosdk - -#echo "Download the biosdk from $biosdk_zip_url" -#wget $biosdk_zip_url -O biosdk.zip -#echo "Downloaded $biosdk_zip_url" -# -#unzip biosdk.zip - -exec "$@" diff --git a/biosdk-services/docs/spec_1_0.md b/biosdk-services/docs/spec_1_0.md deleted file mode 100644 index a035191f..00000000 --- a/biosdk-services/docs/spec_1_0.md +++ /dev/null @@ -1,351 +0,0 @@ -# Biosdk Service spec. 1.0 - -In following APIs, sample request/ response format are given. For more details, please go to [Java API specs.](https://docs.mosip.io/platform/apis/biometric-sdk-api-specification#appendix-a-java-api-specifications). All the JSON structure in request and responses are derived from Java classes listed in the [Java API specs](https://docs.mosip.io/platform/apis/biometric-sdk-api-specification#appendix-a-java-api-specifications). - -## APIs - -### Status check - -Relative URL: / - -Method: GET - -Response: -```text -Service is running... Tue Mar 30 08:35:39 UTC 2021 -``` - -### Initialization - -Relative URL: /init - -Method: POST - -Request: -```json -{ - "version": "", - "request": "base64 encoded(initParams)" -} -``` - -initParams: -```json -{ - "parameter1": "val1", - "parameter2": "val2" -} -``` - -Response: -```json -{ - "version": "1.0", - "responsetime": "2021-03-30T08:43:17.707Z", - "response": { - "apiVersion": "API version", - "sdkVersion": "SDK version", - "supportedModalities": ["${list of supported modalities}"], - "supportedMethods": ["${list of supported methods per modality}"], - "otherInfo": {}, - "productOwner": { - "organization": "Organisation name", - "type": "organisation type" - } - }, - "errors": [] -} -``` - -### check-quality - -Relative URL: /check-quality - -Method: POST - -Request: -```json -{ - "version": "", - "request": "base64 encoded(checkQualityBody)" -} -``` - -checkQualityBody: -```json -{ - "sample": "${BiometricRecord}", - "modalitiesToCheck": ["${list of modalities to check}"], - "flags": {} -} -``` - -Response: -```json -{ - "version": "x.x.x", - "responsetime": "2021-03-30T08:43:17.707Z", - "response": { - "scores": { - "Finger": { - "score": 0.0, - "errors": [], - "analyticsInfo": {} - }, - "Face": { - "score": 0.0, - "errors": [], - "analyticsInfo": {} - } - }, - "analyticsInfo": {} - }, - "errors": null -} -``` - -### match - -Relative URL: /match - -Method: POST - -Request: -```json -{ - "version": "", - "request": "base64 encoded(matchBody)" -} -``` - -matchBody: -```json -{ - "sample": "${BiometricRecord}", - "gallery": ["${List of BiometricRecords}"], - "modalitiesToMatch": ["${list of modalities to mach}"], - "flags": {} -} -``` - -Response: -```json -{ - "version": "x.x.x", - "responsetime": "2021-03-30T08:43:17.707Z", - "response": "${list of MatchDecisions}", - "errors": null -} -``` - -### extract-template - -Relative URL: /extract-template - -Method: POST - -Request: -```json -{ - "version": "", - "request": "base64 encoded(extractTemplateBody)" -} -``` - -extractTemplateBody: -```json -{ - "sample": "${BiometricRecord}", - "modalitiesToExtract": ["${list of modalities to extract}"], - "flags": {} -} -``` - -Response: -```json -{ - "version": "x.x.x", - "responsetime": "2021-03-30T08:43:17.707Z", - "response": "${BiometricRecord}", - "errors": null -} -``` - -### convert-format - -Relative URL: /convert-format - -Method: POST - -Request: -```json -{ - "version": "", - "request": "base64 encoded(convertFormatBody)" -} -``` - -convertFormatBody: -```json -{ - "sample": "${BiometricRecord}", - "sourceFormat": "sample", - "targetFormat": "sample", - "sourceParams": {}, - "targetParams": {}, - "modalitiesToConvert": ["${list of modalities to convert}"] -} -``` - -Response: -```json -{ - "version": "x.x.x", - "responsetime": "2021-03-30T08:43:17.707Z", - "response": "${BiometricRecord}", - "errors": null -} -``` - -### segment - -Relative URL: /segment - -Method: POST - -Request: -```json -{ - "version": "", - "request": "base64 encoded(segmentBody)" -} -``` - -segmentBody: -```json -{ - "sample": "${BiometricRecord}", - "modalitiesToSegment": ["${list of modalities to segment}"], - "flags": {} -} -``` - -Response: -```json -{ - "version": "x.x.x", - "responsetime": "2021-03-30T08:43:17.707Z", - "response": "${BiometricRecord}", - "errors": null -} -``` - -## Appendix -Below are sample JSON structure for the variables used in above APIs. For more info on possibles values of keys, refer [Java API specs](https://docs.mosip.io/platform/apis/biometric-sdk-api-specification#appendix-a-java-api-specifications). - -BiometricRecord (sample): -```json -{ - "version": { - "major": 1, - "minor": 1 - }, - "cbeffversion": { - "major": 1, - "minor": 1 - }, - "birInfo": { - "integrity": false - }, - "segments": [ - { - "version": { - "major": 1, - "minor": 1 - }, - "cbeffversion": { - "major": 1, - "minor": 1 - }, - "birInfo": { - "integrity": false - }, - "bdbInfo": { - "format": { - "organization": "Mosip", - "type": "7" - }, - "creationDate": "2021-06-27T13:40:06.211Z", - "type": ["Finger"], - "subtype": ["Right MiddleFinger"], - "level": "Raw", - "purpose": "Enroll", - "quality": { - "algorithm": { - "organization": "HMAC", - "type": "SHA-256" - }, - "score": 100 - } - }, - "bdb": "RklSAD..." - } - ] -} -``` - -MatchDecision (sample): -```json -{ - "galleryIndex": "gallery index", - "decisions": { - "FACE": { - "match": "MATCHED", - "errors": [], - "analyticsInfo": {} - }, - "FINGER": { - "match": "MATCHED", - "errors": [], - "analyticsInfo": {} - }, - "IRIS": { - "match": "NOT_MATCHED", - "errors": [], - "analyticsInfo": {} - } - }, - "analyticsInfo": {} -} -``` - - - -## Security - -### HTTPS -The service should be setup with the https. Only certificates signed by a CA will work. - -Certificates generated by Letsencrypt can be used to do initial setup - -## Error Messages - -### Code: BIO_SDK_001 - -Msg: No Bio SDK service provider implementations found for given version - -### Code: BIOSDK_LIB_EXCEPTION - -Msg: Exception thrown by BioSDK library - -Reasons: Exception raised by the third-party bioSDK library - -### Code: INVALID_REQUEST_BODY - -Msg: Unable to parse request body - -Resons: Request body is not in correct format - -### Code: UNCHECKED_EXCEPTION - -Msg: UNCHECKED_EXCEPTION diff --git a/biosdk-services/pom.xml b/biosdk-services/pom.xml deleted file mode 100644 index 5e8b66ac..00000000 --- a/biosdk-services/pom.xml +++ /dev/null @@ -1,315 +0,0 @@ - - - 4.0.0 - - biosdk-services - io.mosip.biosdk - 1.2.0.1 - biosdk-services - - - - MPL 2.0 - https://www.mozilla.org/en-US/MPL/2.0/ - - - - - scm:git:git://github.com/mosip/biosdk-services.git - scm:git:ssh://github.com:mosip/biosdk-services.git - https://github.com/mosip/biosdk-services - HEAD - - - - - Mosip - mosip.emailnotifier@gmail.com - io.mosip - https://mosip.io - - - - Sample implementation of biometrics SDK services - https://github.com/mosip/biosdk-services - - - 11 - - 11 - 11 - - 2.0.2.RELEASE - 2.0.2.RELEASE - 2.22.0 - 0.8.5 - 3.7.0.1746 - - - 1.18.8 - - - 2.9.2 - - - - 1.2.0.1 - 1.2.0.1 - 1.2.0.1 - - 2.0.2.RELEASE - - - - - - org.springframework.boot - spring-boot-dependencies - ${spring.boot.version} - pom - import - - - org.springframework.boot - spring-boot-starter-json - - - - - com.fasterxml.jackson.core - jackson-databind - 2.11.0 - - - com.fasterxml.jackson.core - jackson-core - 2.11.0 - - - - - - - - org.springframework.cloud - spring-cloud-starter-config - ${spring-cloud-config.version} - - - org.springframework.boot - spring-boot-devtools - runtime - - - org.springframework.boot - spring-boot-starter-web - ${spring.boot.version} - - - org.springframework.boot - spring-boot-starter-json - - - - - org.springframework.boot - spring-boot-starter-security - ${spring.boot.version} - - - org.springframework.boot - spring-boot-starter-actuator - ${spring.boot.version} - - - io.springfox - springfox-swagger2 - ${swagger.version} - compile - - - io.springfox - springfox-swagger-ui - ${swagger.version} - compile - - - io.mosip.kernel - kernel-biometrics-api - ${kernel.biometrics.api.version} - - - io.mosip.kernel - kernel-logger-logback - ${kernel.logger.logback.version} - - - io.mosip.kernel - kernel-core - ${kernel.core.version} - - - org.projectlombok - lombok - ${lombok.version} - compile - - - com.googlecode.json-simple - json-simple - 1.1.1 - - - com.google.code.gson - gson - 2.8.6 - - - - - - - - pl.project13.maven - git-commit-id-plugin - 3.0.1 - - - get-the-git-infos - - revision - - validate - - - - true - ${project.build.outputDirectory}/git.properties - - ^git.build.(time|version)$ - ^git.commit.id.(abbrev|full)$ - - full - ${project.basedir}/.git - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - --pinentry-mode - loopback - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven.surefire.plugin.version} - - ${skipTests} - false - - ${argLine} --add-opens - java.xml/jdk.xml.internal=ALL-UNNAMED - --illegal-access=permit - - - - - org.jacoco - jacoco-maven-plugin - ${maven.jacoco.plugin.version} - - - - prepare-agent - - - - report - prepare-package - - report - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - ${maven.compiler.source} - ${maven.compiler.target} - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring.boot.version} - - ZIP - true - - ${maven.compiler.source} - ${maven.compiler.target} - - - - - - - build-info - repackage - - - - - - - - - - sonar - - . - src/main/java/**,src/main/resources/** - ${sonar.coverage.exclusions} - https://sonarcloud.io - - - false - - - - - org.sonarsource.scanner.maven - sonar-maven-plugin - ${maven.sonar.plugin.version} - - - verify - - sonar - - - - - - - - - diff --git a/biosdk-services/sample-docker-compose.yml b/biosdk-services/sample-docker-compose.yml deleted file mode 100644 index dcfa0137..00000000 --- a/biosdk-services/sample-docker-compose.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: '3' -services: - biosdk_server: - build: . - image: biosdk_server - container_name: biosdk_server - ports: - - "9099:9099" - environment: - biosdk_zip_url: https://mosip.s3-us-west-2.amazonaws.com/sdk-1.1.0.zip - biosdk_bioapi_impl: io.mosip.mock.sdk.impl.SampleSDK - restart: always \ No newline at end of file diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/SdkApplication.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/SdkApplication.java deleted file mode 100644 index f7fecd6b..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/SdkApplication.java +++ /dev/null @@ -1,11 +0,0 @@ -package io.mosip.biosdk.services; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication() -public class SdkApplication { - public static void main(String[] args) { - SpringApplication.run(SdkApplication.class, args); - } -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/config/BioSdkLibConfig.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/config/BioSdkLibConfig.java deleted file mode 100644 index a099b9f1..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/config/BioSdkLibConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -package io.mosip.biosdk.services.config; - -import io.mosip.kernel.biometrics.spi.IBioApiV2; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Lazy; -import org.springframework.core.env.Environment; - -import javax.annotation.PostConstruct; - -@Configuration -public class BioSdkLibConfig { - private static final Logger logger = LoggerFactory.getLogger(BioSdkLibConfig.class); - @Autowired - private Environment env; - - public BioSdkLibConfig() { - } - - @PostConstruct - public void validateBioSdkLib() throws ClassNotFoundException { - String sdkClass = this.env.getProperty("biosdk_bioapi_impl"); - logger.info("Biosdk class: " + sdkClass); - if (StringUtils.isNotBlank(sdkClass)) { - logger.debug("validating Bio SDK Class is present or not"); - Class.forName(this.env.getProperty("biosdk_bioapi_impl")); - } - - logger.debug("validateBioSdkLib: Bio SDK Class is not provided"); - } - - @Bean - @Lazy - public IBioApiV2 iBioApi() throws ClassNotFoundException, InstantiationException, IllegalAccessException { - String sdkClass = this.env.getProperty("biosdk_bioapi_impl"); - logger.info("Biosdk class: " + sdkClass); - if (StringUtils.isNotBlank(sdkClass)) { - logger.debug("instance of Bio SDK is created"); - return (IBioApiV2)Class.forName(sdkClass).newInstance(); - } else { - logger.debug("no Bio SDK is provided"); - throw new RuntimeException("No Bio SDK is provided"); - } - } -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/config/LoggerConfig.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/config/LoggerConfig.java deleted file mode 100644 index d8fa4218..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/config/LoggerConfig.java +++ /dev/null @@ -1,19 +0,0 @@ -package io.mosip.biosdk.services.config; - -import io.mosip.kernel.core.logger.spi.Logger; -import io.mosip.kernel.logger.logback.factory.Logfactory; - -public final class LoggerConfig { - - /** - * Instantiates a new biosdk service logger. - */ - private LoggerConfig() { - - } - - public static Logger logConfig(Class clazz) { - return Logfactory.getSlf4jLogger(clazz); - } - -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/config/SecurityConfig.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/config/SecurityConfig.java deleted file mode 100644 index d0bf63d7..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/config/SecurityConfig.java +++ /dev/null @@ -1,19 +0,0 @@ -package io.mosip.biosdk.services.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; - -@Configuration -@EnableWebSecurity -public class SecurityConfig extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(HttpSecurity security) throws Exception - { - security.httpBasic().disable(); - security.csrf().disable(); - } - -} \ No newline at end of file diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/config/SwaggerConfig.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/config/SwaggerConfig.java deleted file mode 100644 index ec6c7231..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/config/SwaggerConfig.java +++ /dev/null @@ -1,58 +0,0 @@ -package io.mosip.biosdk.services.config; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; -import springfox.documentation.builders.PathSelectors; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - - -import java.util.HashSet; -import java.util.Set; - -@Configuration -@EnableSwagger2 -public class SwaggerConfig extends WebMvcConfigurationSupport { - @Value("${application.env.local:false}") - private Boolean localEnv; - - @Value("${swagger.base-url:#{null}}") - private String swaggerBaseUrl; - - @Value("${server.port:9092}") - private int serverPort; - - String proto = "http"; - String host = "localhost"; - int port = -1; - String hostWithPort = "localhost:9092"; - - @Bean - public Docket api() { - return new Docket(DocumentationType.SWAGGER_2) - .select() - .apis(RequestHandlerSelectors.any()) - .paths(PathSelectors.any()) - .build(); - } - - private Set protocols() { - Set protocols = new HashSet<>(); - protocols.add(proto); - return protocols; - } - - @Override - protected void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("swagger-ui.html") - .addResourceLocations("classpath:/META-INF/resources/"); - registry.addResourceHandler("/webjars/**") - .addResourceLocations("classpath:/META-INF/resources/webjars/"); - } - -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/constants/AppConstants.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/constants/AppConstants.java deleted file mode 100644 index 27c2af54..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/constants/AppConstants.java +++ /dev/null @@ -1,6 +0,0 @@ -package io.mosip.biosdk.services.constants; - -public class AppConstants { - public static final String LOGGER_SESSIONID = "BIO-SDK-PROVIDER"; - public static final String LOGGER_IDTYPE = "REGISTRATION / AUTH"; -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/constants/ErrorMessages.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/constants/ErrorMessages.java deleted file mode 100644 index 087bcc27..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/constants/ErrorMessages.java +++ /dev/null @@ -1,21 +0,0 @@ -package io.mosip.biosdk.services.constants; - -public enum ErrorMessages { - NO_BIOSDK_PROVIDER_FOUND("No BioSDK provider found with the given version"), - BIOSDK_LIB_EXCEPTION("Exception thrown by BioSDK library"), - INVALID_REQUEST_BODY("Unable to parse request body"), - UNCHECKED_EXCEPTION("UNCHECKED_EXCEPTION"); - - private ErrorMessages(String message) { - this.message = message; - } - - private final String message; - - /** - * @return message - */ - public String getMessage() { - return message; - } -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/constants/ResponseStatus.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/constants/ResponseStatus.java deleted file mode 100644 index 906d5a6f..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/constants/ResponseStatus.java +++ /dev/null @@ -1,36 +0,0 @@ -package io.mosip.biosdk.services.constants; - -public enum ResponseStatus { - - SUCCESS(200, "OK"), - INVALID_INPUT(401, "Invalid Input Parameter - %s"), - MISSING_INPUT(402, "Missing Input Parameter - %s"), - QUALITY_CHECK_FAILED(403, "Quality check of Biometric data failed"), - POOR_DATA_QUALITY(406, "Data provided is of poor quality"), - UNKNOWN_ERROR(500, "UNKNOWN_ERROR"); - - ResponseStatus(int statusCode, String statusMessage) { - this.setStatusCode(statusCode); - this.setStatusMessage(statusMessage); - } - - private int statusCode; - private String statusMessage; - - public int getStatusCode() { - return statusCode; - } - public void setStatusCode(int statusCode) { - this.statusCode = statusCode; - } - - public String getStatusMessage() { - return statusMessage; - } - - public void setStatusMessage(String statusMessage) { - this.statusMessage = statusMessage; - } - - -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/controller/MainController.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/controller/MainController.java deleted file mode 100644 index b1c478ff..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/controller/MainController.java +++ /dev/null @@ -1,217 +0,0 @@ -package io.mosip.biosdk.services.controller; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import io.mosip.biosdk.services.config.LoggerConfig; -import io.mosip.biosdk.services.constants.ErrorMessages; -import io.mosip.biosdk.services.dto.*; -import io.mosip.biosdk.services.exceptions.BioSDKException; -import io.mosip.biosdk.services.factory.BioSdkServiceFactory; -import io.mosip.biosdk.services.spi.BioSdkServiceProvider; -import io.mosip.biosdk.services.utils.Utils; -import io.mosip.kernel.biometrics.spi.IBioApiV2; -import io.mosip.kernel.core.logger.spi.Logger; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import org.json.simple.JSONObject; -import org.json.simple.parser.JSONParser; -import org.json.simple.parser.ParseException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.Errors; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; - -import java.util.ArrayList; -import java.util.Date; - -import static io.mosip.biosdk.services.constants.AppConstants.LOGGER_IDTYPE; -import static io.mosip.biosdk.services.constants.AppConstants.LOGGER_SESSIONID; - -@RestController -@RequestMapping("/") -@Api(tags = "Sdk") -@CrossOrigin("*") -public class MainController { - - private Logger logger = LoggerConfig.logConfig(MainController.class); - - @Autowired - private Utils serviceUtil; - - @Autowired - private IBioApiV2 iBioApi; - - @Autowired - private BioSdkServiceFactory bioSdkServiceFactory; - - private Gson gson = new GsonBuilder().serializeNulls().create();; - - @GetMapping(path = "/") - @ApiOperation(value = "Service status") - @ApiResponses(value = { @ApiResponse(code = 200, message = "Service is running...") }) - public ResponseEntity status() { - Date d = new Date(); - return ResponseEntity.status(HttpStatus.OK).body("Service is running... "+d.toString()); - } - - @PreAuthorize("hasAnyRole('REGISTRATION_PROCESSOR')") - @GetMapping(path = "/s") - @ApiOperation(value = "Service status 1") - @ApiResponses(value = { @ApiResponse(code = 200, message = "Service is running...") }) - public ResponseEntity status1() { - Date d = new Date(); - return ResponseEntity.status(HttpStatus.OK).body("Service is running... "+d.toString()); - } - - @PostMapping(path = "/init", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ApiOperation(value = "Initialization") - @ApiResponses(value = { @ApiResponse(code = 200, message = "Initialization successful") }) - public ResponseEntity init( - @Validated @RequestBody(required = true) RequestDto request, - @ApiIgnore Errors errors) { - ResponseDto responseDto = generateResponseTemplate(request.getVersion()); - try { - responseDto.setVersion(request.getVersion()); - BioSdkServiceProvider bioSdkServiceProviderImpl = null; - bioSdkServiceProviderImpl = bioSdkServiceFactory.getBioSdkServiceProvider(request.getVersion()); - responseDto.setResponse(bioSdkServiceProviderImpl.init(request)); - } catch (BioSDKException e) { - logger.error(LOGGER_SESSIONID, LOGGER_IDTYPE, "BioSDKException: ", e.getMessage()); - ErrorDto errorDto = new ErrorDto(e.getErrorCode(), e.getErrorText()); - responseDto.getErrors().add(errorDto); - return ResponseEntity.status(HttpStatus.OK).body(gson.toJson(responseDto)); - } - return ResponseEntity.status(HttpStatus.OK).body(gson.toJson(responseDto)); - } - - @PostMapping(path = "/match", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ApiOperation(value = "Match") - @ApiResponses(value = { @ApiResponse(code = 200, message = "Match successful") }) - public ResponseEntity match( - @Validated @RequestBody(required = true) RequestDto request, - @ApiIgnore Errors errors) { - ResponseDto responseDto = generateResponseTemplate(request.getVersion()); - try { - responseDto.setVersion(request.getVersion()); - BioSdkServiceProvider bioSdkServiceProviderImpl = null; - bioSdkServiceProviderImpl = bioSdkServiceFactory.getBioSdkServiceProvider(request.getVersion()); - responseDto.setResponse(bioSdkServiceProviderImpl.match(request)); - } catch (BioSDKException e) { - logger.error(LOGGER_SESSIONID, LOGGER_IDTYPE, "BioSDKException: ", e.getMessage()); - ErrorDto errorDto = new ErrorDto(e.getErrorCode(), e.getErrorText()); - responseDto.getErrors().add(errorDto); - return ResponseEntity.status(HttpStatus.OK).body(gson.toJson(responseDto)); - } - return ResponseEntity.status(HttpStatus.OK).body(gson.toJson(responseDto)); - } - - @PostMapping(path = "/check-quality", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ApiOperation(value = "Check quality") - @ApiResponses(value = { @ApiResponse(code = 200, message = "Check successful") }) - public ResponseEntity checkQuality( - @Validated @RequestBody(required = true) RequestDto request, - @ApiIgnore Errors errors) { - ResponseDto responseDto = generateResponseTemplate(request.getVersion()); - try { - responseDto.setVersion(request.getVersion()); - BioSdkServiceProvider bioSdkServiceProviderImpl = null; - bioSdkServiceProviderImpl = bioSdkServiceFactory.getBioSdkServiceProvider(request.getVersion()); - responseDto.setResponse(bioSdkServiceProviderImpl.checkQuality(request)); - } catch (BioSDKException e) { - logger.error(LOGGER_SESSIONID, LOGGER_IDTYPE, "BioSDKException: ", e.getMessage()); - ErrorDto errorDto = new ErrorDto(e.getErrorCode(), e.getErrorText()); - responseDto.getErrors().add(errorDto); - return ResponseEntity.status(HttpStatus.OK).body(gson.toJson(responseDto)); - } - return ResponseEntity.status(HttpStatus.OK).body(gson.toJson(responseDto)); - } - - @PostMapping(path = "/extract-template", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ApiOperation(value = "Extract template") - @ApiResponses(value = { @ApiResponse(code = 200, message = "Extract successful") }) - public ResponseEntity extractTemplate( - @Validated @RequestBody(required = true) RequestDto request, - @ApiIgnore Errors errors) { - ResponseDto responseDto = generateResponseTemplate(request.getVersion()); - try { - responseDto.setVersion(request.getVersion()); - BioSdkServiceProvider bioSdkServiceProviderImpl = null; - bioSdkServiceProviderImpl = bioSdkServiceFactory.getBioSdkServiceProvider(request.getVersion()); - responseDto.setResponse(bioSdkServiceProviderImpl.extractTemplate(request)); - } catch (BioSDKException e) { - logger.error(LOGGER_SESSIONID, LOGGER_IDTYPE, "BioSDKException: ", e.getMessage()); - ErrorDto errorDto = new ErrorDto(e.getErrorCode(), e.getErrorText()); - responseDto.getErrors().add(errorDto); - return ResponseEntity.status(HttpStatus.OK).body(gson.toJson(responseDto)); - } - return ResponseEntity.status(HttpStatus.OK).body(gson.toJson(responseDto)); - } - - @PostMapping(path = "/convert-format", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ApiOperation(value = "Convert format") - @ApiResponses(value = { @ApiResponse(code = 200, message = "Convert successful") }) - public ResponseEntity convertFormat( - @Validated @RequestBody(required = true) RequestDto request, - @ApiIgnore Errors errors) { - ResponseDto responseDto = generateResponseTemplate(request.getVersion()); - try { - responseDto.setVersion(request.getVersion()); - BioSdkServiceProvider bioSdkServiceProviderImpl = null; - bioSdkServiceProviderImpl = bioSdkServiceFactory.getBioSdkServiceProvider(request.getVersion()); - responseDto.setResponse(bioSdkServiceProviderImpl.convertFormat(request)); - } catch (BioSDKException e) { - logger.error(LOGGER_SESSIONID, LOGGER_IDTYPE, "BioSDKException: ", e.getMessage()); - ErrorDto errorDto = new ErrorDto(e.getErrorCode(), e.getErrorText()); - responseDto.getErrors().add(errorDto); - return ResponseEntity.status(HttpStatus.OK).body(gson.toJson(responseDto)); - } - return ResponseEntity.status(HttpStatus.OK).body(gson.toJson(responseDto)); - } - - @PostMapping(path = "/segment", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ApiOperation(value = "Segment") - @ApiResponses(value = { @ApiResponse(code = 200, message = "Segment successful") }) - public ResponseEntity segment( - @Validated @RequestBody(required = true) RequestDto request, - @ApiIgnore Errors errors) { - ResponseDto responseDto = generateResponseTemplate(request.getVersion()); - try { - responseDto.setVersion(request.getVersion()); - BioSdkServiceProvider bioSdkServiceProviderImpl = null; - bioSdkServiceProviderImpl = bioSdkServiceFactory.getBioSdkServiceProvider(request.getVersion()); - responseDto.setResponse(bioSdkServiceProviderImpl.segment(request)); - } catch (BioSDKException e) { - logger.error(LOGGER_SESSIONID, LOGGER_IDTYPE, "BioSDKException: ", e.getMessage()); - ErrorDto errorDto = new ErrorDto(e.getErrorCode(), e.getErrorText()); - responseDto.getErrors().add(errorDto); - return ResponseEntity.status(HttpStatus.OK).body(gson.toJson(responseDto)); - } - return ResponseEntity.status(HttpStatus.OK).body(gson.toJson(responseDto)); - } - - private ResponseDto generateResponseTemplate(String version){ - ResponseDto responseDto = new ResponseDto(); - responseDto.setVersion(version); - responseDto.setResponsetime(serviceUtil.getCurrentResponseTime()); - responseDto.setErrors(new ArrayList()); - responseDto.setResponse(""); - return responseDto; - } - - private String getVersion(String request) throws BioSDKException{ - JSONParser parser = new JSONParser(); - try { - JSONObject js = (JSONObject) parser.parse(request); - return js.get("version").toString(); - } catch (ParseException e) { - throw new BioSDKException(ErrorMessages.UNCHECKED_EXCEPTION.toString(), e.getMessage()); - } - } -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/dto/AuthorizedRolesDTO.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/dto/AuthorizedRolesDTO.java deleted file mode 100644 index 7a3c5114..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/dto/AuthorizedRolesDTO.java +++ /dev/null @@ -1,20 +0,0 @@ -package io.mosip.biosdk.services.dto; - -import java.util.List; - -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -import lombok.Getter; -import lombok.Setter; - - -@Component("authorizedRoles") -@ConfigurationProperties(prefix = "mosip.role.biosdk") -@Getter -@Setter -public class AuthorizedRolesDTO { - - private List getservicestatus; - -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/dto/ErrorDto.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/dto/ErrorDto.java deleted file mode 100644 index 5b499312..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/dto/ErrorDto.java +++ /dev/null @@ -1,20 +0,0 @@ -package io.mosip.biosdk.services.dto; - -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@NoArgsConstructor -@ToString -public class ErrorDto { - private String code; - private String message; - - public ErrorDto(String code, String message){ - this.code = code; - this.message = message; - } -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/dto/RequestDto.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/dto/RequestDto.java deleted file mode 100644 index 375f3598..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/dto/RequestDto.java +++ /dev/null @@ -1,15 +0,0 @@ -package io.mosip.biosdk.services.dto; - -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@NoArgsConstructor -@ToString -public class RequestDto { - private String version; - private String request; -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/dto/ResponseDto.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/dto/ResponseDto.java deleted file mode 100644 index fbd43d8c..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/dto/ResponseDto.java +++ /dev/null @@ -1,31 +0,0 @@ -package io.mosip.biosdk.services.dto; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -import java.util.List; - -@Getter -@Setter -@NoArgsConstructor -@ToString -public class ResponseDto { - /** - * version - */ - @ApiModelProperty(value = "request version", position = 2) - private String version; - - @ApiModelProperty(value = "Response Time", position = 3) - private String responsetime; - - @ApiModelProperty(value = "Response", position = 4) - private T response; - - /** The error details. */ - @ApiModelProperty(value = "Error Details", position = 5) - private List errors; -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/exceptions/BioSDKException.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/exceptions/BioSDKException.java deleted file mode 100644 index af4e01be..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/exceptions/BioSDKException.java +++ /dev/null @@ -1,43 +0,0 @@ -package io.mosip.biosdk.services.exceptions; - -import io.mosip.kernel.core.exception.BaseUncheckedException; - -public class BioSDKException extends BaseUncheckedException { - /** - * Serializable Version Id - */ - private static final long serialVersionUID = 276197701640260133L; - - /** - * Constructs a new unchecked exception - */ - public BioSDKException() { - super(); - } - - /** - * Constructor - * - * @param errorCode - * the Error Code Corresponds to Particular Exception - * @param errorMessage - * the Message providing the specific context of the error - */ - public BioSDKException(String errorCode, String errorMessage) { - super(errorCode, errorMessage); - } - - /** - * Constructor - * - * @param errorCode - * the Error Code Corresponds to Particular Exception - * @param errorMessage - * the Message providing the specific context of the error - * @param throwable - * the Cause of exception - */ - public BioSDKException(String errorCode, String errorMessage, Throwable throwable) { - super(errorCode, errorMessage, throwable); - } -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/factory/BioSdkServiceFactory.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/factory/BioSdkServiceFactory.java deleted file mode 100644 index 54ec6e6b..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/factory/BioSdkServiceFactory.java +++ /dev/null @@ -1,25 +0,0 @@ -package io.mosip.biosdk.services.factory; - -import io.mosip.biosdk.services.exceptions.BioSDKException; -import io.mosip.biosdk.services.spi.BioSdkServiceProvider; -import io.mosip.biosdk.services.utils.ErrorCode; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.List; - -@Component -public class BioSdkServiceFactory { - - @Autowired - private List bioSdkServiceProviders; - - public BioSdkServiceProvider getBioSdkServiceProvider(String version){ - for(BioSdkServiceProvider provider : bioSdkServiceProviders) { - if(provider.getSpecVersion().equals(version)){ - return provider; - } - } - throw new BioSDKException(ErrorCode.NO_PROVIDERS.getErrorCode(), ErrorCode.NO_PROVIDERS.getErrorMessage()); - } -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/BioSdkServiceProviderImpl_V_1_0.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/BioSdkServiceProviderImpl_V_1_0.java deleted file mode 100644 index 798920cd..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/BioSdkServiceProviderImpl_V_1_0.java +++ /dev/null @@ -1,264 +0,0 @@ -package io.mosip.biosdk.services.impl.spec_1_0; - -import static io.mosip.biosdk.services.constants.AppConstants.LOGGER_IDTYPE; -import static io.mosip.biosdk.services.constants.AppConstants.LOGGER_SESSIONID; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - -import io.mosip.biosdk.services.config.LoggerConfig; -import io.mosip.biosdk.services.constants.ErrorMessages; -import io.mosip.biosdk.services.dto.RequestDto; -import io.mosip.biosdk.services.exceptions.BioSDKException; -import io.mosip.biosdk.services.impl.spec_1_0.dto.request.CheckQualityRequestDto; -import io.mosip.biosdk.services.impl.spec_1_0.dto.request.ConvertFormatRequestDto; -import io.mosip.biosdk.services.impl.spec_1_0.dto.request.ExtractTemplateRequestDto; -import io.mosip.biosdk.services.impl.spec_1_0.dto.request.InitRequestDto; -import io.mosip.biosdk.services.impl.spec_1_0.dto.request.MatchRequestDto; -import io.mosip.biosdk.services.impl.spec_1_0.dto.request.SegmentRequestDto; -import io.mosip.biosdk.services.spi.BioSdkServiceProvider; -import io.mosip.biosdk.services.utils.Utils; -import io.mosip.kernel.biometrics.entities.BiometricRecord; -import io.mosip.kernel.biometrics.model.Response; -import io.mosip.kernel.biometrics.model.SDKInfo; -import io.mosip.kernel.biometrics.spi.IBioApiV2; -import io.mosip.kernel.core.logger.spi.Logger; - -@Component -public class BioSdkServiceProviderImpl_V_1_0 implements BioSdkServiceProvider { - - private Logger logger = LoggerConfig.logConfig(BioSdkServiceProviderImpl_V_1_0.class); - - private static final String BIOSDK_SERVICE_SPEC_VERSION = "1.0"; - private static final String BIOSDK_SPEC_VERSION = "0.9"; - private static final String publicKey = ""; - private static final String privateKey = ""; - - @Autowired - private IBioApiV2 iBioApi; - - @Autowired - private Utils utils; - - private Gson gson = new GsonBuilder().serializeNulls().create(); - - @Value("${mosip.biosdk.log-request-response-enabled:false}") - private boolean isLogRequestResponse; - - @Override - public String getSpecVersion() { - return BIOSDK_SERVICE_SPEC_VERSION; - } - - @Override - public Object init(RequestDto request){ - SDKInfo sdkInfo = null; - String decryptedRequest = decode(request.getRequest()); - logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE,"init: ", "decoding successful"); - InitRequestDto initRequestDto = gson.fromJson(decryptedRequest, InitRequestDto.class); - logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE,"init: ", "json to dto successful"); - try { - logRequest(initRequestDto); - sdkInfo = iBioApi.init(initRequestDto.getInitParams()); - logObject(sdkInfo); - } catch (Throwable e){ - e.printStackTrace(); - logger.error(LOGGER_SESSIONID, LOGGER_IDTYPE,"init: ", e.toString()+" "+e.getMessage()); - throw new BioSDKException(ErrorMessages.BIOSDK_LIB_EXCEPTION.toString(), ErrorMessages.BIOSDK_LIB_EXCEPTION.getMessage()+": "+e.getMessage()); - } - return sdkInfo; - } - - @Override - public Object checkQuality(RequestDto request) { - Response response; - String decryptedRequest = decode(request.getRequest()); - logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE,"checkQuality: ", "decoding successful"); - CheckQualityRequestDto checkQualityRequestDto = gson.fromJson(decryptedRequest, CheckQualityRequestDto.class); - logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE,"checkQuality: ", "json to dto successful"); - try { - logRequest(checkQualityRequestDto); - response = iBioApi.checkQuality( - checkQualityRequestDto.getSample(), - checkQualityRequestDto.getModalitiesToCheck(), - checkQualityRequestDto.getFlags() - ); - logResponse(response); - } catch (Throwable e){ - e.printStackTrace(); - logger.error(LOGGER_SESSIONID, LOGGER_IDTYPE,"checkQuality: ", e.toString()+" "+e.getMessage()); - throw new BioSDKException(ErrorMessages.BIOSDK_LIB_EXCEPTION.toString(), ErrorMessages.BIOSDK_LIB_EXCEPTION.getMessage()+": "+e.toString()+" "+e.getMessage()); - } - return response; - } - - @Override - public Object match(RequestDto request) { - Response response; - String decryptedRequest = decode(request.getRequest()); - logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE,"match: ", "decoding successful"); - MatchRequestDto matchRequestDto = gson.fromJson(decryptedRequest, MatchRequestDto.class); - logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE,"match: ", "json to dto successful"); - try { - logRequest(matchRequestDto); - response = iBioApi.match( - matchRequestDto.getSample(), - matchRequestDto.getGallery(), - matchRequestDto.getModalitiesToMatch(), - matchRequestDto.getFlags() - ); - logResponse(response); - } catch (Throwable e){ - e.printStackTrace(); - logger.error(LOGGER_SESSIONID, LOGGER_IDTYPE,"match: ", e.toString()+" "+e.getMessage()); - throw new BioSDKException(ErrorMessages.BIOSDK_LIB_EXCEPTION.toString(), ErrorMessages.BIOSDK_LIB_EXCEPTION.getMessage()+": "+e.toString()+" "+e.getMessage()); - } - return response; - } - - @Override - public Object extractTemplate(RequestDto request) { - Response response; - String decryptedRequest = decode(request.getRequest()); - logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE,"extractTemplate: ", "decoding successful"); - ExtractTemplateRequestDto extractTemplateRequestDto = gson.fromJson(decryptedRequest, ExtractTemplateRequestDto.class); - logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE,"extractTemplate: ", "json to dto successful"); - try { - logRequest(extractTemplateRequestDto); - response = iBioApi.extractTemplate( - extractTemplateRequestDto.getSample(), - extractTemplateRequestDto.getModalitiesToExtract(), - extractTemplateRequestDto.getFlags() - ); - logResponse(response); - } catch (Throwable e){ - e.printStackTrace(); - logger.error(LOGGER_SESSIONID, LOGGER_IDTYPE,"extractTemplate: ", e.toString()+" "+e.getMessage()); - throw new BioSDKException(ErrorMessages.BIOSDK_LIB_EXCEPTION.toString(), ErrorMessages.BIOSDK_LIB_EXCEPTION.getMessage()+": "+e.toString()+" "+e.getMessage()); - } - return response; - } - - @Override - public Object segment(RequestDto request) { - Response response; - String decryptedRequest = decode(request.getRequest()); - logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE,"segment: ", "decoding successful"); - SegmentRequestDto segmentRequestDto = gson.fromJson(decryptedRequest, SegmentRequestDto.class); - logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE,"segment: ", "json to dto successful"); - try { - logRequest(segmentRequestDto); - response = iBioApi.segment( - segmentRequestDto.getSample(), - segmentRequestDto.getModalitiesToSegment(), - segmentRequestDto.getFlags() - ); - logResponse(response); - } catch (Throwable e){ - e.printStackTrace(); - logger.error(LOGGER_SESSIONID, LOGGER_IDTYPE,"segment: ", e.toString()+" "+e.getMessage()); - throw new BioSDKException(ErrorMessages.BIOSDK_LIB_EXCEPTION.toString(), ErrorMessages.BIOSDK_LIB_EXCEPTION.getMessage()+": "+e.toString()+" "+e.getMessage()); - } - return response; - } - - @Override - public Object convertFormat(RequestDto request) { - Response response; - String decryptedRequest = decode(request.getRequest()); - logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE,"convertFormat: ", "decoding successful"); - ConvertFormatRequestDto convertFormatRequestDto = gson.fromJson(decryptedRequest, ConvertFormatRequestDto.class); - logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE,"convertFormat: ", "json to dto successful"); - try { - logRequest(convertFormatRequestDto); - response = iBioApi.convertFormatV2( - convertFormatRequestDto.getSample(), - convertFormatRequestDto.getSourceFormat(), - convertFormatRequestDto.getTargetFormat(), - convertFormatRequestDto.getSourceParams(), - convertFormatRequestDto.getTargetParams(), - convertFormatRequestDto.getModalitiesToConvert() - ); - logResponse(response); - } catch (Throwable e){ - e.printStackTrace(); - logger.error(LOGGER_SESSIONID, LOGGER_IDTYPE,"convertFormat: ", e.toString()+" "+e.getMessage()); - throw new BioSDKException(ErrorMessages.BIOSDK_LIB_EXCEPTION.toString(), ErrorMessages.BIOSDK_LIB_EXCEPTION.getMessage()+": "+e.toString()+" "+e.getMessage()); - } - return response; - } - - private void logRequest(ExtractTemplateRequestDto extractTemplateRequestDto) { - if(isLogRequestResponse) { - logger.debug("REQUEST: " + utils.toString(extractTemplateRequestDto)); - } - } - - private void logRequest(MatchRequestDto matchRequestDto) { - if(isLogRequestResponse) { - logger.debug("REQUEST: " + utils.toString(matchRequestDto)); - } - } - - private void logRequest(InitRequestDto initRequestDto) { - if(isLogRequestResponse) { - logger.debug("REQUEST: " + utils.toString(initRequestDto)); - } - } - - private void logRequest(CheckQualityRequestDto checkQualityRequestDto) { - if(isLogRequestResponse) { - logger.debug("REQUEST: " + utils.toString(checkQualityRequestDto)); - } - } - - private void logRequest(SegmentRequestDto segmentRequestDto) { - if(isLogRequestResponse) { - logger.debug("REQUEST: " + utils.toString(segmentRequestDto)); - } - } - - private void logRequest(ConvertFormatRequestDto convertFormatRequestDto) { - if(isLogRequestResponse) { - logger.debug("REQUEST: " + utils.toString(convertFormatRequestDto)); - } - } - - private void logObject(T response) { - if(isLogRequestResponse) { - logger.debug(response.getClass() + ": " + gson.toJson(response)); - } - } - - private void logResponse(Response response) { - if(isLogRequestResponse) { - Object resp = response.getResponse(); - if(resp instanceof BiometricRecord) { - BiometricRecord biometricRecord = (BiometricRecord) resp; - logBiometricRecord("Response BiometricRecord: ", biometricRecord); - } else { - logger.debug("Response: " + gson.toJson(resp)); - } - } - } - - private void logBiometricRecord(String prefix, BiometricRecord biometricRecord) { - if(isLogRequestResponse) { - logger.debug(prefix + utils.toString(biometricRecord)); - } - } - - private String decode(String data){ - try { - return Utils.base64Decode(data); - } catch (RuntimeException e){ - e.printStackTrace(); - logger.error(LOGGER_SESSIONID, LOGGER_IDTYPE,ErrorMessages.INVALID_REQUEST_BODY.toString(), e.toString()+" "+e.getMessage()); - throw new BioSDKException(ErrorMessages.INVALID_REQUEST_BODY.toString(), ErrorMessages.INVALID_REQUEST_BODY.getMessage()+": "+e.toString()+" "+e.getMessage()); - } - } -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/CheckQualityRequestDto.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/CheckQualityRequestDto.java deleted file mode 100644 index bf96d096..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/CheckQualityRequestDto.java +++ /dev/null @@ -1,21 +0,0 @@ -package io.mosip.biosdk.services.impl.spec_1_0.dto.request; - -import io.mosip.kernel.biometrics.constant.BiometricType; -import io.mosip.kernel.biometrics.entities.BiometricRecord; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -import java.util.List; -import java.util.Map; - -@Getter -@Setter -@NoArgsConstructor -@ToString -public class CheckQualityRequestDto { - private BiometricRecord sample; - private List modalitiesToCheck; - private Map flags; -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/ConvertFormatRequestDto.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/ConvertFormatRequestDto.java deleted file mode 100644 index 315ce448..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/ConvertFormatRequestDto.java +++ /dev/null @@ -1,24 +0,0 @@ -package io.mosip.biosdk.services.impl.spec_1_0.dto.request; - -import io.mosip.kernel.biometrics.constant.BiometricType; -import io.mosip.kernel.biometrics.entities.BiometricRecord; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -import java.util.List; -import java.util.Map; - -@Getter -@Setter -@NoArgsConstructor -@ToString -public class ConvertFormatRequestDto { - private BiometricRecord sample; - private String sourceFormat; - private String targetFormat; - private Map sourceParams; - private Map targetParams; - private List modalitiesToConvert; -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/ExtractTemplateRequestDto.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/ExtractTemplateRequestDto.java deleted file mode 100644 index 8b4269f2..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/ExtractTemplateRequestDto.java +++ /dev/null @@ -1,21 +0,0 @@ -package io.mosip.biosdk.services.impl.spec_1_0.dto.request; - -import io.mosip.kernel.biometrics.constant.BiometricType; -import io.mosip.kernel.biometrics.entities.BiometricRecord; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -import java.util.List; -import java.util.Map; - -@Getter -@Setter -@NoArgsConstructor -@ToString -public class ExtractTemplateRequestDto { - private BiometricRecord sample; - private List modalitiesToExtract; - private Map flags; -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/InitRequestDto.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/InitRequestDto.java deleted file mode 100644 index 27e7bf8f..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/InitRequestDto.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.mosip.biosdk.services.impl.spec_1_0.dto.request; - -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -import java.util.Map; - -@Getter -@Setter -@NoArgsConstructor -@ToString -public class InitRequestDto { - - private Map initParams; -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/MatchRequestDto.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/MatchRequestDto.java deleted file mode 100644 index 196ea419..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/MatchRequestDto.java +++ /dev/null @@ -1,23 +0,0 @@ -package io.mosip.biosdk.services.impl.spec_1_0.dto.request; - -import io.mosip.kernel.biometrics.constant.BiometricType; -import io.mosip.kernel.biometrics.entities.BiometricRecord; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -import java.util.List; -import java.util.Map; - -@Getter -@Setter -@NoArgsConstructor -@ToString -public class MatchRequestDto { - private BiometricRecord sample; - private BiometricRecord[] gallery; - private List modalitiesToMatch; - private Map flags; -} - diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/SegmentRequestDto.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/SegmentRequestDto.java deleted file mode 100644 index 66102b34..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/impl/spec_1_0/dto/request/SegmentRequestDto.java +++ /dev/null @@ -1,21 +0,0 @@ -package io.mosip.biosdk.services.impl.spec_1_0.dto.request; - -import io.mosip.kernel.biometrics.constant.BiometricType; -import io.mosip.kernel.biometrics.entities.BiometricRecord; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -import java.util.List; -import java.util.Map; - -@Getter -@Setter -@NoArgsConstructor -@ToString -public class SegmentRequestDto { - private BiometricRecord sample; - private List modalitiesToSegment; - private Map flags; -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/spi/BioSdkServiceProvider.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/spi/BioSdkServiceProvider.java deleted file mode 100644 index 0c8902ea..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/spi/BioSdkServiceProvider.java +++ /dev/null @@ -1,19 +0,0 @@ -package io.mosip.biosdk.services.spi; - -import io.mosip.biosdk.services.dto.RequestDto; - -public interface BioSdkServiceProvider { - Object getSpecVersion(); - - Object init(RequestDto request); - - Object checkQuality(RequestDto request); - - Object match(RequestDto request); - - Object extractTemplate(RequestDto request); - - Object segment(RequestDto request); - - Object convertFormat(RequestDto request); -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/utils/ErrorCode.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/utils/ErrorCode.java deleted file mode 100644 index 99f48ece..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/utils/ErrorCode.java +++ /dev/null @@ -1,28 +0,0 @@ -package io.mosip.biosdk.services.utils; - -public enum ErrorCode { - - NO_PROVIDERS("BIO_SDK_001", "No Bio SDK service provider implementations found for given version"); - - private String errorCode; - private String errorMessage; - - ErrorCode(String errorCode, String errorMessage) { - this.errorCode = errorCode; - this.errorMessage = errorMessage; - } - - public String getErrorCode() { - return errorCode; - } - public void setErrorCode(String errorCode) { - this.errorCode = errorCode; - } - public String getErrorMessage() { - return errorMessage; - } - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - -} diff --git a/biosdk-services/src/main/java/io/mosip/biosdk/services/utils/Utils.java b/biosdk-services/src/main/java/io/mosip/biosdk/services/utils/Utils.java deleted file mode 100644 index 9a29bb5d..00000000 --- a/biosdk-services/src/main/java/io/mosip/biosdk/services/utils/Utils.java +++ /dev/null @@ -1,314 +0,0 @@ -package io.mosip.biosdk.services.utils; - -import java.nio.charset.StandardCharsets; -import java.time.LocalDateTime; -import java.util.Arrays; -import java.util.Base64; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.util.function.BiConsumer; - -import org.apache.commons.codec.digest.DigestUtils; -import org.json.simple.parser.ParseException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.google.gson.Gson; - -import io.mosip.biosdk.services.dto.RequestDto; -import io.mosip.biosdk.services.impl.spec_1_0.dto.request.CheckQualityRequestDto; -import io.mosip.biosdk.services.impl.spec_1_0.dto.request.ConvertFormatRequestDto; -import io.mosip.biosdk.services.impl.spec_1_0.dto.request.ExtractTemplateRequestDto; -import io.mosip.biosdk.services.impl.spec_1_0.dto.request.InitRequestDto; -import io.mosip.biosdk.services.impl.spec_1_0.dto.request.MatchRequestDto; -import io.mosip.biosdk.services.impl.spec_1_0.dto.request.SegmentRequestDto; -import io.mosip.kernel.biometrics.entities.BDBInfo; -import io.mosip.kernel.biometrics.entities.BIR; -import io.mosip.kernel.biometrics.entities.BIRInfo; -import io.mosip.kernel.biometrics.entities.BiometricRecord; -import io.mosip.kernel.core.util.DateUtils; - -@Component -public class Utils { - @Autowired - private Gson gson; - - private String utcDateTimePattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; - - public String getCurrentResponseTime() { - return DateUtils.formatDate(new Date(System.currentTimeMillis()), utcDateTimePattern); - } - - public RequestDto getRequestInfo(String request) throws ParseException { - return gson.fromJson(request, RequestDto.class); - } - - public static String base64Decode(String data){ - return new String(Base64.getDecoder().decode(data), StandardCharsets.UTF_8); - } - - public String toString(BiometricRecord biometricRecord) { - if(biometricRecord == null) { - return "null"; - } - - StringBuilder stringBuilder = new StringBuilder(); - appendString(biometricRecord, stringBuilder); - return stringBuilder.toString(); - } - - private void appendString(BiometricRecord biometricRecord, StringBuilder stringBuilder) { - if(biometricRecord == null) { - stringBuilder.append("null"); - } else { - stringBuilder.append("{"); - stringBuilder.append(" \"_modelClass\": \"BiometricRecord\""); - stringBuilder.append(", \"birInfo\": "); - stringBuilder.append(toString(biometricRecord.getBirInfo())); - stringBuilder.append(", \"cbeffversion\":"); - stringBuilder.append(stringOf(biometricRecord.getCbeffversion())); - stringBuilder.append(", \"version\":"); - stringBuilder.append(stringOf(biometricRecord.getVersion())); - stringBuilder.append(", \"segments\":"); - List segments = biometricRecord.getSegments(); - if(segments == null) { - stringBuilder.append("null"); - } else { - appendString(segments.stream().iterator(), stringBuilder, this::appendString); - } - stringBuilder.append(" }"); - } - } - - private String stringOf(Object obj) { - return obj == null ? "null" : gson.toJson(obj); - } - - private void appendString(Iterator iterator, StringBuilder stringBuilder, BiConsumer appendBiConsumer) { - stringBuilder.append("[ "); - while (iterator.hasNext()) { - T element = iterator.next(); - appendBiConsumer.accept(element, stringBuilder); - if(iterator.hasNext()) { - stringBuilder.append(", "); - } - } - stringBuilder.append(" ]"); - } - - private void appendString(BIR bir, StringBuilder stringBuilder) { - if(bir == null) { - stringBuilder.append("null"); - } else { - stringBuilder.append("{"); - stringBuilder.append(" \"_modelClass\": \"BIR\""); - stringBuilder.append(", \"bdbInfo\": "); - stringBuilder.append(toString(bir.getBdbInfo())); - stringBuilder.append(", \"birInfo\": "); - stringBuilder.append(toString(bir.getBirInfo())); - stringBuilder.append(", \"cbeffversion\": "); - stringBuilder.append(stringOf(bir.getCbeffversion())); - stringBuilder.append(", \"others\": "); - stringBuilder.append(stringOf(bir.getOthers())); - stringBuilder.append(", \"sbHash\": "); - stringBuilder.append(getHashOfBytes(bir.getSb())); - stringBuilder.append(", \"sbInfo\": "); - stringBuilder.append(stringOf(bir.getSbInfo())); - stringBuilder.append(", \"version\": "); - stringBuilder.append(stringOf(bir.getVersion())); - stringBuilder.append(", \"bdbHash\": "); - stringBuilder.append(getHashOfBytes(bir.getBdb())); - stringBuilder.append(" }"); - } - } - - private static String getHashOfBytes(byte[] byteArray) { - return byteArray == null ? "null" : "\""+ DigestUtils.sha256Hex(byteArray) + "\""; - } - - public String toString(ExtractTemplateRequestDto extractTemplateRequestDto) { - if(extractTemplateRequestDto == null) { - return "null"; - } - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append("{"); - stringBuilder.append(" \"_modelClass\": \"ExtractTemplateRequestDto\""); - stringBuilder.append(", \"flags\":"); - stringBuilder.append(stringOf(extractTemplateRequestDto.getFlags())); - stringBuilder.append(", \"modalitiesToExtract\": "); - stringBuilder.append(stringOf(extractTemplateRequestDto.getModalitiesToExtract())); - stringBuilder.append(", \"sample\": "); - appendString(extractTemplateRequestDto.getSample(), stringBuilder); - stringBuilder.append(" }"); - return stringBuilder.toString(); - } - - public String toString(MatchRequestDto matchRequestDto) { - if(matchRequestDto == null) { - return "null"; - } - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append("{"); - stringBuilder.append(" \"_modelClass\": \"MatchRequestDto\""); - stringBuilder.append(", \"flags\":"); - stringBuilder.append(stringOf(matchRequestDto.getFlags())); - stringBuilder.append(", \"modalitiesToMatch\": "); - stringBuilder.append(stringOf(matchRequestDto.getModalitiesToMatch())); - stringBuilder.append(", \"sample\": "); - appendString(matchRequestDto.getSample(), stringBuilder); - stringBuilder.append(", \"gallery\": "); - appendString(Arrays.stream(matchRequestDto.getGallery()).iterator(), stringBuilder, this::appendString); - stringBuilder.append(" }"); - return stringBuilder.toString(); - } - - public String toString(InitRequestDto initRequestDto) { - if(initRequestDto == null) { - return "null"; - } - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append("{"); - stringBuilder.append(" \"_modelClass\": \"InitRequestDto\""); - stringBuilder.append(", \"initParams\":"); - stringBuilder.append(stringOf(initRequestDto)); - stringBuilder.append(" }"); - return stringBuilder.toString(); - } - - public String toString(CheckQualityRequestDto checkQualityRequestDto) { - if(checkQualityRequestDto == null) { - return "null"; - } - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append("{"); - stringBuilder.append(" \"_modelClass\": \"CheckQualityRequestDto\""); - stringBuilder.append(", \"flags\":"); - stringBuilder.append(stringOf(checkQualityRequestDto.getFlags())); - stringBuilder.append(", \"modalitiesToCheck\": "); - stringBuilder.append(stringOf(checkQualityRequestDto.getModalitiesToCheck())); - stringBuilder.append(", \"sample\": "); - appendString(checkQualityRequestDto.getSample(), stringBuilder); - stringBuilder.append(" }"); - return stringBuilder.toString(); - } - - public String toString(SegmentRequestDto segmentRequestDto) { - if(segmentRequestDto == null) { - return "null"; - } - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append("{"); - stringBuilder.append(" \"_modelClass\": \"SegmentRequestDto\""); - stringBuilder.append(", \"flags\":"); - stringBuilder.append(stringOf(segmentRequestDto.getFlags())); - stringBuilder.append(", \"modalitiesToSegment\": "); - stringBuilder.append(stringOf(segmentRequestDto.getModalitiesToSegment())); - stringBuilder.append(", \"sample\": "); - appendString(segmentRequestDto.getSample(), stringBuilder); - stringBuilder.append(" }"); - return stringBuilder.toString(); - } - - public String toString(ConvertFormatRequestDto convertFormatRequestDto) { - if(convertFormatRequestDto == null) { - return "null"; - } - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append("{"); - stringBuilder.append(" \"_modelClass\": \"ConvertFormatRequestDto\""); - stringBuilder.append(", \"sourceFormat\":"); - stringBuilder.append(stringOf(convertFormatRequestDto.getSourceFormat())); - stringBuilder.append(", \"targetFormat\": "); - stringBuilder.append(stringOf(convertFormatRequestDto.getTargetFormat())); - stringBuilder.append(", \"modalitiesToConvert\": "); - stringBuilder.append(stringOf(convertFormatRequestDto.getModalitiesToConvert())); - stringBuilder.append(", \"sample\": "); - appendString(convertFormatRequestDto.getSample(), stringBuilder); - stringBuilder.append(", \"sourceParams\":"); - stringBuilder.append(stringOf(convertFormatRequestDto.getSourceParams())); - stringBuilder.append(", \"targetParams\": "); - stringBuilder.append(stringOf(convertFormatRequestDto.getTargetParams())); - appendString(convertFormatRequestDto.getSample(), stringBuilder); - stringBuilder.append(" }"); - return stringBuilder.toString(); - } - - public String toString(BDBInfo bdbInfo) { - if(bdbInfo == null) { - return "null"; - } - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append("{"); - stringBuilder.append(" \"_modelClass\": \"BDBInfo\""); - stringBuilder.append(", \"challengeResponseHash\":"); - stringBuilder.append(getHashOfBytes(bdbInfo.getChallengeResponse())); - stringBuilder.append(", \"index\": "); - stringBuilder.append(stringOf(bdbInfo.getIndex())); - stringBuilder.append(", \"format\": "); - stringBuilder.append(stringOf(bdbInfo.getFormat())); - stringBuilder.append(", \"encryption\":"); - stringBuilder.append(booleanAsString(bdbInfo.getEncryption())); - stringBuilder.append(", \"creationDate\": "); - stringBuilder.append(stringOf(dateAsString(bdbInfo.getCreationDate()))); - stringBuilder.append(", \"notValidBefore\": "); - stringBuilder.append(stringOf(dateAsString(bdbInfo.getNotValidBefore()))); - stringBuilder.append(", \"notValidAfter\": "); - stringBuilder.append(stringOf(dateAsString(bdbInfo.getNotValidAfter()))); - stringBuilder.append(", \"type\": "); - stringBuilder.append(stringOf(bdbInfo.getType())); - stringBuilder.append(", \"subtype\": "); - stringBuilder.append(stringOf(bdbInfo.getSubtype())); - stringBuilder.append(", \"level\": "); - stringBuilder.append(stringOf(bdbInfo.getLevel())); - stringBuilder.append(", \"product\": "); - stringBuilder.append(stringOf(bdbInfo.getProduct())); - stringBuilder.append(", \"captureDevice\": "); - stringBuilder.append(stringOf(bdbInfo.getCaptureDevice())); - stringBuilder.append(", \"featureExtractionAlgorithm\": "); - stringBuilder.append(stringOf(bdbInfo.getFeatureExtractionAlgorithm())); - stringBuilder.append(", \"comparisonAlgorithm\": "); - stringBuilder.append(stringOf(bdbInfo.getComparisonAlgorithm())); - stringBuilder.append(", \"compressionAlgorithm\": "); - stringBuilder.append(stringOf(bdbInfo.getCompressionAlgorithm())); - stringBuilder.append(", \"purpose\": "); - stringBuilder.append(stringOf(bdbInfo.getPurpose())); - stringBuilder.append(", \"quality\": "); - stringBuilder.append(stringOf(bdbInfo.getQuality())); - stringBuilder.append(" }"); - return stringBuilder.toString(); - } - - public String toString(BIRInfo birInfo) { - if(birInfo == null) { - return "null"; - } - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append("{"); - stringBuilder.append(" \"_modelClass\": \"BIRInfo\""); - stringBuilder.append(", \"creator\": "); - stringBuilder.append(stringOf(birInfo.getCreator())); - stringBuilder.append(", \"index\": "); - stringBuilder.append(stringOf(birInfo.getIndex())); - stringBuilder.append(", \"payloadHash\":"); - stringBuilder.append(getHashOfBytes(birInfo.getPayload())); - stringBuilder.append(", \"integrity\":"); - stringBuilder.append(booleanAsString(birInfo.getIntegrity())); - stringBuilder.append(", \"creationDate\": "); - stringBuilder.append(stringOf(dateAsString(birInfo.getCreationDate()))); - stringBuilder.append(", \"notValidBefore\": "); - stringBuilder.append(stringOf(dateAsString(birInfo.getNotValidBefore()))); - stringBuilder.append(", \"notValidAfter\": "); - stringBuilder.append(stringOf(dateAsString(birInfo.getNotValidAfter()))); - stringBuilder.append(" }"); - return stringBuilder.toString(); - } - - private String dateAsString(LocalDateTime localDateTime) { - return localDateTime == null ? "null" : DateUtils.formatToISOString(localDateTime); - } - - private static String booleanAsString(Boolean bool) { - return bool == null ? "null" : Boolean.toString(bool); - } -} diff --git a/biosdk-services/src/main/resources/application-local.properties b/biosdk-services/src/main/resources/application-local.properties deleted file mode 100644 index f8651016..00000000 --- a/biosdk-services/src/main/resources/application-local.properties +++ /dev/null @@ -1,10 +0,0 @@ -#iam mock-sdk config -sdk_check_iso_timestamp_format=true -biosdk_class=io.mosip.mock.sdk.impl.SampleSDKV2 -mosip.role.biosdk.getservicestatus=REGISTRATION_PROCESSOR -biosdk_bioapi_impl=io.mosip.mock.sdk.impl.SampleSDKV2 - -#iam image-compressor config -mosip.bio.image.compressor.resize.factor.fx=0.25 -mosip.bio.image.compressor.resize.factor.fy=0.25 -mosip.bio.image.compressor.compression.ratio=50 \ No newline at end of file diff --git a/biosdk-services/src/main/resources/application.properties b/biosdk-services/src/main/resources/application.properties deleted file mode 100644 index 60c3d459..00000000 --- a/biosdk-services/src/main/resources/application.properties +++ /dev/null @@ -1,33 +0,0 @@ -server.port=9099 -spring.cloud.config.enabled=true -security.basic.enabled=false -server.servlet.context-path=/biosdk-service -biosdk_bioapi_impl=io.mosip.mock.sdk.impl.SampleSDKV2 -#logging.level.org.springframework=DEBUG -spring.application.name=biosdk-service -spring.cloud.config.name=application,biosdk-service -spring.profiles.active=default -spring.cloud.config.label=master - - -## Tomcat access logs -server.tomcat.accesslog.enabled=true -server.tomcat.accesslog.directory=/dev -server.tomcat.accesslog.prefix=stdout -server.tomcat.accesslog.buffered=false -server.tomcat.accesslog.suffix= -server.tomcat.accesslog.file-date-format= -server.tomcat.accesslog.pattern={"@timestamp":"%{yyyy-MM-dd'T'HH:mm:ss.SSS'Z'}t","level":"ACCESS","level_value":70000,"traceId":"%{X-B3-TraceId}i","statusCode":%s,"req.requestURI":"%U","bytesSent":%b,"timeTaken":%T,"appName":"${spring.application.name}","req.userAgent":"%{User-Agent}i","req.xForwardedFor":"%{X-Forwarded-For}i","req.referer":"%{Referer}i","req.method":"%m","req.remoteHost":"%a"} -server.tomcat.accesslog.className=io.mosip.kernel.core.logger.config.SleuthValve - - -mosip.role.biosdk.getservicestatus=REGISTRATION_PROCESSOR -health.config.enabled=false -management.security.enable=false -management.endpoint.health.show-details=always -management.endpoints.web.exposure.include=info,health,refresh,mappings,env -management.endpoint.metrics.enabled=true -management.endpoint.prometheus.enabled=true -management.metrics.export.prometheus.enabled=true - -logging.level.root=INFO \ No newline at end of file diff --git a/biosdk-services/src/main/resources/bootstrap.properties b/biosdk-services/src/main/resources/bootstrap.properties deleted file mode 100644 index 0398cf4e..00000000 --- a/biosdk-services/src/main/resources/bootstrap.properties +++ /dev/null @@ -1,30 +0,0 @@ -spring.cloud.config.uri=http://localhost:51000/config -spring.cloud.config.label=master -spring.profiles.active=default -spring.application.name=biosdk-service -spring.cloud.config.name=application,biosdk-service -server.port=9099 -security.basic.enabled=false -server.servlet.context-path=/biosdk-service - -spring.cloud.config.enabled=true -server.servlet.context-path=/biosdk-service -health.config.enabled=false -management.security.enable=false -management.endpoint.health.show-details=always -management.endpoints.web.exposure.include=info,health,refresh,mappings,env -management.endpoint.metrics.enabled=true -management.endpoint.prometheus.enabled=true -management.metrics.export.prometheus.enabled=true - -#logging.level.org.springframework=DEBUG - -#iam mock-sdk config -sdk_check_iso_timestamp_format=true -mosip.role.biosdk.getservicestatus=REGISTRATION_PROCESSOR -biosdk_bioapi_impl=io.mosip.mock.sdk.impl.SampleSDKV2 - -#iam image-compressor config -mosip.bio.image.compressor.resize.factor.fx=0.25 -mosip.bio.image.compressor.resize.factor.fy=0.25 -mosip.bio.image.compressor.compression.ratio=50 \ No newline at end of file diff --git a/biosdk-services/src/main/resources/logback.xml b/biosdk-services/src/main/resources/logback.xml deleted file mode 100644 index b9dfc23e..00000000 --- a/biosdk-services/src/main/resources/logback.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/deploy/README.md b/deploy/README.md deleted file mode 100644 index 78c539dd..00000000 --- a/deploy/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Biosdk Service - -## Introduction -Details about this service are given [here](https://github.com/mosip/mosip-ref-impl/tree/develop/biosdk-services) - -The service expects **biosdk library** typically provided by a vendor. Host the library at a location that can be downloaded from within cluster with a URL. The default installation biosdk service contains mock SDK for testing the interfaces. - -## Prerequisites -To run this BioSDK service, you will need to first run the [artifactory](../../mosip/artifactory/README.md) which contains the mock SDK library. - -## Install -* Update `values.yaml` with your biosdk zipped library url and classpath. -* Install -```sh -./install.sh -``` - diff --git a/deploy/copy_cm.sh b/deploy/copy_cm.sh deleted file mode 100755 index b67cd791..00000000 --- a/deploy/copy_cm.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# Copy configmaps from other namespaces -# DST_NS: Destination namespace - -function copying_cm() { - UTIL_URL=https://github.com/mosip/mosip-infra/blob/master/deployment/v3/utils/copy_cm_func.sh - COPY_UTIL=./copy_cm_func.sh - DST_NS=biosdk - - wget -q $UTIL_URL -O copy_cm_func.sh && chmod +x copy_cm_func.sh - - $COPY_UTIL configmap global default $DST_NS - $COPY_UTIL configmap artifactory-share artifactory $DST_NS - $COPY_UTIL configmap config-server-share config-server $DST_NS - return 0 -} - -# set commands for error handling. -set -e -set -o errexit ## set -e : exit the script if any statement returns a non-true return value -set -o nounset ## set -u : exit the script if you try to use an uninitialised variable -set -o errtrace # trace ERR through 'time command' and other functions -set -o pipefail # trace ERR through pipes -copying_cm # calling function diff --git a/deploy/delete.sh b/deploy/delete.sh deleted file mode 100755 index dd3edf41..00000000 --- a/deploy/delete.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# Uninstalls Biosdk -## Usage: ./delete.sh [kubeconfig] - -if [ $# -ge 1 ] ; then - export KUBECONFIG=$1 -fi - -function deleting_biosdk() { - NS=biosdk - while true; do - read -p "Are you sure you want to delete Biosdk Service helm chart?(Y/n) " yn - if [ $yn = "Y" ] - then - helm -n $NS delete biosdk-service - break - else - break - fi - done - return 0 -} - -# set commands for error handling. -set -e -set -o errexit ## set -e : exit the script if any statement returns a non-true return value -set -o nounset ## set -u : exit the script if you try to use an uninitialised variable -set -o errtrace # trace ERR through 'time command' and other functions -set -o pipefail # trace ERR through pipes -deleting_biosdk # calling function \ No newline at end of file diff --git a/deploy/install.sh b/deploy/install.sh deleted file mode 100755 index 81f48c1c..00000000 --- a/deploy/install.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# Installs BioSDK -## Usage: ./install.sh [kubeconfig] - -if [ $# -ge 1 ] ; then - export KUBECONFIG=$1 -fi - -NS=biosdk -CHART_VERSION=12.0.1-develop - -echo Create $NS namespace -kubectl create ns $NS - -function installing_biosdk() { - echo Istio label - kubectl label ns $NS istio-injection=enabled --overwrite - helm repo update - - echo Copy configmaps - sed -i 's/\r$//' copy_cm.sh - ./copy_cm.sh - - echo Installing Biosdk server - helm -n $NS install biosdk-service mosip/biosdk-service -f values.yaml --version $CHART_VERSION - echo Biosdk service installed sucessfully. - return 0 -} - -# set commands for error handling. -set -e -set -o errexit ## set -e : exit the script if any statement returns a non-true return value -set -o nounset ## set -u : exit the script if you try to use an uninitialised variable -set -o errtrace # trace ERR through 'time command' and other functions -set -o pipefail # trace ERR through pipes -installing_biosdk # calling function diff --git a/deploy/values.yaml b/deploy/values.yaml deleted file mode 100644 index 4384a7e6..00000000 --- a/deploy/values.yaml +++ /dev/null @@ -1,5 +0,0 @@ -biosdk: - ## This is url of biosdk lib accessed from within cluster. BioSDK may be hosted outside the cluster - ## in which case change the URL accordingly. - zippedLibUrl: http://artifactory.artifactory/artifactory/libs-release-local/biosdk/biosdk-lib.zip - bioapiImpl: io.mosip.mock.sdk.impl.SampleSDKV2 diff --git a/helm/biosdk-service/.gitignore b/helm/biosdk-service/.gitignore deleted file mode 100644 index b3c94bf6..00000000 --- a/helm/biosdk-service/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -charts/ -Charts.lock diff --git a/helm/biosdk-service/.helmignore b/helm/biosdk-service/.helmignore deleted file mode 100644 index f0c13194..00000000 --- a/helm/biosdk-service/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/helm/biosdk-service/Chart.yaml b/helm/biosdk-service/Chart.yaml deleted file mode 100644 index 94a738dd..00000000 --- a/helm/biosdk-service/Chart.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v2 -name: biosdk-service -description: A Helm chart for MOSIP Auditmanager module -type: application -version: 12.0.1-develop -appVersion: "" -dependencies: - - name: common - repository: https://charts.bitnami.com/bitnami - tags: - - bitnami-common - version: 1.x.x -home: https://mosip.io -keywords: - - mosip - - biosdk-service - - kernel -maintainers: - - email: info@mosip.io - name: MOSIP diff --git a/helm/biosdk-service/README.md b/helm/biosdk-service/README.md deleted file mode 100644 index b0fd57bf..00000000 --- a/helm/biosdk-service/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Biosdk Service - -Helm chart for installing BioSDK Service. The service expects an SDK jar provided by SDK vendors. The default installation is with a mock SDK. - -## Install - -```console -$ helm repo add mosip https://mosip.github.io -$ helm install my-release mosip/biosdk-service -``` - - diff --git a/helm/biosdk-service/templates/NOTES.txt b/helm/biosdk-service/templates/NOTES.txt deleted file mode 100644 index 8b137891..00000000 --- a/helm/biosdk-service/templates/NOTES.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/helm/biosdk-service/templates/_helpers.tpl b/helm/biosdk-service/templates/_helpers.tpl deleted file mode 100644 index 1884663e..00000000 --- a/helm/biosdk-service/templates/_helpers.tpl +++ /dev/null @@ -1,60 +0,0 @@ -{{/* -Return the proper image name -*/}} -{{- define "biosdk-service.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 "biosdk-service.volumePermissions.image" -}} -{{- include "common.images.image" ( dict "imageRoot" .Values.volumePermissions.image "global" .Values.global ) -}} -{{- end -}} - -{{/* -Return the proper Docker Image Registry Secret Names -*/}} -{{- define "biosdk-service.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 "biosdk-service.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} - {{ default (printf "%s" (include "common.names.fullname" .)) .Values.serviceAccount.name }} -{{- else -}} - {{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} - -{{/* -Compile all warnings into a single message. -*/}} -{{- define "biosdk-service.validateValues" -}} -{{- $messages := list -}} -{{- $messages := append $messages (include "biosdk-service.validateValues.foo" .) -}} -{{- $messages := append $messages (include "biosdk-service.validateValues.bar" .) -}} -{{- $messages := without $messages "" -}} -{{- $message := join "\n" $messages -}} - -{{- if $message -}} -{{- printf "\nVALUES VALIDATION:\n%s" $message -}} -{{- end -}} -{{- end -}} - -{{/* -Return podAnnotations -*/}} -{{- define "biosdk-service.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/biosdk-service/templates/deployment.yaml b/helm/biosdk-service/templates/deployment.yaml deleted file mode 100644 index 078760dd..00000000 --- a/helm/biosdk-service/templates/deployment.yaml +++ /dev/null @@ -1,139 +0,0 @@ -apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} -kind: Deployment -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - 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 or .Values.podAnnotations .Values.metrics.enabled }} - {{- include "biosdk-service.podAnnotations" . | nindent 8 }} - {{- end }} - - labels: {{- include "common.labels.standard" . | nindent 8 }} - {{- if .Values.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} - {{- end }} - spec: - serviceAccountName: {{ template "biosdk-service.serviceAccountName" . }} - {{- include "biosdk-service.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 "biosdk-service.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: biosdk-service - image: {{ template "biosdk-service.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: - - name: container_user - value: {{ .Values.containerSecurityContext.runAsUser }} - - name: JDK_JAVA_OPTIONS - value: {{ .Values.additionalResources.javaOpts }} - - name: biosdk_zip_file_path - value: {{ .Values.biosdk.zippedLibUrl }} - - name: biosdk_bioapi_impl - value: {{ .Values.biosdk.bioapiImpl }} - {{- 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 }} - - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} - {{- end }} - ports: - - name: spring-service - containerPort: {{ .Values.springServicePort }} - - {{- 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/biosdk-service/templates/extra-list.yaml b/helm/biosdk-service/templates/extra-list.yaml deleted file mode 100644 index 9ac65f9e..00000000 --- a/helm/biosdk-service/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/biosdk-service/templates/service-account.yaml b/helm/biosdk-service/templates/service-account.yaml deleted file mode 100644 index 142bd5b5..00000000 --- a/helm/biosdk-service/templates/service-account.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "biosdk-service.serviceAccountName" . }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - namespace: {{ .Release.Namespace }} diff --git a/helm/biosdk-service/templates/service.yaml b/helm/biosdk-service/templates/service.yaml deleted file mode 100644 index 018e6985..00000000 --- a/helm/biosdk-service/templates/service.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - 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: - - port: {{ .Values.service.port }} - protocol: TCP - targetPort: {{ .Values.springServicePort }} - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} diff --git a/helm/biosdk-service/templates/servicemonitor.yaml b/helm/biosdk-service/templates/servicemonitor.yaml deleted file mode 100644 index 15f48fde..00000000 --- a/helm/biosdk-service/templates/servicemonitor.yaml +++ /dev/null @@ -1,36 +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 }} - {{- else }} - namespace: {{ .Release.Namespace | quote }} - {{- 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 }} -spec: - endpoints: - - targetPort: {{ .Values.springServicePort }} - 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/biosdk-service/templates/virtualservice.yaml b/helm/biosdk-service/templates/virtualservice.yaml deleted file mode 100644 index 37c614d0..00000000 --- a/helm/biosdk-service/templates/virtualservice.yaml +++ /dev/null @@ -1,32 +0,0 @@ -{{- if .Values.istio.enabled }} -apiVersion: networking.istio.io/v1alpha3 -kind: VirtualService -metadata: - name: {{ template "common.names.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - hosts: - - "*" - gateways: - - {{ .Values.istio.gateway }} - http: - - match: - - uri: - prefix: {{ .Values.istio.prefix }} - route: - - destination: - host: {{ template "common.names.fullname" . }} - port: - number: {{ .Values.service.port }} - headers: - request: - set: - x-forwarded-proto: https -{{- end }} diff --git a/helm/biosdk-service/values.yaml b/helm/biosdk-service/values.yaml deleted file mode 100644 index d30f11fc..00000000 --- a/helm/biosdk-service/values.yaml +++ /dev/null @@ -1,435 +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: - app.kubernetes.io/component: mosip - -## 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: mosipid/biosdk-server - tag: 1.2.0.1 - ## 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. -springServicePort: 9099 - -## 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: /biosdk-service/actuator/health - port: 9099 - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 30 - successThreshold: 1 - -livenessProbe: - enabled: true - httpGet: - path: /biosdk-service/actuator/health - port: 9099 - initialDelaySeconds: 20 - periodSeconds: 30 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 - -readinessProbe: - enabled: true - httpGet: - path: /biosdk-service/actuator/health - port: 9099 - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 6 - 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: 300m - memory: 2000Mi - requests: - cpu: 100m - memory: 500Mi - -additionalResources: - ## Specify any JAVA_OPTS string here. These typically will be specified in conjunction with above resources - ## Example: java_opts: "-Xms500M -Xmx500M" - javaOpts: "-Xms1250M -Xmx1250M" - -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container -## Clamav container already runs as 'mosip' user, so we may not need to enable this -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: - - name: server_servlet_context_env - value: /biosdk-service - - name: spring_application_name_env - value: biosdk-service - - name: spring_cloud_config_name_env - value: biosdk-service - -## ConfigMap with extra environment variables that used -## -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 RBAC resources should be created -## -rbac: - create: true - -## 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 -## -## TODO: Enable metrics after prometheus url is available -metrics: - enabled: false - ## Prometheus pod annotations - ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - ## - podAnnotations: - prometheus.io/scrape: "true" - - endpointPath: /v1/biosdk-service/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: [] - -## Only internal access -istio: - enabled: true - gateway: istio-system/internal - prefix: /biosdk-service - -## Biosdk server expects an SDK library (zip file). Default is a mock SDK available in the artifactory. -## You may specify any url as long as it can be accessed from within the cluster -## bioapi_impl: Classpath of SDK implementation within the SDK lib. -biosdk: - # zippedLibUrl: http://artifactory.artifactory/artifactory/libs-release-local/biosdk/mock/0.9/biosdk.zip - # bioapiImpl: io.mosip.biosdk.client.impl.spec_1_0.Client_V_1_0 - zippedLibUrl: http://artifactory.artifactory/artifactory/libs-release-local/biosdk/biosdk-lib.zip - bioapiImpl: io.mosip.mock.sdk.impl.SampleSDKV2