@mojaloop/sdk-scheme-adapter 11.18.12 → 12.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +619 -0
- package/.nvmrc +1 -1
- package/.versionrc +1 -0
- package/CHANGELOG.md +24 -2
- package/CODEOWNERS +2 -0
- package/Dockerfile +35 -0
- package/LICENSE.md +10 -0
- package/PROXY.md +84 -0
- package/README.md +228 -0
- package/SECURITY.md +18 -0
- package/audit-resolve.json +142 -0
- package/docker/ml-testing-toolkit/secrets/keygen.sh +5 -0
- package/docker/ml-testing-toolkit/secrets/privatekey.pem +27 -0
- package/docker/ml-testing-toolkit/secrets/publickey.cer +21 -0
- package/docker/ml-testing-toolkit/secrets/tls/createSecrets.sh +29 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_client.csr +28 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_client_cacert.pem +32 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_client_cakey.key +51 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_client_key.key +51 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_server.csr +28 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_server_cacert.pem +32 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_server_cacert.srl +1 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_server_cakey.key +51 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_server_cert.pem +33 -0
- package/docker/ml-testing-toolkit/secrets/tls/hub_server_key.key +51 -0
- package/docker/ml-testing-toolkit/secrets/tls/openssl.conf +17 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/central_admin_9.3/api_spec.yaml +2450 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/central_admin_9.3/response_map.json +96 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.0/api_spec.yaml +4187 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.0/callback_map.json +542 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.0/mockRef.json +83 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.0/trigger_templates/transaction_request_followup.json +125 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.1/api_spec.yaml +3703 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.1/callback_map.json +568 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.1/mockRef.json +83 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/fspiop_1.1/trigger_templates/transaction_request_followup.json +125 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/settlements_1.0/api_spec.yaml +983 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/settlements_1.0/mockRef.json +38 -0
- package/docker/ml-testing-toolkit/spec_files/api_definitions/settlements_1.0/response_map.json +34 -0
- package/docker/ml-testing-toolkit/spec_files/reports/templates/newman/html_template.html +1074 -0
- package/docker/ml-testing-toolkit/spec_files/reports/templates/newman/pdf_template.html +765 -0
- package/docker/ml-testing-toolkit/spec_files/reports/templates/newman/script.js +98 -0
- package/docker/ml-testing-toolkit/spec_files/rules_callback/config.json +3 -0
- package/docker/ml-testing-toolkit/spec_files/rules_callback/default.json +426 -0
- package/docker/ml-testing-toolkit/spec_files/rules_response/config.json +3 -0
- package/docker/ml-testing-toolkit/spec_files/rules_response/default.json +1623 -0
- package/docker/ml-testing-toolkit/spec_files/rules_response/default_pisp_rules.json +161 -0
- package/docker/ml-testing-toolkit/spec_files/rules_validation/config.json +3 -0
- package/docker/ml-testing-toolkit/spec_files/rules_validation/default.json +672 -0
- package/docker/ml-testing-toolkit/spec_files/system_config.json +62 -0
- package/docker/ml-testing-toolkit/spec_files/user_config.json +45 -0
- package/docker/wait4/setup_hosts_file.sh +25 -0
- package/docker/wait4/wait4.config.js +71 -0
- package/docker/wait4/wait4.js +204 -0
- package/docker-compose.yml +67 -0
- package/docs/Mojaloop - Modusbox Onboarding functionality.pdf +0 -0
- package/docs/dfspInboundApi.yaml +1091 -0
- package/jest.config.js +4 -1
- package/junit.xml +515 -0
- package/package.json +15 -13
- package/secrets/jwsSigningKey.key +27 -0
- package/secrets/jwsVerificationKeys/mojaloop-sdk.pem +9 -0
- package/secrets/jwsVerificationKeys/switch.pem +9 -0
- package/sequences.puml +99 -0
- package/{InboundServer → src/InboundServer}/api.yaml +0 -0
- package/src/InboundServer/api_template.yaml +69 -0
- package/{InboundServer → src/InboundServer}/handlers.js +0 -0
- package/{InboundServer → src/InboundServer}/index.js +0 -0
- package/{InboundServer → src/InboundServer}/middlewares.js +0 -0
- package/src/OAuthTestServer/index.js +127 -0
- package/{OAuthTestServer → src/OAuthTestServer}/model.js +0 -0
- package/{OutboundServer → src/OutboundServer}/api.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_interfaces/index.d.ts +1 -17
- package/{OutboundServer → src/OutboundServer}/api_interfaces/openapi.d.ts +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/parameters/bulkQuoteId.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/parameters/bulkTransferId.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/parameters/requestToPayTransactionId.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/parameters/transferId.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/accountsCreationCompleted.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/accountsCreationError.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/accountsCreationTimeout.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkQuoteBadRequest.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkQuoteServerError.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkQuoteSuccess.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkQuoteTimeout.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkTransferBadRequest.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkTransferServerError.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkTransferSuccess.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/bulkTransferTimeout.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/partiesByIdError404.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/partiesByIdSuccess.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/quotesPostSuccess.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/quotesServerError.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/requestToPaySuccess.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/requestToPayTransferBadRequest.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/requestToPayTransferSuccess.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/simpleTransfersPostSuccess.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/simpleTransfersServerError.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/transferBadRequest.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/transferServerError.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/transferSuccess.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/responses/transferTimeout.yaml +0 -0
- package/src/OutboundServer/api_template/components/schemas/accountCreationStatus.yaml +18 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/accountsCreationState.yaml +0 -0
- package/src/OutboundServer/api_template/components/schemas/accountsRequest.yaml +20 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/accountsResponse.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/async2SyncCurrentState.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkQuoteErrorResponse.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkQuoteRequest.yaml +2 -2
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkQuoteResponse.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkQuoteStatus.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkQuoteStatusResponse.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkTransferErrorResponse.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkTransferRequest.yaml +2 -2
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkTransferResponse.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkTransferStatus.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/bulkTransferStatusResponse.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/errorAccountsResponse.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/errorQuotesResponse.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/errorResponse.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/errorSimpleTransfersResponse.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/errorTransferResponse.yaml +0 -0
- package/src/OutboundServer/api_template/components/schemas/extensionListEmptiable.yaml +6 -0
- package/src/OutboundServer/api_template/components/schemas/individualQuote.yaml +32 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/individualQuoteResult.yaml +5 -5
- package/src/OutboundServer/api_template/components/schemas/individualTransfer.yaml +32 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/individualTransferFulfilment.yaml +2 -2
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/individualTransferResult.yaml +6 -6
- package/src/OutboundServer/api_template/components/schemas/mojaloopError.yaml +5 -0
- package/src/OutboundServer/api_template/components/schemas/mojaloopTransactionRequestState.yaml +2 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/partiesByIdResponse.yaml +2 -2
- package/src/OutboundServer/api_template/components/schemas/quote.yaml +3 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/quoteError.yaml +0 -0
- package/src/OutboundServer/api_template/components/schemas/quotesPostRequest.yaml +13 -0
- package/src/OutboundServer/api_template/components/schemas/quotesPostResponse.yaml +48 -0
- package/src/OutboundServer/api_template/components/schemas/requestToPayRequest.yaml +39 -0
- package/src/OutboundServer/api_template/components/schemas/requestToPayResponse.yaml +41 -0
- package/src/OutboundServer/api_template/components/schemas/requestToPayTransferRequest.yaml +42 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/requestToPayTransferResponse.yaml +6 -6
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/simpleTransferServerError.yaml +0 -0
- package/src/OutboundServer/api_template/components/schemas/simpleTransfersPostRequest.yaml +12 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/simpleTransfersPostResponse.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transactionType.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferContinuationAcceptOTP.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferContinuationAcceptParty.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferContinuationAcceptQuote.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferError.yaml +0 -0
- package/src/OutboundServer/api_template/components/schemas/transferFulfilment.yaml +3 -0
- package/src/OutboundServer/api_template/components/schemas/transferParty.yaml +40 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferRequest.yaml +4 -4
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferResponse.yaml +6 -6
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferStatus.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/transferStatusResponse.yaml +1 -1
- package/{OutboundServer → src/OutboundServer}/api_template/health.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/openapi.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/accounts.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/bulkQuotes.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/bulkQuotes_bulkQuoteId.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/bulkTransfers.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/bulkTransfers_bulkTransferId.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/parties_Type_ID.yaml +2 -2
- package/{OutboundServer → src/OutboundServer}/api_template/paths/parties_Type_ID_SubId.yaml +3 -3
- package/{OutboundServer → src/OutboundServer}/api_template/paths/quotes.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/requestToPay.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/requestToPayTransfer.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/requestToPayTransfer_requestToPayTransactionId.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/simpleTransfers.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/transfers.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/api_template/paths/transfers_transferId.yaml +0 -0
- package/{OutboundServer → src/OutboundServer}/handlers.js +0 -0
- package/{OutboundServer → src/OutboundServer}/index.js +0 -0
- package/{OutboundServer → src/OutboundServer}/middlewares.js +0 -0
- package/{TestServer → src/TestServer}/api.yaml +0 -0
- package/{TestServer → src/TestServer}/handlers.js +0 -0
- package/{TestServer → src/TestServer}/index.js +0 -0
- package/{config.js → src/config.js} +0 -0
- package/{index.d.ts → src/index.d.ts} +0 -0
- package/{index.js → src/index.js} +0 -0
- package/{lib → src/lib}/api/index.js +0 -0
- package/{lib → src/lib}/cache.js +0 -0
- package/{lib → src/lib}/check.js +0 -0
- package/{lib → src/lib}/model/AccountsModel.js +0 -0
- package/{lib → src/lib}/model/Async2SyncModel.js +0 -0
- package/{lib → src/lib}/model/InboundTransfersModel.js +0 -0
- package/{lib → src/lib}/model/OutboundBulkQuotesModel.js +0 -0
- package/{lib → src/lib}/model/OutboundBulkTransfersModel.js +0 -0
- package/{lib → src/lib}/model/OutboundRequestToPayModel.js +0 -0
- package/{lib → src/lib}/model/OutboundRequestToPayTransferModel.js +0 -0
- package/{lib → src/lib}/model/OutboundTransfersModel.js +0 -0
- package/{lib → src/lib}/model/PartiesModel.js +0 -0
- package/{lib → src/lib}/model/ProxyModel/MatchRules/Expression.js +0 -0
- package/{lib → src/lib}/model/ProxyModel/MatchRules/Headers.js +0 -0
- package/{lib → src/lib}/model/ProxyModel/MatchRules/MatchRule.js +0 -0
- package/{lib → src/lib}/model/ProxyModel/MatchRules/Path.js +0 -0
- package/{lib → src/lib}/model/ProxyModel/MatchRules/Query.js +0 -0
- package/{lib → src/lib}/model/ProxyModel/MatchRules/index.js +0 -0
- package/{lib → src/lib}/model/ProxyModel/Route.js +0 -0
- package/{lib → src/lib}/model/ProxyModel/configSchema.json +0 -0
- package/{lib → src/lib}/model/ProxyModel/index.js +0 -0
- package/{lib → src/lib}/model/QuotesModel.js +0 -0
- package/{lib → src/lib}/model/TransfersModel.js +0 -0
- package/{lib → src/lib}/model/common/BackendError.js +0 -0
- package/{lib → src/lib}/model/common/PersistentStateMachine.js +0 -0
- package/{lib → src/lib}/model/common/index.js +0 -0
- package/{lib → src/lib}/model/index.js +0 -0
- package/{lib → src/lib}/model/lib/deferredJob.js +0 -0
- package/{lib → src/lib}/model/lib/index.js +0 -0
- package/{lib → src/lib}/model/lib/requests/backendRequests.js +0 -0
- package/{lib → src/lib}/model/lib/requests/common.js +0 -0
- package/{lib → src/lib}/model/lib/requests/index.js +0 -0
- package/{lib → src/lib}/model/lib/shared.js +0 -0
- package/{lib → src/lib}/randomphrase/index.js +0 -0
- package/{lib → src/lib}/randomphrase/words.json +0 -0
- package/{lib → src/lib}/router.js +0 -0
- package/{lib → src/lib}/validate.js +0 -0
- package/test/integration/lib/cache.test.js +3 -3
- package/test/unit/InboundServer.test.js +5 -5
- package/test/unit/TestServer.test.js +5 -5
- package/test/unit/api/utils.js +5 -5
- package/test/unit/config.test.js +10 -10
- package/test/unit/inboundApi/handlers.test.js +6 -6
- package/test/unit/index.test.js +1 -1
- package/test/unit/lib/cache.test.js +1 -1
- package/test/unit/lib/model/AccountsModel.test.js +2 -2
- package/test/unit/lib/model/InboundTransfersModel.test.js +5 -5
- package/test/unit/lib/model/OutboundBulkQuotesModel.test.js +2 -2
- package/test/unit/lib/model/OutboundBulkTransfersModel.test.js +2 -2
- package/test/unit/lib/model/OutboundRequestToPayModel.test.js +3 -3
- package/test/unit/lib/model/OutboundRequestToPayTransferModel.test.js +2 -2
- package/test/unit/lib/model/OutboundTransfersModel.test.js +3 -3
- package/test/unit/lib/model/PartiesModel.test.js +28 -28
- package/test/unit/lib/model/QuotesModel.test.js +31 -31
- package/test/unit/lib/model/TransfersModel.test.js +3 -3
- package/test/unit/lib/model/common/PersistentStateMachine.test.js +13 -13
- package/test/unit/lib/model/mockedLibRequests.js +1 -1
- package/test/unit/outboundApi/handlers.test.js +3 -3
- package/.eslintignore +0 -2
- package/InboundServer/api_template.yaml +0 -69
- package/OAuthTestServer/index.js +0 -66
- package/OutboundServer/api_template/components/schemas/accountCreationStatus.yaml +0 -18
- package/OutboundServer/api_template/components/schemas/accountsRequest.yaml +0 -20
- package/OutboundServer/api_template/components/schemas/extensionListEmptiable.yaml +0 -6
- package/OutboundServer/api_template/components/schemas/individualQuote.yaml +0 -32
- package/OutboundServer/api_template/components/schemas/individualTransfer.yaml +0 -32
- package/OutboundServer/api_template/components/schemas/mojaloopError.yaml +0 -5
- package/OutboundServer/api_template/components/schemas/mojaloopTransactionRequestState.yaml +0 -2
- package/OutboundServer/api_template/components/schemas/quote.yaml +0 -3
- package/OutboundServer/api_template/components/schemas/quotesPostRequest.yaml +0 -13
- package/OutboundServer/api_template/components/schemas/quotesPostResponse.yaml +0 -48
- package/OutboundServer/api_template/components/schemas/requestToPayRequest.yaml +0 -39
- package/OutboundServer/api_template/components/schemas/requestToPayResponse.yaml +0 -41
- package/OutboundServer/api_template/components/schemas/requestToPayTransferRequest.yaml +0 -42
- package/OutboundServer/api_template/components/schemas/simpleTransfersPostRequest.yaml +0 -12
- package/OutboundServer/api_template/components/schemas/transferFulfilment.yaml +0 -3
- package/OutboundServer/api_template/components/schemas/transferParty.yaml +0 -40
package/package.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mojaloop/sdk-scheme-adapter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.2",
|
|
4
4
|
"description": "An adapter for connecting to Mojaloop API enabled switches.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": "
|
|
8
|
+
"node": "=16.x"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"audit:resolve": "SHELL=sh resolve-audit --production",
|
|
12
12
|
"audit:check": "SHELL=sh check-audit --production",
|
|
13
13
|
"build": "npm run build:openapi; npm run build:dto:outbound",
|
|
14
14
|
"build:openapi": "npm run build:openapi:inbound && npm run build:openapi:outbound",
|
|
15
|
-
"build:openapi:inbound": "openapi bundle --output ./InboundServer/api.yaml --ext yaml ./InboundServer/api_template.yaml",
|
|
16
|
-
"build:openapi:outbound": "openapi bundle --output ./OutboundServer/api.yaml --ext yaml ./OutboundServer/api_template/openapi.yaml",
|
|
17
|
-
"build:dto:outbound": "openapi-typescript ./OutboundServer/api.yaml --output ./OutboundServer/api_interfaces/openapi.d.ts",
|
|
18
|
-
"lint": "eslint
|
|
19
|
-
"lint:fix": "eslint
|
|
15
|
+
"build:openapi:inbound": "openapi bundle --output ./src/InboundServer/api.yaml --ext yaml ./src/InboundServer/api_template.yaml",
|
|
16
|
+
"build:openapi:outbound": "openapi bundle --output ./src/OutboundServer/api.yaml --ext yaml ./src/OutboundServer/api_template/openapi.yaml",
|
|
17
|
+
"build:dto:outbound": "openapi-typescript ./src/OutboundServer/api.yaml --output ./src/OutboundServer/api_interfaces/openapi.d.ts",
|
|
18
|
+
"lint": "eslint ./src/",
|
|
19
|
+
"lint:fix": "eslint ./src/ --fix",
|
|
20
20
|
"test": "jest --ci --reporters=default --reporters=jest-junit --env=node test/unit/",
|
|
21
21
|
"test:int": "jest --ci --reporters=default --reporters=jest-junit --env=node test/integration",
|
|
22
22
|
"validate:api": "npm run validate:api:in; npm run validate:api:out",
|
|
23
|
-
"validate:api:in": "swagger-cli validate ./InboundServer/api.yaml",
|
|
24
|
-
"validate:api:out": "swagger-cli validate ./OutboundServer/api.yaml",
|
|
23
|
+
"validate:api:in": "swagger-cli validate ./src/InboundServer/api.yaml",
|
|
24
|
+
"validate:api:out": "swagger-cli validate ./src/OutboundServer/api.yaml",
|
|
25
25
|
"updates:check": "npm run dep:check",
|
|
26
26
|
"updates:update": "npm run dep:update && npm install",
|
|
27
27
|
"dep:check": "npx ncu -e 2",
|
|
@@ -57,19 +57,21 @@
|
|
|
57
57
|
"@mojaloop/central-services-metrics": "11.0.0",
|
|
58
58
|
"@mojaloop/central-services-shared": "14.0.0",
|
|
59
59
|
"@mojaloop/event-sdk": "10.7.1",
|
|
60
|
-
"@mojaloop/sdk-standard-components": "
|
|
60
|
+
"@mojaloop/sdk-standard-components": "^16.0.0",
|
|
61
61
|
"ajv": "8.6.3",
|
|
62
62
|
"ajv-keywords": "5.0.0",
|
|
63
63
|
"axios": "^0.21.4",
|
|
64
64
|
"co-body": "^6.1.0",
|
|
65
65
|
"dotenv": "^10.0.0",
|
|
66
66
|
"env-var": "^7.0.1",
|
|
67
|
+
"express": "^4.17.2",
|
|
67
68
|
"javascript-state-machine": "^3.1.0",
|
|
68
69
|
"js-yaml": "^4.1.0",
|
|
69
70
|
"json-schema-ref-parser": "^9.0.9",
|
|
70
71
|
"koa": "^2.13.1",
|
|
71
72
|
"koa-body": "^4.2.0",
|
|
72
|
-
"
|
|
73
|
+
"module-alias": "^2.2.2",
|
|
74
|
+
"oauth2-server": "^4.0.0-dev.2",
|
|
73
75
|
"openapi-jsonschema-parameters": "^9.3.0",
|
|
74
76
|
"promise-timeout": "^1.3.0",
|
|
75
77
|
"redis": "^3.1.2",
|
|
@@ -79,7 +81,7 @@
|
|
|
79
81
|
"devDependencies": {
|
|
80
82
|
"@babel/core": "^7.15.5",
|
|
81
83
|
"@babel/preset-env": "^7.15.6",
|
|
82
|
-
"@mojaloop/api-snippets": "^13.0.
|
|
84
|
+
"@mojaloop/api-snippets": "^13.0.9",
|
|
83
85
|
"@redocly/openapi-cli": "^1.0.0-beta.59",
|
|
84
86
|
"@types/jest": "^27.0.1",
|
|
85
87
|
"babel-jest": "^27.2.0",
|
|
@@ -90,7 +92,7 @@
|
|
|
90
92
|
"jest": "^27.2.0",
|
|
91
93
|
"jest-junit": "^12.2.0",
|
|
92
94
|
"nock": "^13.1.3",
|
|
93
|
-
"npm-audit-resolver": "^
|
|
95
|
+
"npm-audit-resolver": "^3.0.0-0",
|
|
94
96
|
"npm-check-updates": "^11.8.5",
|
|
95
97
|
"openapi-response-validator": "^9.3.0",
|
|
96
98
|
"openapi-typescript": "^4.0.2",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
-----BEGIN RSA PRIVATE KEY-----
|
|
2
|
+
MIIEowIBAAKCAQEA0eJEh3Op5p6x137lRkAsvmEBbd32dbRChrCUItZbtxjf/qfB
|
|
3
|
+
yD5k8Hn4n4vbqzP8XSGS0f6KmNC+iRaP74HVgzAqc4Uid4J8dtSBq3VmucYQYzLc
|
|
4
|
+
101QjuvD+SKmZwlw/q0PtulmqlASI2SbMfwcAraMi6ab7v5W4EGNeIPLEIo3BXsQ
|
|
5
|
+
DTCWqiZb7aXkHkcY7sOjAzK/2bNGYFmAthdYrHzvCkqnJ7LAHX3Oj7rJea5MqtuN
|
|
6
|
+
B9POZYaD10n9JuYWdwPqLrw6/hVgPSFEy+ulrVbXf54ZH0dfMThAYRvFrT81yulk
|
|
7
|
+
H95JhXWGdi6cTp6t8LVOKFhnNfxjWw0Jayj9xwIDAQABAoIBADB2u/Y/CgNbr5sg
|
|
8
|
+
DRccqHhJdAgHkep59kadrYch0knEL6zg1clERxCUSYmlxNKSjXp/zyQ4T46b3PNQ
|
|
9
|
+
x2m5pDDHxXWpT10jP1Q9G7gYwuCw0IXnb8EzdB+cZ0M28g+myXW1RoSo/nDjTlzn
|
|
10
|
+
1UJEgb9Kocd5cFZOWocr+9vRKumlZULMsA8yiNwlAfJHcMBM7acsa3myCqVhLyWt
|
|
11
|
+
4BQylVuLFa+A6QzpMXEwFCq8EOXf07gl1XVzC6LJ1fTa9gVM3N+YE+oEXKrsHCxG
|
|
12
|
+
/ACgKsjepL27QjJ7qvecWPP0F2LxEZYOm5tbXaKJTobzQUJHgUokanZMhjYprDsZ
|
|
13
|
+
zumLw9kCgYEA/DUWcnLeImlfq/EYdhejkl3J+WX3vhS23OqVgY1amu7CZzaai6vt
|
|
14
|
+
H0TRc8Zsbi4jgmFDU8PFzytP6qz6Tgom4R736z6oBi7bjnGyN17/NSbf+DaRVcM6
|
|
15
|
+
vnZr7jNC2FJlECmIN+dkwUA/YCr2SA7hxZXM9mIYSc+6+glDiIO5Cf0CgYEA1Qo/
|
|
16
|
+
uQbVHhW+Cp8H0kdMuhwUbkBquRrxRZlXS1Vrf3f9me9JLUy9UPWb3y3sKVurG5+O
|
|
17
|
+
SIlr4hDcZyXdE198MtDMhBIGqU9ORSjppJDNDVvtt+n2FD4XmWIU70vKBJBivX0+
|
|
18
|
+
Bow6yduis+p12fuvpvpnKCz8UjOgOQJhLZ4GQBMCgYBP6gpozVjxkm4ML2LO2IKt
|
|
19
|
+
+CXtbo/nnOysZ3BkEoQpH4pd5gFmTF3gUJAFnVPyPZBm2abZvejJ0jGKbLELVVAo
|
|
20
|
+
eQWZdssK2oIbSo9r2CAJmX3SSogWorvUafWdDoUZwlHfoylUfW+BhHgQYsyS3JRR
|
|
21
|
+
ZTwCveZwTPA0FgdeFE7niQKBgQCHaD8+ZFhbCejDqXb4MXdUJ3rY5Lqwsq491YwF
|
|
22
|
+
huKPn32iNNQnJcqCxclv3iln1Cr6oLx34Fig1KSyLv/IS32OcuY635Y6UPznumxe
|
|
23
|
+
u+aJIjADIILXNOwdAplZy6s4oWkRFaSx1rmbCa3tew2zImTv1eJxR76MpOGmupt3
|
|
24
|
+
uiQw3wKBgFjBT/aVKdBeHeP1rIHHldQV5QQxZNkc6D3qn/oAFcwpj9vcGfRjQWjO
|
|
25
|
+
ARzXM2vUWEet4OVn3DXyOdaWFR1ppehz7rAWBiPgsMg4fjAusYb9Mft1GMxMzuwT
|
|
26
|
+
Oyqsp6pzAWFrCD3JAoTLxClV+j5m+SXZ/ItD6ziGpl/h7DyayrFZ
|
|
27
|
+
-----END RSA PRIVATE KEY-----
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-----BEGIN PUBLIC KEY-----
|
|
2
|
+
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0eJEh3Op5p6x137lRkAs
|
|
3
|
+
vmEBbd32dbRChrCUItZbtxjf/qfByD5k8Hn4n4vbqzP8XSGS0f6KmNC+iRaP74HV
|
|
4
|
+
gzAqc4Uid4J8dtSBq3VmucYQYzLc101QjuvD+SKmZwlw/q0PtulmqlASI2SbMfwc
|
|
5
|
+
AraMi6ab7v5W4EGNeIPLEIo3BXsQDTCWqiZb7aXkHkcY7sOjAzK/2bNGYFmAthdY
|
|
6
|
+
rHzvCkqnJ7LAHX3Oj7rJea5MqtuNB9POZYaD10n9JuYWdwPqLrw6/hVgPSFEy+ul
|
|
7
|
+
rVbXf54ZH0dfMThAYRvFrT81yulkH95JhXWGdi6cTp6t8LVOKFhnNfxjWw0Jayj9
|
|
8
|
+
xwIDAQAB
|
|
9
|
+
-----END PUBLIC KEY-----
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-----BEGIN PUBLIC KEY-----
|
|
2
|
+
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvs6EjaQYxTPI2dS+L6zJ
|
|
3
|
+
QhszHCP79huvCDPhy/BmTWI4350rjWiclBC/joy7BUGJszIVv6rrwbeN9OORHXwW
|
|
4
|
+
0XSjcCEeksdkAee9kGvx/A2UcUOsQQ3A3IvoxJAv+HJSmCGeKsc2pMrelBtma54i
|
|
5
|
+
1JBF6H+SwrcM0a+UVsADQXOzKuyiRYnkCEhZYHXAk7hM3cARvhYydqUnPehFccjS
|
|
6
|
+
8v6sNTRZnqJ7z/XT3EKYkfizcCkHiV9elB/PGGzkFWLjHZVTC/+hK6WhFYGEktNb
|
|
7
|
+
QfDuMA4mnZT37QZEL1PlhnFfjfnrnpjFjcFzKJ+hHRrHqA9FZlo6J9efnUn/VHVC
|
|
8
|
+
sQIDAQAB
|
|
9
|
+
-----END PUBLIC KEY-----
|
package/sequences.puml
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
@startuml
|
|
4
|
+
title Mojaloop SDK Interactions
|
|
5
|
+
autonumber
|
|
6
|
+
|
|
7
|
+
participant "DFSP Backend" as backend
|
|
8
|
+
participant "ESB/PortX" as esb
|
|
9
|
+
|
|
10
|
+
box "SDK"
|
|
11
|
+
participant "SDK Inbound Service" as sib
|
|
12
|
+
participant "SDK Outbound Service" as sob
|
|
13
|
+
end box
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
participant "Switch" as sw
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
note over sib, sob: All outbound between SDK and Switch have\nJWS added automatically
|
|
20
|
+
note over sib, sob: All inbound from switch have JWS validated
|
|
21
|
+
|
|
22
|
+
note over sib, sob: Mapping between scheme transaction types and DFSP\ntransaction types
|
|
23
|
+
note over sib, sob: JWS and TLS keys managed by SDK
|
|
24
|
+
|
|
25
|
+
== send money ==
|
|
26
|
+
|
|
27
|
+
backend -> sob: POST /transfers
|
|
28
|
+
|
|
29
|
+
sob -> sw: GET /parties
|
|
30
|
+
sw -> sob: PUT /parties
|
|
31
|
+
sob -> sw: POST /quotes
|
|
32
|
+
sw -> sob: PUT /quotes
|
|
33
|
+
sob -> sw: POST /transfers
|
|
34
|
+
sw -> sob: PUT /transfers
|
|
35
|
+
|
|
36
|
+
sob -> backend: HTTP 200
|
|
37
|
+
|
|
38
|
+
== query transfer ==
|
|
39
|
+
|
|
40
|
+
backend -> sob: GET /transfers/{ID}
|
|
41
|
+
sob -> sw: GET /transfers/{ID}
|
|
42
|
+
sw -> sob: PUT /transfers/{ID}
|
|
43
|
+
sob -> backend: transfer info
|
|
44
|
+
|
|
45
|
+
== receive money ==
|
|
46
|
+
|
|
47
|
+
sw -> sib: GET /parties
|
|
48
|
+
sib -> esb: GET /parties
|
|
49
|
+
esb -> backend: lookup user account
|
|
50
|
+
backend -> esb: user details
|
|
51
|
+
esb -> sib: user details
|
|
52
|
+
sib -> sw: PUT /parties
|
|
53
|
+
|
|
54
|
+
sw -> sib: POST /quotes
|
|
55
|
+
|
|
56
|
+
alt SDK handles quote request autonomously
|
|
57
|
+
|
|
58
|
+
sib -> sib: calculate quote
|
|
59
|
+
|
|
60
|
+
else backend calculates quote
|
|
61
|
+
|
|
62
|
+
sib -> esb: POST /quotes
|
|
63
|
+
esb -> backend: quote request
|
|
64
|
+
backend -> esb: quote response
|
|
65
|
+
esb -> sib: quote response
|
|
66
|
+
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
sib -> sib: create ILP packet\ncalculate condition
|
|
70
|
+
|
|
71
|
+
sib -> sw: PUT /quotes
|
|
72
|
+
|
|
73
|
+
sw -> sib: POST /transfers
|
|
74
|
+
sib -> sib: validate ILP
|
|
75
|
+
sib -> esb: POST /transfers
|
|
76
|
+
esb -> backend: accept money?
|
|
77
|
+
|
|
78
|
+
alt accepting money
|
|
79
|
+
|
|
80
|
+
backend -> esb: OK
|
|
81
|
+
esb -> sib: OK
|
|
82
|
+
sib -> sib: calculate ILP fulfilment
|
|
83
|
+
sib -> sw: PUT /transfers
|
|
84
|
+
|
|
85
|
+
sw -> sib: OK notification
|
|
86
|
+
sib -> esb: OK notification
|
|
87
|
+
esb -> backend: money received OK
|
|
88
|
+
|
|
89
|
+
else not accepting money
|
|
90
|
+
|
|
91
|
+
backend -> esb: NOK
|
|
92
|
+
esb -> sib: NOK
|
|
93
|
+
sib -> sw: PUT /transfers/{ID}/error
|
|
94
|
+
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
@enduml
|
|
99
|
+
|
|
File without changes
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
openapi: 3.0.0
|
|
2
|
+
info:
|
|
3
|
+
version: '1.1'
|
|
4
|
+
title: Open API for FSP Interoperability (FSPIOP)
|
|
5
|
+
description: >-
|
|
6
|
+
Based on API Definition.docx updated on 2020-05-19 Version 1.1.
|
|
7
|
+
API supports a maximum size of 65536 bytes (64 Kilobytes) in the HTTP
|
|
8
|
+
header.
|
|
9
|
+
license:
|
|
10
|
+
name: Open API for FSP Interoperability (FSPIOP)
|
|
11
|
+
paths:
|
|
12
|
+
'/participants/{ID}/error':
|
|
13
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_ID_error.yaml'
|
|
14
|
+
'/participants/{ID}':
|
|
15
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_ID.yaml'
|
|
16
|
+
'/participants/{Type}/{ID}/error':
|
|
17
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_Type_ID_error.yaml'
|
|
18
|
+
'/participants/{Type}/{ID}/{SubId}/error':
|
|
19
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_Type_ID_SubId_error.yaml'
|
|
20
|
+
'/participants/{Type}/{ID}/{SubId}':
|
|
21
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_Type_ID_SubId.yaml'
|
|
22
|
+
'/participants/{Type}/{ID}':
|
|
23
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants_Type_ID.yaml'
|
|
24
|
+
'/participants':
|
|
25
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/participants.yaml'
|
|
26
|
+
'/parties/{Type}/{ID}':
|
|
27
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/parties_Type_ID.yaml'
|
|
28
|
+
'/parties/{Type}/{ID}/error':
|
|
29
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/parties_Type_ID_error.yaml'
|
|
30
|
+
'/parties/{Type}/{ID}/{SubId}':
|
|
31
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/parties_Type_ID_SubId.yaml'
|
|
32
|
+
'/parties/{Type}/{ID}/{SubId}/error':
|
|
33
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/parties_Type_ID_SubId_error.yaml'
|
|
34
|
+
'/transactionRequests/{ID}/error':
|
|
35
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transactionRequests_ID_error.yaml'
|
|
36
|
+
'/transactionRequests/{ID}':
|
|
37
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transactionRequests_ID.yaml'
|
|
38
|
+
'/transactionRequests':
|
|
39
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transactionRequests.yaml'
|
|
40
|
+
'/quotes/{ID}/error':
|
|
41
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/quotes_ID_error.yaml'
|
|
42
|
+
'/quotes/{ID}':
|
|
43
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/quotes_ID.yaml'
|
|
44
|
+
'/quotes':
|
|
45
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/quotes.yaml'
|
|
46
|
+
'/authorizations/{ID}':
|
|
47
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/authorizations_ID.yaml'
|
|
48
|
+
'/authorizations/{ID}/error':
|
|
49
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/authorizations_ID_error.yaml'
|
|
50
|
+
'/transfers/{ID}/error':
|
|
51
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transfers_ID_error.yaml'
|
|
52
|
+
'/transfers/{ID}':
|
|
53
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transfers_ID.yaml'
|
|
54
|
+
'/transfers':
|
|
55
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transfers.yaml'
|
|
56
|
+
'/transactions/{ID}':
|
|
57
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transactions_ID.yaml'
|
|
58
|
+
'/transactions/{ID}/error':
|
|
59
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/transactions_ID_error.yaml'
|
|
60
|
+
'/bulkQuotes/{ID}/error':
|
|
61
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/bulkQuotes_ID_error.yaml'
|
|
62
|
+
'/bulkQuotes/{ID}':
|
|
63
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/bulkQuotes_ID.yaml'
|
|
64
|
+
'/bulkTransfers/{ID}':
|
|
65
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/bulkTransfers_ID.yaml'
|
|
66
|
+
'/bulkTransfers':
|
|
67
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/bulkTransfers.yaml'
|
|
68
|
+
'/bulkTransfers/{ID}/error':
|
|
69
|
+
$ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/paths/bulkTransfers_ID_error.yaml'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**************************************************************************
|
|
2
|
+
* (C) Copyright ModusBox Inc. 2019 - All rights reserved. *
|
|
3
|
+
* *
|
|
4
|
+
* This file is made available under the terms of the license agreement *
|
|
5
|
+
* specified in the corresponding source code repository. *
|
|
6
|
+
* *
|
|
7
|
+
* ORIGINAL AUTHOR: *
|
|
8
|
+
* Yevhen Kyriukha - yevhen.kyriukha@modusbox.com *
|
|
9
|
+
**************************************************************************/
|
|
10
|
+
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
const { assert } = require('assert');
|
|
14
|
+
const express = require('express');
|
|
15
|
+
const bodyParser = require('body-parser');
|
|
16
|
+
const OAuth2Server = require('oauth2-server');
|
|
17
|
+
const { InMemoryCache } = require('./model');
|
|
18
|
+
const {Request, Response} = require('oauth2-server');
|
|
19
|
+
const UnauthorizedRequestError = require('oauth2-server/lib/errors/unauthorized-request-error');
|
|
20
|
+
|
|
21
|
+
class OAuthTestServer {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param {Object} conf
|
|
25
|
+
* @param {number} conf.port OAuth server listen port
|
|
26
|
+
* @param {string} conf.clientKey Customer Key
|
|
27
|
+
* @param {String} conf.clientSecret Customer Secret
|
|
28
|
+
* @param {Logger} conf.logger Logger
|
|
29
|
+
*/
|
|
30
|
+
constructor({ port, clientKey, clientSecret, logger }) {
|
|
31
|
+
this._api = null;
|
|
32
|
+
this._port = port;
|
|
33
|
+
this._logger = logger;
|
|
34
|
+
this._clientKey = clientKey;
|
|
35
|
+
this._clientSecret = clientSecret;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async start() {
|
|
39
|
+
if (this._app) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this._app = express();
|
|
43
|
+
|
|
44
|
+
this._oauth = new OAuth2Server({
|
|
45
|
+
model: new InMemoryCache({ clientKey: this._clientKey, clientSecret:this._clientSecret }),
|
|
46
|
+
accessTokenLifetime: 60 * 60,
|
|
47
|
+
allowBearerTokensInQueryString: true,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
this._app.use(bodyParser.urlencoded({ extended: false }));
|
|
51
|
+
this._app.use(bodyParser.json());
|
|
52
|
+
this._app.use(this.tokenMiddleware());
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
await new Promise((resolve) => this._app.listen(this._port, resolve));
|
|
56
|
+
this._logger.push({ port: this._port }).log('Serving OAuth2 Test Server');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async stop() {
|
|
60
|
+
if (!this._app) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
await new Promise(resolve => this._app.close(resolve));
|
|
64
|
+
this._app = null;
|
|
65
|
+
this._logger.log('OAuth2 Test Server shut down complete');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async reconfigure({ port, clientKey, clientSecret, logger }) {
|
|
69
|
+
assert(port === this._port, 'Cannot reconfigure running port');
|
|
70
|
+
return () => {
|
|
71
|
+
this._port = port;
|
|
72
|
+
this._logger = logger;
|
|
73
|
+
this.stop().then(() => this.start());
|
|
74
|
+
this._api = OAuthTestServer._SetupApi({ clientKey, clientSecret });
|
|
75
|
+
this._logger.log('restarted');
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
handleResponse(req, res, response) {
|
|
80
|
+
if (response.status === 302) {
|
|
81
|
+
const location = response.headers.location;
|
|
82
|
+
delete response.headers.location;
|
|
83
|
+
res.set(response.headers);
|
|
84
|
+
res.redirect(location);
|
|
85
|
+
} else {
|
|
86
|
+
res.set(response.headers);
|
|
87
|
+
res.status(response.status).send(response.body);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
handleError(e, req, res, response) {
|
|
92
|
+
if (response) {
|
|
93
|
+
res.set(response.headers);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
res.status(e.code);
|
|
97
|
+
|
|
98
|
+
if (e instanceof UnauthorizedRequestError) {
|
|
99
|
+
return res.send();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
res.send({ error: e.name, error_description: e.message });
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
tokenMiddleware(options) {
|
|
106
|
+
return async (req, res, next) => {
|
|
107
|
+
const request = new Request(req);
|
|
108
|
+
const response = new Response(res);
|
|
109
|
+
|
|
110
|
+
let token;
|
|
111
|
+
|
|
112
|
+
try {
|
|
113
|
+
token = await this._oauth.token(request, response, options);
|
|
114
|
+
res.locals.oauth = {token};
|
|
115
|
+
} catch (e) {
|
|
116
|
+
await this.handleError(e, req, res, response, next);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
await this.handleResponse(req, res, response);
|
|
121
|
+
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
module.exports = OAuthTestServer;
|
|
File without changes
|
|
File without changes
|
|
@@ -83,9 +83,6 @@ export declare namespace Schemas {
|
|
|
83
83
|
type accountsCreationState = components['schemas']['accountsCreationState'];
|
|
84
84
|
type accountsResponse = components['schemas']['accountsResponse'];
|
|
85
85
|
type errorAccountsResponse = components['schemas']['errorAccountsResponse'];
|
|
86
|
-
type AccountAddress = components['schemas']['AccountAddress'];
|
|
87
|
-
type Account = components['schemas']['Account'];
|
|
88
|
-
type AccountList = components['schemas']['AccountList'];
|
|
89
86
|
type PartyIdInfo = components['schemas']['PartyIdInfo'];
|
|
90
87
|
type PartyName = components['schemas']['PartyName'];
|
|
91
88
|
type PartyComplexName = components['schemas']['PartyComplexName'];
|
|
@@ -101,17 +98,4 @@ export declare namespace Schemas {
|
|
|
101
98
|
type simpleTransfersPostRequest = components['schemas']['simpleTransfersPostRequest'];
|
|
102
99
|
type simpleTransfersPostResponse = components['schemas']['simpleTransfersPostResponse'];
|
|
103
100
|
type errorSimpleTransfersResponse = components['schemas']['errorSimpleTransfersResponse'];
|
|
104
|
-
|
|
105
|
-
type Integer = components['schemas']['Integer'];
|
|
106
|
-
type AuthorizationsPostRequest = components['schemas']['AuthorizationsPostRequest'];
|
|
107
|
-
type authorizationsPostRequest = components['schemas']['authorizationsPostRequest'];
|
|
108
|
-
type OtpValue = components['schemas']['OtpValue'];
|
|
109
|
-
type QRCODE = components['schemas']['QRCODE'];
|
|
110
|
-
type U2FPIN = components['schemas']['U2FPIN'];
|
|
111
|
-
type U2FPinValue = components['schemas']['U2FPinValue'];
|
|
112
|
-
type AuthenticationValue = components['schemas']['AuthenticationValue'];
|
|
113
|
-
type AuthenticationInfo = components['schemas']['AuthenticationInfo'];
|
|
114
|
-
type AuthorizationResponseType = components['schemas']['AuthorizationResponseType'];
|
|
115
|
-
type authorizationsPostResponse = components['schemas']['authorizationsPostResponse'];
|
|
116
|
-
type errorAuthorizationsResponse = components['schemas']['errorAuthorizationsResponse'];
|
|
117
|
-
}
|
|
101
|
+
}
|
|
File without changes
|
package/{OutboundServer → src/OutboundServer}/api_template/components/parameters/bulkQuoteId.yaml
RENAMED
|
@@ -3,7 +3,7 @@ in: path
|
|
|
3
3
|
required: true
|
|
4
4
|
schema:
|
|
5
5
|
$ref: >-
|
|
6
|
-
|
|
6
|
+
../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml
|
|
7
7
|
description: >-
|
|
8
8
|
Identifier of the bulk transfer to continue as returned in the response to a
|
|
9
9
|
`POST /bulkTransfers` request.
|
package/{OutboundServer → src/OutboundServer}/api_template/components/parameters/bulkTransferId.yaml
RENAMED
|
@@ -3,7 +3,7 @@ in: path
|
|
|
3
3
|
required: true
|
|
4
4
|
schema:
|
|
5
5
|
$ref: >-
|
|
6
|
-
|
|
6
|
+
../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml
|
|
7
7
|
description: >-
|
|
8
8
|
Identifier of the bulk transfer to continue as returned in the response to a
|
|
9
9
|
`POST /bulkTransfers` request.
|
|
@@ -3,7 +3,7 @@ in: path
|
|
|
3
3
|
required: true
|
|
4
4
|
schema:
|
|
5
5
|
$ref: >-
|
|
6
|
-
|
|
6
|
+
../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml
|
|
7
7
|
description: >-
|
|
8
8
|
Identifier of the merchant request to pay transfer to continue as returned in
|
|
9
9
|
the response to a `POST /requestToPayTransfer` request.
|
package/{OutboundServer → src/OutboundServer}/api_template/components/parameters/transferId.yaml
RENAMED
|
@@ -3,7 +3,7 @@ in: path
|
|
|
3
3
|
required: true
|
|
4
4
|
schema:
|
|
5
5
|
$ref: >-
|
|
6
|
-
|
|
6
|
+
../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml
|
|
7
7
|
description: >-
|
|
8
8
|
Identifier of the transfer to continue as returned in the response to a `POST
|
|
9
9
|
/transfers` request.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -6,4 +6,4 @@ content:
|
|
|
6
6
|
properties:
|
|
7
7
|
errorInformation:
|
|
8
8
|
$ref: >-
|
|
9
|
-
|
|
9
|
+
../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/ErrorInformation.yaml
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/{OutboundServer → src/OutboundServer}/api_template/components/responses/transferSuccess.yaml
RENAMED
|
File without changes
|
package/{OutboundServer → src/OutboundServer}/api_template/components/responses/transferTimeout.yaml
RENAMED
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type: array
|
|
2
|
+
items:
|
|
3
|
+
type: object
|
|
4
|
+
required:
|
|
5
|
+
- idType
|
|
6
|
+
- idValue
|
|
7
|
+
properties:
|
|
8
|
+
idType:
|
|
9
|
+
$ref: >-
|
|
10
|
+
../../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/PartyIdType.yaml
|
|
11
|
+
idValue:
|
|
12
|
+
$ref: >-
|
|
13
|
+
../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartyIdentifier.yaml
|
|
14
|
+
idSubValue:
|
|
15
|
+
$ref: >-
|
|
16
|
+
../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartySubIdOrType.yaml
|
|
17
|
+
error:
|
|
18
|
+
$ref: ./errorResponse.yaml
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type: array
|
|
2
|
+
items:
|
|
3
|
+
type: object
|
|
4
|
+
required:
|
|
5
|
+
- idType
|
|
6
|
+
- idValue
|
|
7
|
+
- currency
|
|
8
|
+
properties:
|
|
9
|
+
idType:
|
|
10
|
+
$ref: >-
|
|
11
|
+
../../../../../node_modules/@mojaloop/api-snippets/thirdparty/v1_0/openapi3/components/schemas/PartyIdType.yaml
|
|
12
|
+
idValue:
|
|
13
|
+
$ref: >-
|
|
14
|
+
../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartyIdentifier.yaml
|
|
15
|
+
idSubValue:
|
|
16
|
+
$ref: >-
|
|
17
|
+
../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/PartySubIdOrType.yaml
|
|
18
|
+
currency:
|
|
19
|
+
$ref: >-
|
|
20
|
+
../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/Currency.yaml
|
package/{OutboundServer → src/OutboundServer}/api_template/components/schemas/accountsResponse.yaml
RENAMED
|
@@ -4,7 +4,7 @@ required:
|
|
|
4
4
|
properties:
|
|
5
5
|
modelId:
|
|
6
6
|
$ref: >-
|
|
7
|
-
|
|
7
|
+
../../../../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/schemas/CorrelationId.yaml
|
|
8
8
|
accounts:
|
|
9
9
|
$ref: ./accountsRequest.yaml
|
|
10
10
|
response:
|
|
File without changes
|
|
File without changes
|