From 05eb5a27eabe5b24dd111e778f8e97e171022019 Mon Sep 17 00:00:00 2001 From: David Fry Date: Mon, 23 Oct 2023 12:11:25 +0100 Subject: [PATCH 1/4] proposed fix for gh action --- .github/workflows/releaseWorkflow.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/releaseWorkflow.yml b/.github/workflows/releaseWorkflow.yml index b7d7a0a..d9f1d5a 100644 --- a/.github/workflows/releaseWorkflow.yml +++ b/.github/workflows/releaseWorkflow.yml @@ -2,7 +2,7 @@ name: Create Tagged Release on: release: - types: [ published ] + types: [published] push: branches: - main @@ -24,13 +24,13 @@ jobs: test_license: uses: modusbox/github-actions-node/.github/workflows/testLicenseJob.yml@v0.0.4 -# TODO: Enable when there are unit tests -# test_unit: -# uses: modusbox/github-actions-node/.github/workflows/testUnitJob.yml@v0.0.4 + # TODO: Enable when there are unit tests + # test_unit: + # uses: modusbox/github-actions-node/.github/workflows/testUnitJob.yml@v0.0.4 -# TODO: Enable when there is coveragte for unit tests -# test_coverage: -# uses: modusbox/github-actions-node/.github/workflows/testCoverageJob.yml@v0.0.4 + # TODO: Enable when there is coveragte for unit tests + # test_coverage: + # uses: modusbox/github-actions-node/.github/workflows/testCoverageJob.yml@v0.0.4 test_int: uses: modusbox/github-actions-node/.github/workflows/testIntJob.yml@v0.0.4 @@ -44,15 +44,15 @@ jobs: - test_dependencies - test_audit - test_license -# - test_unit -# - test_coverage + # - test_unit + # - test_coverage - test_int - test_func uses: modusbox/github-actions-node/.github/workflows/createReleaseTagJob.yml@v0.0.2 secrets: - GIT_KEY: ${{ secrets.PSO_GIT_KEY }} - GIT_USER: ${{ secrets.PSO_GIT_USER }} - GIT_EMAIL: ${{ secrets.PSO_GIT_EMAIL }} + GIT_KEY: ${{ secrets.GITHUB_TOKEN }} + GIT_USER: ${{ github.actor }} + GIT_EMAIL: "cicd@infitx.com" release_gh: needs: From 789b9de61d4665b25b353e83393d00c6a87907cc Mon Sep 17 00:00:00 2001 From: David Fry Date: Mon, 23 Oct 2023 12:45:11 +0100 Subject: [PATCH 2/4] rm extraneous jobs --- .github/workflows/releaseWorkflow.yml | 48 ++------------------------- 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/.github/workflows/releaseWorkflow.yml b/.github/workflows/releaseWorkflow.yml index d9f1d5a..af34ceb 100644 --- a/.github/workflows/releaseWorkflow.yml +++ b/.github/workflows/releaseWorkflow.yml @@ -38,57 +38,13 @@ jobs: test_func: uses: ./.github/workflows/testFuncJob.yml - release_tag: - needs: - - test_lint - - test_dependencies - - test_audit - - test_license - # - test_unit - # - test_coverage - - test_int - - test_func - uses: modusbox/github-actions-node/.github/workflows/createReleaseTagJob.yml@v0.0.2 - secrets: - GIT_KEY: ${{ secrets.GITHUB_TOKEN }} - GIT_USER: ${{ github.actor }} - GIT_EMAIL: "cicd@infitx.com" - - release_gh: - needs: - - release_tag - uses: modusbox/github-actions-node/.github/workflows/createReleaseGHJob.yml@v0.0.2 - with: - RELEASE_VERSION: v${{ needs.release_tag.outputs.VERSION }} - RELEASE_CHANGE_ARTEFACT: ${{ needs.release_tag.outputs.RELEASE_CHANGE_ARTEFACT }} - RELEASE_CHANGE_FILENAME: ${{ needs.release_tag.outputs.RELEASE_CHANGE_FILENAME }} - secrets: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} publish_image: - needs: - - release_tag - - release_gh uses: modusbox/github-actions-node/.github/workflows/publishImageJob.yml@v0.0.2 with: - RELEASE_VERSION: v${{ needs.release_tag.outputs.VERSION }} - RELEASE_URL: ${{ github.server_url }}/${{ github.repository }}/releases/tag/v${{ needs.release_tag.outputs.VERSION }} + RELEASE_VERSION: v${{ github.event.release.tag_name }} + RELEASE_URL: ${{ github.server_url }}/${{ github.repository }}/releases/tag/v${{ github.event.release.tag_name }} secrets: USER: ${{ github.actor }} PASSWORD: ${{ secrets.GITHUB_TOKEN }} - notify: - needs: - - release_tag - - release_gh - - publish_image - if: ${{ always() }} # Here we report on the final state of the workflow! - uses: modusbox/github-actions-node/.github/workflows/notifyReleaseJob.yml@v0.0.2 - with: - JOB_STATUS: ${{ ((needs.release_tag.result == 'success') && (needs.release_gh.result == 'success') && (needs.publish_image.result == 'success')) && 'success' || 'failed' }} - TYPE: Release - RELEASE_VERSION: ${{ ((needs.release_tag.result == 'success') && (needs.release_gh.result == 'success') && (needs.publish_image.result == 'success')) && format('v{0}', needs.release_tag.outputs.VERSION) || 'n/a' }} - RELEASE_URL: ${{ ((needs.release_tag.result == 'success') && (needs.release_gh.result == 'success') && (needs.publish_image.result == 'success')) && format('{0} {1}/{2}/releases/tag/v{3}', ':shipit:', github.server_url, github.repository, needs.release_tag.outputs.VERSION) || ':fire:' }} - secrets: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - SLACK_CHANEL: ${{ secrets.SLACK_CHANNEL_PSO_RELEASE }} From 40b91362a98ecd7c34e949caafe46f9ef604a11a Mon Sep 17 00:00:00 2001 From: David Fry Date: Mon, 23 Oct 2023 12:52:50 +0100 Subject: [PATCH 3/4] rmove v --- .github/workflows/releaseWorkflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/releaseWorkflow.yml b/.github/workflows/releaseWorkflow.yml index af34ceb..3337010 100644 --- a/.github/workflows/releaseWorkflow.yml +++ b/.github/workflows/releaseWorkflow.yml @@ -42,8 +42,8 @@ jobs: publish_image: uses: modusbox/github-actions-node/.github/workflows/publishImageJob.yml@v0.0.2 with: - RELEASE_VERSION: v${{ github.event.release.tag_name }} - RELEASE_URL: ${{ github.server_url }}/${{ github.repository }}/releases/tag/v${{ github.event.release.tag_name }} + RELEASE_VERSION: ${{ github.event.release.tag_name }} + RELEASE_URL: ${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.event.release.tag_name }} secrets: USER: ${{ github.actor }} PASSWORD: ${{ secrets.GITHUB_TOKEN }} From 1457dc6d5b0f4d5777535a02a45b245c4064bb0c Mon Sep 17 00:00:00 2001 From: "geka.evk" Date: Tue, 24 Oct 2023 15:29:36 +0100 Subject: [PATCH 4/4] feat(iprod-189): added currency_code to populateDFSPClientCertBundle --- src/pki_engine/VaultPKIEngine.js | 3 ++- src/service/DfspOnboardService.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pki_engine/VaultPKIEngine.js b/src/pki_engine/VaultPKIEngine.js index bb5e454..beeff41 100644 --- a/src/pki_engine/VaultPKIEngine.js +++ b/src/pki_engine/VaultPKIEngine.js @@ -294,7 +294,7 @@ class VaultPKIEngine extends PKIEngine { } // endregion - async populateDFSPClientCertBundle (dfspId, dfspName) { + async populateDFSPClientCertBundle (dfspId, dfspName, dfspMonetaryZoneId) { this.validateId(dfspId, 'dfspId'); const dfspCA = await this.getDFSPCA(dfspId); const enrollments = await this.getDFSPOutboundEnrollments(dfspId); @@ -308,6 +308,7 @@ class VaultPKIEngine extends PKIEngine { client_cert_chain: `${dfspClientCert.certificate}\n${dfspCA.intermediateChain}\n${dfspCA.rootCertificate}`, fqdn: cert.subject.CN, host: dfspName, + currency_code: dfspMonetaryZoneId, }; await this.client.write(`${this.mounts.dfspClientCertBundle}/${dfspName}`, bundle); } diff --git a/src/service/DfspOnboardService.js b/src/service/DfspOnboardService.js index e97c017..d0c4445 100644 --- a/src/service/DfspOnboardService.js +++ b/src/service/DfspOnboardService.js @@ -28,8 +28,8 @@ const getIPsBundle = async () => { exports.onboardDFSP = async (ctx, dfspId) => { await PkiService.validateDfsp(ctx, dfspId); const { pkiEngine } = ctx; - const id = await DFSPModel.findIdByDfspId(dfspId); - await pkiEngine.populateDFSPClientCertBundle(id, dfspId); + const { id, monetaryZoneId } = await DFSPModel.findByDfspId(dfspId); + await pkiEngine.populateDFSPClientCertBundle(id, dfspId, monetaryZoneId); const ipsBundle = await getIPsBundle(); await pkiEngine.populateDFSPInternalIPWhitelistBundle(ipsBundle);