diff --git a/.circleci/config.yml b/.circleci/config.yml index 6864b8836..b1b26bb08 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,6 +34,7 @@ defaults_awsCliDependencies: &defaults_awsCliDependencies | less \ mailcap pip3 install --upgrade pip awscli==1.14.5 s3cmd==2.0.1 python-magic + apk -v --purge del py-pip defaults_license_scanner: &defaults_license_scanner name: Install and set up license-scanner @@ -55,6 +56,7 @@ executors: default-machine: machine: image: ubuntu-1604:201903-01 + ## # Jobs # @@ -240,7 +242,7 @@ jobs: - run: name: Install docker dependencies for anchore command: | - apk add --update py-pip docker python3-dev libffi-dev openssl-dev gcc libc-dev make jq npm + apk add --update python3 py3-pip docker python3-dev libffi-dev openssl-dev gcc libc-dev make jq npm - run: name: Install general dependencies command: | @@ -316,12 +318,21 @@ jobs: command: | echo "Publishing $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:$CIRCLE_TAG" docker push $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:$CIRCLE_TAG - echo "Publishing $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:$RELEASE_TAG" - docker push $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:$RELEASE_TAG + case "$CIRCLE_TAG" in + *-pisp*) + # Don't update `late5t` for an image that has a `-pisp` + echo 'skipping late5t tag' + exit 0 + ;; + *) + echo "Publishing $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:$RELEASE_TAG" + docker push $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:$RELEASE_TAG + ;; + esac - slack/status: webhook: "$SLACK_WEBHOOK_ANNOUNCEMENT" success_message: '*"${CIRCLE_PROJECT_REPONAME}"* - Release \`"${CIRCLE_TAG}"\` \nhttps://github.com/mojaloop/"${CIRCLE_PROJECT_REPONAME}"/releases/tag/"${CIRCLE_TAG}"' - + deploy: executor: deploy-kube/helm-kube steps: @@ -411,7 +422,7 @@ workflows: - setup filters: tags: - only: /.*/ + only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?(\-hotfix(\.[0-9]+))?(\-pisp)?/ branches: ignore: - /feature*/ @@ -438,7 +449,7 @@ workflows: - audit-licenses filters: tags: - only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?(\-hotfix(\.[0-9]+))?/ + only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?(\-hotfix(\.[0-9]+))?(\-pisp)?/ branches: ignore: - /.*/ @@ -448,7 +459,7 @@ workflows: - build filters: tags: - only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?(\-hotfix(\.[0-9]+))?/ + only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?(\-hotfix(\.[0-9]+))?(\-pisp)?/ branches: ignore: - /.*/ @@ -458,7 +469,7 @@ workflows: - build filters: tags: - only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?(\-hotfix(\.[0-9]+))?/ + only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?(\-hotfix(\.[0-9]+))?(\-pisp)?/ branches: ignore: - /.*/ @@ -469,7 +480,7 @@ workflows: - image-scan filters: tags: - only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?(\-hotfix(\.[0-9]+))?/ + only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?(\-hotfix(\.[0-9]+))?(\-pisp)?/ branches: ignore: - /.*/ diff --git a/package.json b/package.json index 3587e9b85..86b1335a9 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,9 @@ "Sam Kummary ", "Steven Oderayi ", "Valentin Genev ", - "Shashikant Hirugade " + "Shashikant Hirugade ", + "Paweł Marzec ", + "Kevin Leylow " ], "repository": { "type": "git", @@ -79,6 +81,7 @@ "@hapi/good": "9.0.1", "@hapi/hapi": "20.0.2", "@hapi/inert": "6.0.3", + "@hapi/joi": "17.1.1", "@hapi/vision": "6.0.1", "@mojaloop/central-object-store": "11.0.1-snapshot", "@mojaloop/central-services-database": "10.6.1", diff --git a/seeds/endpointType.js b/seeds/endpointType.js index 98b4556b1..b212c51be 100644 --- a/seeds/endpointType.js +++ b/seeds/endpointType.js @@ -141,6 +141,78 @@ const endpointTypes = [ { name: 'FSPIOP_CALLBACK_URL_BULK_QUOTES', description: 'Bulk Quotes callback URL to which put bulkQuotes requests can be sent' + }, + { + name: 'TP_CB_URL_TRANSACTION_REQUEST_GET', + description: 'Participant callback URL where GET /thirdpartyRequests/transactions/{ID} can be sent' + }, + { + name: 'TP_CB_URL_TRANSACTION_REQUEST_POST', + description: 'Participant callback URL where POST /thirdpartyRequests/transactions can be sent' + }, + { + name: 'TP_CB_URL_TRANSACTION_REQUEST_PUT', + description: 'Participant callback URL where PUT /thirdpartyRequests/transactions/{ID} can be sent' + }, + { + name: 'TP_CB_URL_TRANSACTION_REQUEST_PUT_ERROR', + description: 'Participant callback URL to which PUT /thirdpartyRequests/transactions/{ID}/error error information can be sent' + }, + { + name: 'TP_CB_URL_TRANSACTION_REQUEST_PATCH', + description: 'Participant callback URL where PATCH /thirdpartyRequests/transactions/{ID} can be sent' + }, + { + name: 'TP_CB_URL_TRANSACTION_REQUEST_AUTH_POST', + description: 'Participant callback URL where POST /thirdpartyRequests/transactions/{ID}/authorizations can be sent' + }, + { + name: 'TP_CB_URL_TRANSACTION_REQUEST_AUTH_PUT', + description: 'Participant callback URL where PUT /thirdpartyRequests/transactions/{ID}/authorizations can be sent' + }, + { + name: 'TP_CB_URL_TRANSACTION_REQUEST_AUTH_PUT_ERROR', + description: 'Participant callback URL where PUT /thirdpartyRequests/transactions/{ID}/authorizations/error error information can be sent' + }, + { + name: 'TP_CB_URL_CONSENT_REQUEST_POST', + description: 'Participant callback URL where POST /consentRequests can be sent' + }, + { + name: 'TP_CB_URL_CONSENT_REQUEST_PUT', + description: 'Participant callback URL where PUT /consentRequests/{ID} can be sent' + }, + { + name: 'TP_CB_URL_CONSENT_REQUEST_PUT_ERROR', + description: 'Participant callback URL where PUT /consentRequests/{ID}/error error information can be sent' + }, + { + name: 'TP_CB_URL_CREATE_CREDENTIAL_POST', + description: 'Participant callback URL where POST /consentRequests/{ID}/createCredential can be sent' + }, + { + name: 'TP_CB_URL_CONSENT_POST', + description: 'Participant callback URL where POST /consents/ can be sent' + }, + { + name: 'TP_CB_URL_CONSENT_GET', + description: 'Participant callback URL where GET /consents/{ID} can be sent' + }, + { + name: 'TP_CB_URL_CONSENT_PUT', + description: 'Participant callback URL where PUT /consents/{ID} can be sent' + }, + { + name: 'TP_CB_URL_CONSENT_PUT_ERROR', + description: 'Participant callback URL where PUT /consents/{ID}/error error information can be sent' + }, + { + name: 'TP_CB_URL_CONSENT_GENERATE_CHALLENGE_POST', + description: 'Participant callback URL where POST /consents/{ID}/generateChallenge can be sent' + }, + { + name: 'TP_CB_URL_CONSENT_GENERATE_CHALLENGE_PUT_ERROR', + description: 'Participant callback URL where PUT /consents/{ID}/generateChallenge/error error information can be sent' } ] diff --git a/src/api/transactions/routes.js b/src/api/transactions/routes.js index a26c01b67..da3b5889b 100644 --- a/src/api/transactions/routes.js +++ b/src/api/transactions/routes.js @@ -25,7 +25,7 @@ 'use strict' const Handler = require('./handler') -const Joi = require('joi') +const Joi = require('@hapi/joi') const tags = ['api', 'transaction'] module.exports = [ diff --git a/src/handlers/bulk/fulfil/handler.js b/src/handlers/bulk/fulfil/handler.js index 5da1b3593..2817e7dbd 100644 --- a/src/handlers/bulk/fulfil/handler.js +++ b/src/handlers/bulk/fulfil/handler.js @@ -149,6 +149,15 @@ const bulkFulfil = async (error, messages) => { while ((doc = await streamReader.readAsync()) !== null) { await sendIndividualTransfer(message, messageId, kafkaTopic, headers, payload, state, params, doc.payload, histTimerEnd) } + const dataUri = encodePayload(JSON.stringify(individualTransferFulfil), headers[Enum.Http.Headers.GENERAL.CONTENT_TYPE.value]) + const metadata = Util.StreamingProtocol.createMetadataWithCorrelatedEventState(message.value.metadata.event.id, Enum.Events.Event.Type.FULFIL, Enum.Events.Event.Action.COMMIT, Enum.Events.EventStatus.SUCCESS.status, Enum.Events.EventStatus.SUCCESS.code, Enum.Events.EventStatus.SUCCESS.description) // TODO: switch action to 'bulk-fulfil' flow + const msg = { + value: Util.StreamingProtocol.createMessage(messageId, headers[Enum.Http.Headers.FSPIOP.DESTINATION], headers[Enum.Http.Headers.FSPIOP.SOURCE], metadata, headers, dataUri, { id: transferId }) + } + params = { message: msg, kafkaTopic, consumer: Consumer, producer: Producer } + const eventDetail = { functionality: Enum.Events.Event.Type.FULFIL, action: Enum.Events.Event.Action.BULK_COMMIT } + await Kafka.proceed(Config.KAFKA_CONFIG, params, { consumerCommit, histTimerEnd, eventDetail }) + histTimerEnd({ success: true, fspId: Config.INSTRUMENTATION_METRICS_LABELS.fspId }) } } catch (err) { // TODO: handle individual transfers streaming error Logger.isInfoEnabled && Logger.info(Util.breadcrumb(location, `callbackErrorInternal2--${actionLetter}6`))