ml-testing-toolkit 18.13.0
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/.dockerignore +10 -0
- package/.grype.yaml +16 -0
- package/.ncurc.yaml +9 -0
- package/.nvmrc +1 -0
- package/.versionrc.js +16 -0
- package/CHANGELOG.md +504 -0
- package/CODEOWNERS +30 -0
- package/Dockerfile +42 -0
- package/Dockerfile-newman +13 -0
- package/LICENSE.md +9 -0
- package/README.md +119 -0
- package/assets/diagrams/architectural/architectural-diagram.svg +3 -0
- package/assets/diagrams/flow/flow-diagram.svg +3 -0
- package/assets/images/Sample-Response-Failure.png +0 -0
- package/assets/images/Screenshot 2020-04-16 at 22.58.04.png +0 -0
- package/assets/images/TLS-Enabled-on-Environment.png +0 -0
- package/assets/images/adapter-mutual-tls-enabled.png +0 -0
- package/assets/images/add-additional-input-values.png +0 -0
- package/assets/images/add-condition-button.png +0 -0
- package/assets/images/add-new-assertion.png +0 -0
- package/assets/images/add-new-input-value.png +0 -0
- package/assets/images/add-new-input-variable.png +0 -0
- package/assets/images/additional-transfers.png +0 -0
- package/assets/images/api-provisioning-add-new-api-confirmation.png +0 -0
- package/assets/images/api-provisioning-file-input-window.png +0 -0
- package/assets/images/api-provisioning-list-apis-view.png +0 -0
- package/assets/images/api-provisioning-menu-item.png +0 -0
- package/assets/images/apply_and_restart.jpg +0 -0
- package/assets/images/assess-request-or-response.png +0 -0
- package/assets/images/assess-response-equation-save.png +0 -0
- package/assets/images/assess-response-equation.png +0 -0
- package/assets/images/assess-response-status.png +0 -0
- package/assets/images/building-new-rules-file.png +0 -0
- package/assets/images/callback-rules-screen.png +0 -0
- package/assets/images/configurable-parameter-assertion.png +0 -0
- package/assets/images/configurable-parameter-currency.png +0 -0
- package/assets/images/configurable-parameter.png +0 -0
- package/assets/images/connection-manager-ui-opening.png +0 -0
- package/assets/images/create-inbound-user-simulator.png +0 -0
- package/assets/images/creating-new-rule-file.png +0 -0
- package/assets/images/dfsp-client-cacert.png +0 -0
- package/assets/images/dfsp-client-submit.png +0 -0
- package/assets/images/dfsp-client.png +0 -0
- package/assets/images/dfsp-p2p-happy-path.png +0 -0
- package/assets/images/dfsp-server-cacert.png +0 -0
- package/assets/images/dfsp-server-cert.png +0 -0
- package/assets/images/download-report.png +0 -0
- package/assets/images/drive_have_not_been_shared.jpg +0 -0
- package/assets/images/event-response-options.png +0 -0
- package/assets/images/expand-monitoring-messages.png +0 -0
- package/assets/images/fixed-response-sample.png +0 -0
- package/assets/images/header-selection.png +0 -0
- package/assets/images/heap_error_windows.jpg +0 -0
- package/assets/images/hosted-mode-docker-compose-intro.png +0 -0
- package/assets/images/hub-client-cert.png +0 -0
- package/assets/images/import-template.png +0 -0
- package/assets/images/inbound-requests-environment.png +0 -0
- package/assets/images/inbound-requests-scripts.png +0 -0
- package/assets/images/jws-certificate-submit.png +0 -0
- package/assets/images/jws-certificate.png +0 -0
- package/assets/images/jws-certs-keys.png +0 -0
- package/assets/images/jws-hub-certs-keys.png +0 -0
- package/assets/images/local-enable-jws-publickey.png +0 -0
- package/assets/images/local-mutual-tls-enabled.png +0 -0
- package/assets/images/local_drives_to_be_available.jpg +0 -0
- package/assets/images/mcm-environment-opening.png +0 -0
- package/assets/images/menu-items.png +0 -0
- package/assets/images/mock-response-sample.png +0 -0
- package/assets/images/monitoring-initial-state.png +0 -0
- package/assets/images/monitoring-messages.png +0 -0
- package/assets/images/new-empty-assertion.png +0 -0
- package/assets/images/opened-imported-template.png +0 -0
- package/assets/images/opening-default-settings.png +0 -0
- package/assets/images/opening-sync-response-rules.png +0 -0
- package/assets/images/opening-view.png +0 -0
- package/assets/images/outbound-display-opening-hub.png +0 -0
- package/assets/images/outbound-display-opening.png +0 -0
- package/assets/images/override-with-environment-variable.png +0 -0
- package/assets/images/populate-with-sample-body.png +0 -0
- package/assets/images/resource-selection.png +0 -0
- package/assets/images/rule-builder-select-api.png +0 -0
- package/assets/images/sample-condition-add-configurable-params.png +0 -0
- package/assets/images/sample-condition.png +0 -0
- package/assets/images/sample-editor.png +0 -0
- package/assets/images/sample-request.png +0 -0
- package/assets/images/sample-test-assertion.png +0 -0
- package/assets/images/send-transfer.png +0 -0
- package/assets/images/sending-single-test-case-1.png +0 -0
- package/assets/images/sending-single-test-case-2.png +0 -0
- package/assets/images/sending-test-cases.png +0 -0
- package/assets/images/server-certificates-submitted.png +0 -0
- package/assets/images/simulator-response.png +0 -0
- package/assets/images/simulator-scheme-adapter-endpoint.png +0 -0
- package/assets/images/summarized-view-of-rule.png +0 -0
- package/assets/images/template-window.png +0 -0
- package/assets/images/test-case-editor-console-log.png +0 -0
- package/assets/images/test-case-editor-environment-state.png +0 -0
- package/assets/images/test-case-editor-scripts.png +0 -0
- package/assets/images/test-case-editor.png +0 -0
- package/assets/images/testcase-definition-download.png +0 -0
- package/assets/images/testcase-definition-edit-meta-info.png +0 -0
- package/assets/images/testing-toolkit-mojaloop-testing-toolkit-endpoint.png +0 -0
- package/assets/images/tls-hub-certs-keys.png +0 -0
- package/assets/images/tls-jws-enabled-on-environment.png +0 -0
- package/assets/images/updated-sample-body-data.png +0 -0
- package/assets/images/using-configurable-parameter.png +0 -0
- package/assets/images/validation-rules-screen.png +0 -0
- package/assets/images/view-response.png +0 -0
- package/audit-ci.jsonc +7 -0
- package/connection-manager/docker-compose.yml +55 -0
- package/database/docker-compose.yml +16 -0
- package/docker/hosted-mode/docker-compose.yaml +107 -0
- package/docker/hosted-mode/keycloak/keycloak-realm.json +2298 -0
- package/docker/hosted-mode/mongo-init.sh +1 -0
- package/docker/hosted-mode-tls/docker-compose.yaml +171 -0
- package/docker/hosted-mode-tls/keycloak/keycloak-realm.json +2298 -0
- package/docker/hosted-mode-tls/mongo-init.sh +1 -0
- package/docker-compose.yml +62 -0
- package/documents/Mojaloop-Testing-Toolkit.md +296 -0
- package/documents/RULES_ENGINE.md +403 -0
- package/documents/User-Guide-API-Provisioning.md +121 -0
- package/documents/User-Guide-CLI.md +218 -0
- package/documents/User-Guide-Connection-Manager.md +282 -0
- package/documents/User-Guide-Frequently-Asked-Questions.md +39 -0
- package/documents/User-Guide-Hosted-Mode-Docker-Compose.md +110 -0
- package/documents/User-Guide-Installation.md +163 -0
- package/documents/User-Guide-Mojaloop-Testing-Toolkit.md +642 -0
- package/documents/User-Guide-OAuth-Server-Deployment.md +283 -0
- package/documents/User-Guide-Onboarding-DFSP.md +197 -0
- package/documents/User-Guide-Onboarding-HUB.md +191 -0
- package/documents/User-Guide.md +53 -0
- package/examples/collections/dfsp/p2p_failed_tests.json +7161 -0
- package/examples/collections/dfsp/p2p_fx_happy_path.json +502 -0
- package/examples/collections/dfsp/p2p_happy_path.json +350 -0
- package/examples/collections/dfsp/p2p_happy_path_extended.json +6106 -0
- package/examples/collections/dfsp/p2p_happy_path_jws.json +511 -0
- package/examples/collections/dfsp/p2p_payee_assertions_websocket.json +441 -0
- package/examples/collections/dfsp/sample.json +5029 -0
- package/examples/collections/dfsp/transaction_request_service.json +240 -0
- package/examples/collections/fxp/FXP.json +264 -0
- package/examples/collections/fxp/SDK_backend.json +98 -0
- package/examples/collections/fxp/SDK_outbound.json +163 -0
- package/examples/collections/hub/hub_01_p2p_happy_path/hub_p2p_receive_quote.json +400 -0
- package/examples/collections/hub/hub_01_p2p_happy_path/hub_p2p_send_quote.json +395 -0
- package/examples/collections/hub/hub_02_block_transfer/hub_block_transfer.json +393 -0
- package/examples/collections/hub/hub_03_funds_in_out/hub_funds_in.json +224 -0
- package/examples/collections/hub/hub_03_funds_in_out/hub_funds_out.json +780 -0
- package/examples/collections/hub/hub_04_settlements/hub_settlements.json +3138 -0
- package/examples/collections/hub/hub_05_transfer_negative_scenarios/hub_transfer_negative_payee_abort.json +475 -0
- package/examples/collections/hub/hub_05_transfer_negative_scenarios/hub_transfer_negative_payee_invalid_fulfillment.json +370 -0
- package/examples/collections/hub/hub_05_transfer_negative_scenarios/hub_transfer_negative_transfer_timeout.json +262 -0
- package/examples/collections/hub/hub_06_transaction_requests_service/hub_trs_authorizations.json +117 -0
- package/examples/collections/hub/hub_06_transaction_requests_service/hub_trs_error_framework.json +591 -0
- package/examples/collections/hub/hub_06_transaction_requests_service/hub_trs_received_state.json +379 -0
- package/examples/collections/hub/hub_06_transaction_requests_service/hub_trs_reject_state.json +361 -0
- package/examples/collections/hub/hub_07_quoting_service.json +525 -0
- package/examples/collections/hub/hub_08_participant_inactive_stop_transfers.json +706 -0
- package/examples/collections/hub/hub_09_duplicate_handling_transfers.json +1377 -0
- package/examples/collections/hub/hub_10_on_us_transfers.json +245 -0
- package/examples/collections/hub/hub_11_accented_and_spl_chars.json +629 -0
- package/examples/collections/hub/hub_12_fspiop_version_1.1.json +646 -0
- package/examples/collections/hub/hub_13_bulk_transfers.json +1857 -0
- package/examples/collections/iso20022/self_referencing_iso20022.json +926 -0
- package/examples/collections/provisioning/testingtoolkitdfsp.json +904 -0
- package/examples/environments/dfsp_local_environment.json +46 -0
- package/examples/environments/hub_local_environment.json +57 -0
- package/jest.config.js +17 -0
- package/package.json +199 -0
- package/sbom-v18.12.4.csv +1553 -0
- package/secrets/keygen.sh +5 -0
- package/secrets/privatekey.pem +27 -0
- package/secrets/publickey.cer +21 -0
- package/secrets/tls/01.pem +132 -0
- package/secrets/tls/createSecrets.sh +20 -0
- package/secrets/tls/hub_client.csr +32 -0
- package/secrets/tls/hub_client_cacert.pem +35 -0
- package/secrets/tls/hub_client_cakey.pem +52 -0
- package/secrets/tls/hub_client_key.key +52 -0
- package/secrets/tls/hub_server.csr +31 -0
- package/secrets/tls/hub_server_cacert.pem +35 -0
- package/secrets/tls/hub_server_cakey.pem +52 -0
- package/secrets/tls/hub_server_cert.pem +132 -0
- package/secrets/tls/hub_server_key.key +52 -0
- package/secrets/tls/index.txt +1 -0
- package/secrets/tls/index.txt.attr +1 -0
- package/secrets/tls/openssl-client.cnf +36 -0
- package/secrets/tls/openssl-clientca.cnf +71 -0
- package/secrets/tls/openssl-server.cnf +39 -0
- package/secrets/tls/openssl-serverca.cnf +71 -0
- package/secrets/tls/serial.txt +1 -0
- package/spec_files/api_definitions/als_admin_1.1/api_spec.yaml +804 -0
- package/spec_files/api_definitions/central_admin_1.0/api_spec.yaml +1850 -0
- package/spec_files/api_definitions/central_admin_1.0/response_map.json +96 -0
- package/spec_files/api_definitions/central_admin_old_9.3/api_spec.yaml +2467 -0
- package/spec_files/api_definitions/central_admin_old_9.3/response_map.json +96 -0
- package/spec_files/api_definitions/fspiop_1.0/api_spec.yaml +4187 -0
- package/spec_files/api_definitions/fspiop_1.0/callback_map.json +568 -0
- package/spec_files/api_definitions/fspiop_1.0/mockRef.json +79 -0
- package/spec_files/api_definitions/fspiop_1.0/trigger_templates/transaction_request_followup.json +126 -0
- package/spec_files/api_definitions/fspiop_1.0/trigger_templates/transaction_request_followup_quotes_only.json +97 -0
- package/spec_files/api_definitions/fspiop_1.1/api_spec.yaml +3778 -0
- package/spec_files/api_definitions/fspiop_1.1/callback_map.json +568 -0
- package/spec_files/api_definitions/fspiop_1.1/mockRef.json +79 -0
- package/spec_files/api_definitions/fspiop_1.1/trigger_templates/transaction_request_followup.json +125 -0
- package/spec_files/api_definitions/fspiop_2.0/api_spec.yaml +4839 -0
- package/spec_files/api_definitions/fspiop_2.0/callback_map.json +716 -0
- package/spec_files/api_definitions/fspiop_2.0/mockRef.json +79 -0
- package/spec_files/api_definitions/fspiop_2.0/trigger_templates/transaction_request_followup.json +125 -0
- package/spec_files/api_definitions/fspiop_2.0_iso20022/api_spec.yaml +8331 -0
- package/spec_files/api_definitions/fspiop_2.0_iso20022/callback_map.json +508 -0
- package/spec_files/api_definitions/fspiop_2.0_iso20022/mockRef.json +66 -0
- package/spec_files/api_definitions/fx-api_2.0/api_spec.yaml +1768 -0
- package/spec_files/api_definitions/fx-api_2.0/callback_map.json +188 -0
- package/spec_files/api_definitions/fx-api_2.0/mockRef.json +83 -0
- package/spec_files/api_definitions/mojaloop_sdk_outbound_scheme_adapter_1.0/api_spec.yaml +2612 -0
- package/spec_files/api_definitions/mojaloop_sdk_outbound_scheme_adapter_1.0/mockRef.json +22 -0
- package/spec_files/api_definitions/mojaloop_sdk_outbound_scheme_adapter_1.0/response_map.json +35 -0
- package/spec_files/api_definitions/mojaloop_simulator_0.1/api_spec.yaml +225 -0
- package/spec_files/api_definitions/mojaloop_simulator_sim_1.4/api_spec.yaml +1087 -0
- package/spec_files/api_definitions/mojaloop_simulator_sim_1.4/mockRef.json +75 -0
- package/spec_files/api_definitions/mojaloop_simulator_sim_1.4/response_map.json +55 -0
- package/spec_files/api_definitions/payment_manager_1.4/api_spec.yaml +1389 -0
- package/spec_files/api_definitions/sdk-scheme-adapter-backend-v2_1_0-openapi3-snippets_2.1/api_spec.yaml +2834 -0
- package/spec_files/api_definitions/sdk-scheme-adapter-outbound-v2_1_0-openapi3-snippets_2.1/api_spec.yaml +3449 -0
- package/spec_files/api_definitions/settlements_1.0/api_spec.yaml +983 -0
- package/spec_files/api_definitions/settlements_1.0/mockRef.json +38 -0
- package/spec_files/api_definitions/settlements_1.0/response_map.json +34 -0
- package/spec_files/api_definitions/settlements_2.0/api_spec.yaml +1001 -0
- package/spec_files/api_definitions/settlements_2.0/mockRef.json +38 -0
- package/spec_files/api_definitions/settlements_2.0/response_map.json +34 -0
- package/spec_files/api_definitions/thirdparty_sdk_outbound_0.1/api_spec.yaml +2139 -0
- package/spec_files/reports/templates/newman/html_template.html +1202 -0
- package/spec_files/reports/templates/newman/pdf_template.html +790 -0
- package/spec_files/reports/templates/testcase_definition/table_view.html +1602 -0
- package/spec_files/rules_callback/config.json +3 -0
- package/spec_files/rules_callback/default.json +2698 -0
- package/spec_files/rules_callback/p2p-limit.json +129 -0
- package/spec_files/rules_forward/config.json +3 -0
- package/spec_files/rules_forward/default.json +482 -0
- package/spec_files/rules_response/config.json +3 -0
- package/spec_files/rules_response/default.json +295 -0
- package/spec_files/rules_validation/config.json +3 -0
- package/spec_files/rules_validation/default.json +1 -0
- package/spec_files/rules_validation/p2p-limit.json +55 -0
- package/spec_files/system_config.json +175 -0
- package/spec_files/user_config.json +109 -0
- package/src/index.js +67 -0
- package/src/lib/MyEventEmitter.js +54 -0
- package/src/lib/api-management.js +143 -0
- package/src/lib/api-routes/config.js +83 -0
- package/src/lib/api-routes/history.js +139 -0
- package/src/lib/api-routes/keycloak.js +54 -0
- package/src/lib/api-routes/longpolling.js +70 -0
- package/src/lib/api-routes/oauth2.js +149 -0
- package/src/lib/api-routes/objectstore.js +53 -0
- package/src/lib/api-routes/openapi.js +224 -0
- package/src/lib/api-routes/outbound.js +134 -0
- package/src/lib/api-routes/reports.js +72 -0
- package/src/lib/api-routes/rules.js +356 -0
- package/src/lib/api-routes/samples.js +92 -0
- package/src/lib/api-routes/server-logs.js +44 -0
- package/src/lib/api-routes/settings.js +71 -0
- package/src/lib/api-server.js +135 -0
- package/src/lib/arrayStore.js +101 -0
- package/src/lib/callbackHandler.js +201 -0
- package/src/lib/config.js +177 -0
- package/src/lib/configuration-providers/mb-connection-manager.js +625 -0
- package/src/lib/db/adapters/dbAdapter.js +184 -0
- package/src/lib/db/dfspMockUsers.js +64 -0
- package/src/lib/db/models/mongoDBWrapper.js +78 -0
- package/src/lib/eventListenerClient/inboundEventListener.js +176 -0
- package/src/lib/fileAdapter.js +57 -0
- package/src/lib/httpAgentStore.js +135 -0
- package/src/lib/importExport.js +186 -0
- package/src/lib/jws/JwsSigning.js +141 -0
- package/src/lib/loadSamples.js +128 -0
- package/src/lib/logger.js +20 -0
- package/src/lib/longpollingEmitter.js +56 -0
- package/src/lib/metrics.js +51 -0
- package/src/lib/mocking/custom-functions/generic.js +57 -0
- package/src/lib/mocking/middleware-functions/ilpModel.js +238 -0
- package/src/lib/mocking/middleware-functions/quotesAssociation.js +75 -0
- package/src/lib/mocking/middleware-functions/transactionRequestsService.js +78 -0
- package/src/lib/mocking/openApiDefinitionsModel.js +64 -0
- package/src/lib/mocking/openApiMockHandler.js +466 -0
- package/src/lib/mocking/openApiRulesEngine.js +492 -0
- package/src/lib/mocking/openApiVersionTools.js +136 -0
- package/src/lib/mocking/transformers/fspiopToISO20022.js +230 -0
- package/src/lib/mocking/transformers/index.js +41 -0
- package/src/lib/notificationEmitter.js +64 -0
- package/src/lib/oauth/KeycloakHelper.js +220 -0
- package/src/lib/oauth/LoginService.js +133 -0
- package/src/lib/oauth/OAuthHelper.js +181 -0
- package/src/lib/oauth/OAuthValidator.js +118 -0
- package/src/lib/oauth/Wso2Client.js +64 -0
- package/src/lib/objectStore/inMemoryImpl.js +50 -0
- package/src/lib/objectStore/objectStoreInterface.js +51 -0
- package/src/lib/objectStore.js +122 -0
- package/src/lib/report-generator/generator.js +126 -0
- package/src/lib/report-generator/helpers.js +154 -0
- package/src/lib/requestLogger.js +190 -0
- package/src/lib/resources/wso2carbon-publickey.cert +20 -0
- package/src/lib/rulesEngine.js +95 -0
- package/src/lib/rulesEngineModel.js +463 -0
- package/src/lib/scripting-engines/postman-sandbox.js +142 -0
- package/src/lib/scripting-engines/vm-javascript-sandbox.js +294 -0
- package/src/lib/server-logs/adapters/elastic-search.js +102 -0
- package/src/lib/server-logs/adapters/grafana.js +0 -0
- package/src/lib/server-logs/index.js +75 -0
- package/src/lib/socket-server.js +55 -0
- package/src/lib/storageAdapter.js +109 -0
- package/src/lib/test-outbound/TestCaseRunner.js +173 -0
- package/src/lib/test-outbound/getTracing.js +19 -0
- package/src/lib/test-outbound/outbound-initiator.js +1107 -0
- package/src/lib/uniqueIdGenerator.js +35 -0
- package/src/lib/utils.js +89 -0
- package/src/lib/utilsInternal.js +56 -0
- package/src/lib/webSocketClient/WebSocketClientManager.js +197 -0
- package/src/server.js +218 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Users Guide
|
|
2
|
+
|
|
3
|
+
## _Mojaloop Testing Toolkit CLI_
|
|
4
|
+
|
|
5
|
+
### Introduction
|
|
6
|
+
|
|
7
|
+
The intention of this document is to provide a basic user guide to the **Mojaloop Testing Toolkit CLI**. This easy to use toolkit was designed for both technical and non-technical users, even though the primarily users would likely be Quality Assurance (QA) resources. By following this guide, users will have a better understand of the capabilities and functionality of the cli.
|
|
8
|
+
|
|
9
|
+
The **Mojaloop Testing Toolkit CLI** was designed for participants that would like to participate in the Mojaloop scheme. Intentionally build as a standard integration testing tool between a _Digital Financial Service Provider (DFSP)_ and the _Mojaloop Switch_ (Hub), to facilitate testing. This tool set can potentially be used by both the DFSP and the _Mojaloop Switch_ to verify the integration between the 2 entities.
|
|
10
|
+
|
|
11
|
+
For additional back ground information on the Self Testing Toolkit, please see [Mojaloop Testing Toolkit](/documents/Mojaloop-Testing-Toolkit.md). It would be to the particpant's benefit to familiarise themselves with the understanding of the [Architecture Diagram](/documents/Mojaloop-Testing-Toolkit.md#7-architecture) that explains the various components and related flows.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
**Table of Contents**
|
|
15
|
+
|
|
16
|
+
1. [Getting Started](#1-getting-started)
|
|
17
|
+
2. [The Mojaloop Testing Toolkit CLI](#2-the-mojaloop-testing-toolkit)
|
|
18
|
+
|
|
19
|
+
2.1. [Help screen](#21-at-first-glance)
|
|
20
|
+
|
|
21
|
+
2.2. [Monitoring Mode](#22-monitoring-mode)
|
|
22
|
+
|
|
23
|
+
2.3. [Outbound Mode](#23-outbound-mode)
|
|
24
|
+
|
|
25
|
+
2.4. [AWS S3 Upload](#24-aws-s3-upload)
|
|
26
|
+
|
|
27
|
+
2.5. [Slack Notification](#25-slack-notification)
|
|
28
|
+
|
|
29
|
+
### 1. Getting Started
|
|
30
|
+
|
|
31
|
+
To get started, please follow the instructions in the [README](/README.md) document. This document covers the use-cases with the **Mojaloop Simulator**.
|
|
32
|
+
|
|
33
|
+
### 2. CLI
|
|
34
|
+
|
|
35
|
+
#### 2.1 Help screen
|
|
36
|
+
|
|
37
|
+
The help screen allows you to see the usage, possible options and default values
|
|
38
|
+
|
|
39
|
+
command:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
node src/cli_client/client -h
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
output:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
Usage: client [options]
|
|
49
|
+
|
|
50
|
+
Options:
|
|
51
|
+
-v, --version output the version number
|
|
52
|
+
-c, --config <config> default configuration: {"mode": "outbound", "reportFormat": "json"}
|
|
53
|
+
-m, --mode <mode> default: "outbound" --- supported modes: "monitoring", "outbound"
|
|
54
|
+
-u, --base-url <baseUrl> default: "http://localhost:5050"
|
|
55
|
+
-i, --input-files <inputFiles> csv list of json files or directories; required when the mode is "outbound" --- supported formats: "json"
|
|
56
|
+
-e, --environment-file <environmentFile> required when the mode is "outbound" --- supported formats: "json"
|
|
57
|
+
--report-format <reportFormat> default: "json" --- supported formats: "json", "html", "printhtml"
|
|
58
|
+
--report-auto-filename-enable <reportAutoFilenameEnable> default: false, if true the file name will be generated by the backend
|
|
59
|
+
--report-target <reportTarget> default: "file://<file_name_genrated_by_backend>" --- supported targets: "file://path_to_file", "s3://<bucket_name>[/<file_path>]"
|
|
60
|
+
--slack-webhook-url <slackWebhookUrl> default: "Disabled" --- supported formats: "https://....."
|
|
61
|
+
-h, --help output usage information
|
|
62
|
+
|
|
63
|
+
*** If the option report-target is set to use AWS S3 service, the variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION) should be passed in environment
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### 2.2 Monitoring Mode
|
|
67
|
+
|
|
68
|
+
The monitoring mode allows you to monitor _incoming_ requests from the **Mojaloop Simulator**.
|
|
69
|
+
|
|
70
|
+
Example:
|
|
71
|
+
|
|
72
|
+
command:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
node src/cli_client/client -m monitoring
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
output:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
Listening on newLog events...
|
|
82
|
+
2020-05-12T12:23:32.988Z INFO (15892862129885sy33i) Request: post /bulkTransfers
|
|
83
|
+
{
|
|
84
|
+
"request": {
|
|
85
|
+
"uniqueId": "15892862129885sy33i",
|
|
86
|
+
"headers": {
|
|
87
|
+
"content-type": "application/vnd.interoperability.parties+json;version=1.0",
|
|
88
|
+
"accept": "application/vnd.interoperability.parties+json;version=1.0",
|
|
89
|
+
"fspiop-source": "testingtoolkitdfsp",
|
|
90
|
+
"date": "Tue, 12 May 2020 12:23:32 GMT",
|
|
91
|
+
"user-agent": "axios/0.19.2",
|
|
92
|
+
"content-length": "256",
|
|
93
|
+
"host": "localhost:4040",
|
|
94
|
+
"connection": "close"
|
|
95
|
+
},
|
|
96
|
+
"body": {
|
|
97
|
+
"bulkTransferId": "202137c6-2ca9-429d-b03b-41d5cf19258c",
|
|
98
|
+
"bulkQuoteId": "8823f09e-728c-4e04-b718-d17a24e55bb0",
|
|
99
|
+
"payerFsp": "string",
|
|
100
|
+
"payeeFsp": "string",
|
|
101
|
+
"expiration": "2020-01-01T10:10:10.000Z",
|
|
102
|
+
"extensionList": {
|
|
103
|
+
"extension": [
|
|
104
|
+
{
|
|
105
|
+
"key": "string",
|
|
106
|
+
"value": "string"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
You could Send Transfer from postman or execute outbound mode with an example from examples/test-cases folder
|
|
116
|
+
|
|
117
|
+
#### 2.3 Outbound Mode
|
|
118
|
+
|
|
119
|
+
This sections will enable you to intiate requests from the cli to your DFSP implementation.
|
|
120
|
+
|
|
121
|
+
The user can create a collection of operations and add a number of assertions to these operations. The assertions can be setup and customized to support your testing requirements and verify both positive and negative requests and responses.
|
|
122
|
+
|
|
123
|
+
#### Default values
|
|
124
|
+
|
|
125
|
+
mode:
|
|
126
|
+
- outbound
|
|
127
|
+
reportFormat:
|
|
128
|
+
- json
|
|
129
|
+
reportName:
|
|
130
|
+
- when reportFormat is json: ${test-name}-${date-now}.json
|
|
131
|
+
- when reportFormat is html/printhtml format: value is generated by the service responsible for converting the json to the given format
|
|
132
|
+
|
|
133
|
+
#### Exit codes
|
|
134
|
+
|
|
135
|
+
The CLI tool is able to return the proper exit codes in case of success and failures. This will enable this tool to use in automation systems (CICD).
|
|
136
|
+
|
|
137
|
+
- 0: all assertions passed
|
|
138
|
+
- 1: there is at least 1 failed assertion
|
|
139
|
+
|
|
140
|
+
#### Example
|
|
141
|
+
|
|
142
|
+
command:
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
node src/cli_client/client -m outbound -i examples/collections/dfsp/p2p_happy_path.json -e examples/environments/dfsp_local_environment.json --report-format html
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
output:
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
Listening on outboundProgress events...
|
|
152
|
+
████████████████████████████████████████ 100% | ETA: 0s | 3/3
|
|
153
|
+
--------------------TEST CASES--------------------
|
|
154
|
+
P2P Transfer Happy Path
|
|
155
|
+
Get party information - GET - /parties/{Type}/{ID} - [8/8]
|
|
156
|
+
Send quote - POST - /quotes - [11/11]
|
|
157
|
+
Send transfer - POST - /transfers - [9/9]
|
|
158
|
+
--------------------TEST CASES--------------------
|
|
159
|
+
┌───────────────────────────────────────────────────────┐
|
|
160
|
+
│ SUMMARY │
|
|
161
|
+
├───────────────────────┬───────────────────────────────┤
|
|
162
|
+
│ Total assertions │ 28 │
|
|
163
|
+
├───────────────────────┼───────────────────────────────┤
|
|
164
|
+
│ Passed assertions │ 28 │
|
|
165
|
+
├───────────────────────┼───────────────────────────────┤
|
|
166
|
+
│ Failed assertions │ 0 │
|
|
167
|
+
├───────────────────────┼───────────────────────────────┤
|
|
168
|
+
│ Total requests │ 3 │
|
|
169
|
+
├───────────────────────┼───────────────────────────────┤
|
|
170
|
+
│ Total test cases │ 1 │
|
|
171
|
+
├───────────────────────┼───────────────────────────────┤
|
|
172
|
+
│ Passed percentage │ 100.00% │
|
|
173
|
+
├───────────────────────┼───────────────────────────────┤
|
|
174
|
+
│ Started time │ Mon, 01 Jun 2020 14:46:20 GMT │
|
|
175
|
+
├───────────────────────┼───────────────────────────────┤
|
|
176
|
+
│ Completed time │ Mon, 01 Jun 2020 14:46:21 GMT │
|
|
177
|
+
├───────────────────────┼───────────────────────────────┤
|
|
178
|
+
│ Runtime duration │ 832 ms │
|
|
179
|
+
├───────────────────────┼───────────────────────────────┤
|
|
180
|
+
│ Average response time │ NA │
|
|
181
|
+
└───────────────────────┴───────────────────────────────┘
|
|
182
|
+
TTK-Assertion-Report-dfsp-p2p-tests-2020-06-01T14:46:21.303Z.html was generated
|
|
183
|
+
Terminate with exit code 0
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
You will find a report in the project folder - 'TTK-Assertion-Report-{collection-name}-{ISO-date}.{report-format}'
|
|
187
|
+
|
|
188
|
+
#### 2.4 AWS S3 Upload
|
|
189
|
+
|
|
190
|
+
You can choose to upload the generated report to AWS S3 at the end of tests execution.
|
|
191
|
+
|
|
192
|
+
Use the command line option **'--report-target'** to specify the target in the format `s3://<bucket_name>/<object_key>`
|
|
193
|
+
|
|
194
|
+
You can use the option **'--report-auto-filename-enable'** to replace the file name specified in the target with an auto generated file name.
|
|
195
|
+
|
|
196
|
+
To use AWS S3 service, the following environment variables should be set with proper credentials
|
|
197
|
+
- AWS_ACCESS_KEY_ID
|
|
198
|
+
- AWS_SECRET_ACCESS_KEY
|
|
199
|
+
- AWS_REGION
|
|
200
|
+
|
|
201
|
+
Example Command:
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
node src/cli_client/client -m outbound -i examples/collections/dfsp/p2p_happy_path.json -e examples/environments/dfsp_local_environment.json --report-format html --report-auto-filename-enable true --report-target s3://qa-reports-bucket/reports-folder/report-name.html
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
#### 2.5 Slack Notification
|
|
208
|
+
|
|
209
|
+
You can choose to notify over a slack channel after a completed tests execution.
|
|
210
|
+
For this, you have to generate your `slack webhook` in slack portal and provide the webhook URL by the command line option **'--slack-webhook-url'**
|
|
211
|
+
|
|
212
|
+
If the S3 option is also set, then a link to the uploaded report will be sent in the slack notification.
|
|
213
|
+
|
|
214
|
+
Example Command:
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
node src/cli_client/client -m outbound -i examples/collections/dfsp/p2p_happy_path.json -e examples/environments/dfsp_local_environment.json --slack-webhook-url=https://hooks.slack.com/services/blablabla...
|
|
218
|
+
```
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
# Users Guide Connection Manager
|
|
2
|
+
|
|
3
|
+
## _Mojaloop Testing Toolkit_
|
|
4
|
+
|
|
5
|
+
To incorporate security and authenticity validations between the testing DFSP and the _Mojaloop Switch_, the **Mojaloop Connection Manager** can be activated to integrate with the **Mojaloop Testing Toolkit**. This will allow the incorporation of TLS and JWS Certificates and Key validations as part of the process.
|
|
6
|
+
|
|
7
|
+
**Table of Contents**
|
|
8
|
+
|
|
9
|
+
0. [User Guide](/documents/User-Guide.md)
|
|
10
|
+
|
|
11
|
+
1. [Configure TLS](#11-configure-tls)
|
|
12
|
+
|
|
13
|
+
2. [Configure JWS](#2-configure-jws)
|
|
14
|
+
|
|
15
|
+
3. [Enabling TLS and JWS Verification](#3-enabling-tls-and-jws-cerification)
|
|
16
|
+
|
|
17
|
+
4. [Connection Manager Keys and Certificates](#4-connection-manager-keys-and-certificates)
|
|
18
|
+
|
|
19
|
+
4.1 [Certificate Authorities](#41-certificate-authorities)
|
|
20
|
+
|
|
21
|
+
4.2 [TSL Client Certificates](#42-tls-client-certificates)
|
|
22
|
+
|
|
23
|
+
4.3 [TLS Server Certificates](#43-tls-server-certificates)
|
|
24
|
+
|
|
25
|
+
4.4 [JWS Certificates](#44-jws-certificates)
|
|
26
|
+
|
|
27
|
+
5. [Alternative Set-ups](#5-alternative-set-ups)
|
|
28
|
+
|
|
29
|
+
### 1 Configure TLS
|
|
30
|
+
|
|
31
|
+
This section will guide you in the required configuration updates to enable running with TLS, enabled in a local docker container environment.
|
|
32
|
+
|
|
33
|
+
To enable TLS, you need to apply the following configurations on the local file system. Remember to save the files when the configurations are completed.
|
|
34
|
+
|
|
35
|
+
- [local.env](/local.env) file under the root directory;
|
|
36
|
+
|
|
37
|
+
- update _CALLBACK_ENDPOINT_ to **HTTPS**,
|
|
38
|
+
|
|
39
|
+
- update _INBOUND_MUTUAL_TLS_ENABLED_ to **true**,
|
|
40
|
+
|
|
41
|
+
- Update _OUTBOUND_MUTUAL_TLS_ENABLED_ to **true**.
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
CALLBACK_ENDPOINT=https://scheme-adapter:4000
|
|
45
|
+
.
|
|
46
|
+
.
|
|
47
|
+
.
|
|
48
|
+
INBOUND_MUTUAL_TLS_ENABLED=true
|
|
49
|
+
OUTBOUND_MUTUAL_TLS_ENABLED=true
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+

|
|
53
|
+
|
|
54
|
+
- [/simulator/scheme-adapter.env](/simulator/scheme-adapter.env) file, make the following update;
|
|
55
|
+
|
|
56
|
+
- Update _INBOUND_MUTUAL_TLS_ENABLED_ to **true**,
|
|
57
|
+
|
|
58
|
+
- Update _OUTBOUND_MUTUAL_TLS_ENABLED_ to **true**.
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
INBOUND_MUTUAL_TLS_ENABLED=true
|
|
62
|
+
OUTBOUND_MUTUAL_TLS_ENABLED=true
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+

|
|
66
|
+
|
|
67
|
+
The TLS certificates and keys for the _Mojaloop Switch_ have already been pre-generated and populated for use in the docker container. For information purposes ,the configuration and location are defined in the file content as per the image below.
|
|
68
|
+
|
|
69
|
+

|
|
70
|
+
|
|
71
|
+
The current configuration caters for a local setup within a docker container.
|
|
72
|
+
|
|
73
|
+
Current setup for **Mojaloop Simulator** endpoint, pointing to _scheme-adapter_ as part of the docker containers.
|
|
74
|
+
|
|
75
|
+

|
|
76
|
+
|
|
77
|
+
Current setup for **Mojaloop Testing-Toolkit** endpoint, pointing to _mojaloop-testing-toolkit_ as part of the docker containers.
|
|
78
|
+
|
|
79
|
+

|
|
80
|
+
|
|
81
|
+
### 2 Configure JWS
|
|
82
|
+
|
|
83
|
+
This section will guide you through the required configurations to run with JWS, enabled in a local docker container environment.
|
|
84
|
+
|
|
85
|
+
To enable JWS, you need to apply the following configurations on the local file system. Remember to save the files when the config is completed.
|
|
86
|
+
|
|
87
|
+
- [local.env](/local.env) file under the root directory;
|
|
88
|
+
|
|
89
|
+
- update _VALIDATE_INBOUND_JWS_ to **true**,
|
|
90
|
+
- update _VALIDATE_INBOUND_PUT_PARTIES_JWS_ to **true**,
|
|
91
|
+
- update _JWS_SIGN_ to **true**,
|
|
92
|
+
- update _JWS_SIGN_PUT_PARTIES_ to **true**.
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
VALIDATE_INBOUND_JWS=true
|
|
96
|
+
VALIDATE_INBOUND_PUT_PARTIES_JWS=true
|
|
97
|
+
JWS_SIGN=true
|
|
98
|
+
JWS_SIGN_PUT_PARTIES=true
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+

|
|
102
|
+
|
|
103
|
+
- [/simulator/scheme-adapter.env](/simulator/scheme-adapter.env) file, make the following update;
|
|
104
|
+
|
|
105
|
+
- Update _INBOUND_MUTUAL_TLS_ENABLED_ to **true**,
|
|
106
|
+
- Update _VALIDATE_INBOUND_JWS_ to **true**,
|
|
107
|
+
- Update _VALIDATE_INBOUND_PUT_PARTIES_JWS_ to **true**,
|
|
108
|
+
- Update _JWS_SIGN_ to **true**,
|
|
109
|
+
- Update _JWS_SIGN_PUT_PARTIES_ to **true**.
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
VALIDATE_INBOUND_JWS=true
|
|
113
|
+
VALIDATE_INBOUND_PUT_PARTIES_JWS=true
|
|
114
|
+
JWS_SIGN=true
|
|
115
|
+
JWS_SIGN_PUT_PARTIES=true
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The JWS certificates and publickey for the _Mojaloop Switch_ have already been pre-generated and populated for use in your local docker container. For information purposes, the configuration and location are defined in the file content as per the image below.
|
|
119
|
+
|
|
120
|
+

|
|
121
|
+
|
|
122
|
+
The current configuration caters for a local setup within a docker container.
|
|
123
|
+
|
|
124
|
+
Current setup for **Mojaloop Simulator** pointing to _scheme-adapter_ as part of the docker containers.
|
|
125
|
+
|
|
126
|
+

|
|
127
|
+
|
|
128
|
+
Current setup for **Mojaloop Testing- Toolkit** pointing to _mojaloop-testing-toolkit_ as part of the docker containers.
|
|
129
|
+
|
|
130
|
+

|
|
131
|
+
|
|
132
|
+
### 3 Enabling TLS and JWS Verification
|
|
133
|
+
|
|
134
|
+
As we have made updates to the configuration files for both **Mojaloop Simulator** and **Mojaloop Testing Toolkit**, we will need to restart both docker containers. In the appropriate terminal windows for the 2 applications, stop the docker containers by pressing **Ctrl + C** simultaneously on the keyboard in each terminal window. These actions should "Gracefully stop" the respective local docker containers. To insure all the docker containers are in fact down, run the following command in the respective terminal windows.
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
docker-compose down
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
It is good practice and recommended to verify that all local docker containers are down by running the below command to ensure that there are no local docker containers still active.
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
docker-compose ps
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
There shouldn't be any active local docker containers. You should see the following on the respective terminal windows
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
Name Command State Ports
|
|
150
|
+
------------------------------
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
To enable the integration with **Mojaloop Connection Manager**, you will need to open a new terminal window to bring up **Mojaloop Connection Manager** service within a local docker container. (We will refer to this new session as "Connection Manager terminal" to avoid confusion.
|
|
154
|
+
|
|
155
|
+
The **Mojaloop Connection Manager** is downloaded as part of the **Mojaloop Testing Toolkit**. Just navigate to the respective folder from the project root _/connection-manager_.
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
cd connection-manager
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
To start **Mojaloop Connection Manager** as part of the **Mojaloop Testing Toolkit**, execute the below command in the "Connection Manager terminal" terminal window.
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
docker-compose up
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Important Notes**
|
|
168
|
+
- The **Mojaloop Connection Manager** environment is created when the **Mojaloop Testing Toolkit** service is started. Please insure the service is available and stable before starting **Mojaloop Testing Toolkit** service.
|
|
169
|
+
|
|
170
|
+
- The **Mojaloop Testing Toolkit** is a local docker image. With the configuration change to enable TLS and JWS, the local docker image will need to be recreated before restarting **Mojaloop Testing Toolkit**. In the project root directory, execute the following to rebuild the docker image to include the updated configurations.
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
docker-compose build
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
After the images rebuild is competed, restart **Mojaloop Simulator** and **Mojaloop Testing Toolkit**. Simply run the below command in both the respective terminal windows for the 2 services. The services will startup in the respective docker containers as described in the initial instructions in the [README](/README.md) document.
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
docker-compose up
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Once **Mojaloop Testing Toolkit** service is available, open the UI in a browser, as described in the [README](/README.md) document. Verify that the TLS and JWS setting are enabled by navigating to _**Settings**_ on the right hand navigation pane and select _**Settings**_.
|
|
183
|
+
|
|
184
|
+
As per the initial configurations that was done on the _local.env_ files, you will notice on the _**Runtime Global Configuration**_ window on the left the following settings for JWS and TLS are updated and enabled;
|
|
185
|
+
|
|
186
|
+
- Callback URL starts with **https://**
|
|
187
|
+
- Enable Inbound JWS Validation is **√**
|
|
188
|
+
- Enable Inbound JWS Signing for PUT /parties is **√**
|
|
189
|
+
- Enable Outbound JWS Signing is **√**
|
|
190
|
+
- Enable Outbound JWS Signing for PUT /parties is **√**
|
|
191
|
+
- Enable Inbound Mutual TLS is **√**
|
|
192
|
+
- Enable Outbound Mutual TLS is **√**
|
|
193
|
+
|
|
194
|
+

|
|
195
|
+
|
|
196
|
+
By now **Mojaloop Connection Manager** and all other services should br available with the updated security configurations (TLS and JWS). Open a browser and enter ```localhost:5060``` in the url. This will open the **Mojaloop Connection Manager UI**. You will be signed in as a _DFSP_ **dfsp1**, on a _**TESTING-TOOL**_ environment.
|
|
197
|
+
|
|
198
|
+
*Note* - If a _Username_ and _Password_ is required, enter "test" for both.
|
|
199
|
+
|
|
200
|
+

|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
### 4 Connection Manager Keys and Certificates
|
|
204
|
+
|
|
205
|
+
Even though all the certificates for **Mojaloop Testing Toolkit** and **Mojaloop Simulator** have been pre-generated and placed in a folder, ready for use, some manual actions are required to enable the integration with **Mojaloop Connection Manager**. The sample demostration within this document, demostrates **Mojaloop Testing Toolkit** as the testing DFSP and interfacing with the **Mojaloop Simulator** simulating the _Mojaloop Switch_. **Mojaloop Connect Manager** set-up is from the DFSP perspective.
|
|
206
|
+
|
|
207
|
+
From the **Mojaloop Connect Manager** window, click on the _**TESTING-TOOL**_ environment button.
|
|
208
|
+
|
|
209
|
+

|
|
210
|
+
|
|
211
|
+
#### 4.1 Certificate Authorities
|
|
212
|
+
|
|
213
|
+
On the navigational tab on the left, navigate to _Certificates_ and select _Certificate Authorities_. Under the _DFSP Certificate Authority_ tab in the _Root Certificate_ box, click on _Choose file_ button. Navigate to ```/simulator/secrets/tls/``` and select ```dfsp_client_cacert.pem``` file.
|
|
214
|
+
|
|
215
|
+

|
|
216
|
+
|
|
217
|
+
#### 4.2 TLS Client Certificates
|
|
218
|
+
|
|
219
|
+
Still under _Certificates_ on the navigational tab on the left, select _TLS Client Certificates_. Under the _CSR_ tab in the _CSR_ box, click on the _choose file_ button. Navigate to ```/simulator/secrets/tls/``` and select ```dfsp_client.csr``` file. On submission of this CSR, the testing toolkit will automaticallly sign this and the signed certificate will be available in the _Sent CSR_ tab. Under normal circumstances, you can download this client certificate and provide it to your DFSP implementation. But for this demo, it is already placed in the simulator/tls folder for convinience.
|
|
220
|
+
|
|
221
|
+

|
|
222
|
+
|
|
223
|
+
Click on the _**√ Submit**_ button to send the file to the HUB signing.
|
|
224
|
+
|
|
225
|
+

|
|
226
|
+
|
|
227
|
+
Now select the _Unprocessed Hub CSRs_ tab. Under normal circumstances, we will download the CSR file and sign it with our _Certificate Authority (CA)_ by clicking on the _Download CSR_ button. For the demo as we already have the signed hub certificate in the folder, this is not necessary, and you can click on the _Upload Certificate_ button on the right of the main window. Navigate to ```/simulator/secrets/tls/``` and select ```hub_client_cert.pem``` file.
|
|
228
|
+
|
|
229
|
+

|
|
230
|
+
|
|
231
|
+
#### 4.3 TLS Server Certificates
|
|
232
|
+
|
|
233
|
+
Still under _Certificates_ on the navigational tab on the left, select _TSL Server Certificates_. Under the _DFSP Server certificates_ tab in the _Server certificate_ box, click on the _Choice File_ button. Navigate to ```/simulator/secrets/tls/``` and select ```dfsp_server_cert.pem``` file.
|
|
234
|
+
|
|
235
|
+

|
|
236
|
+
|
|
237
|
+
Under the _DFSP Server certificates_ tab in the _Root certificate_ box, click on the _Choose File_ button. Navigate to ```/simulator/secrets/tls/``` and select ```dfsp_server_cacert.pem``` file.
|
|
238
|
+
|
|
239
|
+

|
|
240
|
+
|
|
241
|
+
Click on the _**√ Submit**_ button
|
|
242
|
+
|
|
243
|
+

|
|
244
|
+
|
|
245
|
+
To do a quick verification that everything is still functioning as expected, you can repeat the simulator test done in 3.3 [Monitoring]( #3-monitoring).
|
|
246
|
+
|
|
247
|
+
#### 4.4 JWS Certificates
|
|
248
|
+
|
|
249
|
+
Still under _Certificates_ on the navigational tab on the left, select _JWS Certificates_. Under the _DFSP JWS Certificates_ tab in the _JWS Certificate_ box, click on the _Choose File_ button. Navigate to ```/simulator/secrets/jws/``` and select ```publickey.cer``` file.
|
|
250
|
+
|
|
251
|
+

|
|
252
|
+
|
|
253
|
+
Click on the _**√ Submit**_ button to upload the JWS Public Key Certificate.
|
|
254
|
+
|
|
255
|
+

|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
### 5 Alternative Set-ups
|
|
259
|
+
|
|
260
|
+
It is possible for **Mojaloop Testing Toolkit** to function outside of a _local_ environment, enabling more advance integration testing and verifications between a _Mojaloop Switch_ and testing DFSP before going live. These are not covered within the boundaries of this document, but you are more than welcome to explore this functionality.
|
|
261
|
+
|
|
262
|
+
Please be aware should you set-up on another environment or DFSPs, some variables will need to be updated like the DNS or IP address of the server. Certificates and keys will also need to be generated and implemented for the new environment and DFSPs should TLS and JWS be enabled.
|
|
263
|
+
|
|
264
|
+
These configurations will be covered in a separate document. This will include the actions required on **Mojaloop Connection Manager**, **Mojaloop Testing Toolkit** and **Mojaloop Simulator** to enable the adding of DFSPs, and testing with new environments for DFSPs.
|
|
265
|
+
|
|
266
|
+
This document will provide guidance on the following;
|
|
267
|
+
- add a new DFSP on an existing environment,
|
|
268
|
+
- add a new environement for a DFSP,
|
|
269
|
+
- guide you to create your own TLS and JWS certificate and keys for inclusion into **Mojaloop Connection Manager**,
|
|
270
|
+
- guide you through the configuration required to integrate functionality between the testing entities.
|
|
271
|
+
|
|
272
|
+
Script files are provided in the respective directories to speed up the process to generate these certificates for both the **Mojaloop Simulator** and **Mojaloop Testing Toolkit**.
|
|
273
|
+
|
|
274
|
+
- **Mojaloop Simulator** the file path;
|
|
275
|
+
/simulator/secrets/tls/createSecrets.sh
|
|
276
|
+
/simulator/secrets/jws/keygen.sh
|
|
277
|
+
|
|
278
|
+
- **Mojaloop Testing Toolkit** the file path;
|
|
279
|
+
/secrets/tls/createSecrets.sh
|
|
280
|
+
/secrets/keygen.sh
|
|
281
|
+
|
|
282
|
+
As mentioned in the begining of this section, the aforementioned scenarios will be elaborated on in a seperate document.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Users Guide Frequently Asked Questions
|
|
2
|
+
|
|
3
|
+
## _Mojaloop Testing Toolkit_
|
|
4
|
+
|
|
5
|
+
This section will list a number a frequently asked questions and the solutions provided.
|
|
6
|
+
|
|
7
|
+
**Table of Contents**
|
|
8
|
+
|
|
9
|
+
0. [User Guide](/documents/User-Guide.md)
|
|
10
|
+
|
|
11
|
+
1. [Mojaloop Connection Manager require sign on](#1-mojaloop-connection-manager-require-sign-on)
|
|
12
|
+
|
|
13
|
+
2. [Generic ID not found](#2-generic-id-not-found)
|
|
14
|
+
|
|
15
|
+
### 1 Mojaloop Connection Manager require sign on
|
|
16
|
+
|
|
17
|
+
When opening **Mojaloop Connection Manager** in my browser, a _**Username**_ and _**Password**_ is required.
|
|
18
|
+
- The default is to open to the available environment, _**TESTING-TOOLKIT**_ as default. After the initial opening, and a time lapses, the **Mojaloop Connection Manager UI** will request you to sign on. Use the default _**Username**_ => ```test``` and _**Password**_ => ```test```.
|
|
19
|
+
|
|
20
|
+
### 2 Generic ID not found
|
|
21
|
+
|
|
22
|
+
When I run the _**Outbound Request**_, I receive failures on the Callback response;
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
{
|
|
26
|
+
"body": {
|
|
27
|
+
"errorInformation": {
|
|
28
|
+
"errorCode": "3200",
|
|
29
|
+
"errorDescription": "Generic ID not found"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- The reason for this is the **Inbound User** is no present on the **Mojaloop Simulator**. For the samples used in this document, you will need to create a new user for **MSISDN** = **9876543210**. In the **Mojaloop Simulator UI**, select _**+ Add User**_ button on the _**Config Inbound**_ navigation tab. Below screenshot is a sample based on the sample data used within this document. Click on the _**√ Submit**_ button when done.
|
|
36
|
+
|
|
37
|
+
You are welcome to change any values as required. Important values to keep in mind, are the _Id Type_, _Id Value_ and the _DateOfBirth_ date format _(CCYY-MM-DDD)_.
|
|
38
|
+
|
|
39
|
+

|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Hosted Mode with "Docker Compose" (Without JWS and mTLS)
|
|
2
|
+
|
|
3
|
+
## _Mojaloop Testing Toolkit_
|
|
4
|
+
|
|
5
|
+
**Table of Contents**
|
|
6
|
+
|
|
7
|
+
1. [Introduction](#1-introduction)
|
|
8
|
+
|
|
9
|
+
2. [Installation](#2-installation)
|
|
10
|
+
|
|
11
|
+
3. [Creating a group and user for new DFSP](#3-creating-a-group-and-user-for-new-dfsp)
|
|
12
|
+
|
|
13
|
+
4. [Login into TTK UI](#4-login-into-ttk-ui)
|
|
14
|
+
|
|
15
|
+
5. [Sending a Transfer](#5-sending-a-transfer)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 1. Introduction
|
|
19
|
+
|
|
20
|
+
TTK can be deployed in hosted mode using the docker-compose file provided in the TTK repository. In this method, DFSP can not use mTLS and JWS to communicate with TTK.
|
|
21
|
+
|
|
22
|
+

|
|
23
|
+
|
|
24
|
+
## 2. Installation
|
|
25
|
+
|
|
26
|
+
* Clone the TTK repository
|
|
27
|
+
* Run the following commands
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
git clone https://github.com/mojaloop/ml-testing-toolkit
|
|
31
|
+
cd ml-testing-toolkit/docker/hosted-mode
|
|
32
|
+
docker-compose up
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
You should see the following services up and running.
|
|
36
|
+
* TTK backend service
|
|
37
|
+
* TTK frontend service
|
|
38
|
+
* MongoDB for storing details like rules, settings, logs and history per DFSP
|
|
39
|
+
* Keycloak Server for authentication by DFSPs
|
|
40
|
+
|
|
41
|
+
After all the services up and running, the following setup steps are needed for a typical scenario.
|
|
42
|
+
* [Hub User] Create a group for a new DFSP (Ex: dfsp1)
|
|
43
|
+
* [Hub User] Create a user from the new DFSP and assign the corresponding group (Ex: user1)
|
|
44
|
+
* [Hub User] Provide the user credentials to DFSP
|
|
45
|
+
* DFSP will login to the TTK UI using the credentials
|
|
46
|
+
* DFSP gets the token configuration from settings page
|
|
47
|
+
* DFSP will provision the token details in his implementation
|
|
48
|
+
* DFSP can send a transfer to TTK (DFSP) and monitor the requests in monitoring page
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## 3. Creating a group and user for new DFSP
|
|
52
|
+
|
|
53
|
+
For creating an account for DFSP, we need to use keycloak admin web interface.
|
|
54
|
+
|
|
55
|
+
* Open the keycloak web interface on http://<Host>:8080
|
|
56
|
+
* Go to “Administration Console”
|
|
57
|
+
* Login with username “admin” and password “admin” (These default values can be configured using environment values in docker-compose file)
|
|
58
|
+
|
|
59
|
+
### Creating a group for a new DFSP
|
|
60
|
+
|
|
61
|
+
* Goto groups in the menu
|
|
62
|
+
* Click on “New” button at the right
|
|
63
|
+
* Enter the group name in the format /Application/DFSP:dfspName
|
|
64
|
+
Where you should replace the string “dfspName” with your DFSP ID
|
|
65
|
+
* Save the group
|
|
66
|
+
|
|
67
|
+
### Creating new user for DFSP
|
|
68
|
+
|
|
69
|
+
* Goto users in the menu
|
|
70
|
+
* Click on “Add User”
|
|
71
|
+
* Enter the username as “user1” and click on “Save”
|
|
72
|
+
* Goto “Credentials” tab and set the password. Disable “Temporary” checkbox.
|
|
73
|
+
* Goto “Groups” tab and join the following groups
|
|
74
|
+
* /Application/DFSP:<dfspName>
|
|
75
|
+
* /Application/MTA
|
|
76
|
+
* /Internal/everyone
|
|
77
|
+
* Goto “Attributes” tab and add an attribute the name ‘dfspId’ and value ‘<dfspName>’
|
|
78
|
+
|
|
79
|
+
That’s it, now a DFSP has been created and also we created a user. Provide the user credentials to DFSP so that they can login in the TTK UI.
|
|
80
|
+
|
|
81
|
+
## 4. Login into TTK UI
|
|
82
|
+
|
|
83
|
+
Now a DFSP (user) can login into TTK UI for configuring user settings like callback endpoints and for getting token information.
|
|
84
|
+
|
|
85
|
+
* Open the TTK UI with URL http://IP:6060
|
|
86
|
+
* Login with the credentials provided by scheme
|
|
87
|
+
* Goto **“Settings”** page
|
|
88
|
+
* Set the callback endpoint to point to the DFSP’s IP address and port where the service is running
|
|
89
|
+
|
|
90
|
+
SDK-scheme-adapter and payment manager uses **“OAuth 2.0 Client Credentials Grant”** flow to get the access token periodically from the oAuth server.
|
|
91
|
+
If the DFSP is using payment manager or sdk-scheme-adapter for their implementation, the token information is available on the setting page.
|
|
92
|
+
|
|
93
|
+
* Click on the **“Token Info”** button
|
|
94
|
+
* The details like “client_id”, “client_secret” and “token_endpoint” will be displayed on the popup window
|
|
95
|
+
* DFSP can provide the details in his implementation (sdk-scheme-adapter / payment manager)
|
|
96
|
+
* If the DFSP wants to test requests temporarily with a http client / postman, a temporary access token can be generated by clicking on the button **“Generate a Static Token”**. Typically the token expires in one hour.
|
|
97
|
+
* DFSP needs to include the generated token in the **“Authorization”** header as “Bearer TOKEN”
|
|
98
|
+
|
|
99
|
+
## 5. Sending a Transfer
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
After configuring the callback endpoint(s) in TTK and token information in DFSP implementation, a DFSP can send a transfer to TTK.
|
|
103
|
+
|
|
104
|
+
Before sending a transfer, open the monitoring page in TTK UI. All the inbound requests from DFSP implementation and the callbacks generated and sent by TTK will be shown on the monitoring page.
|
|
105
|
+
|
|
106
|
+
We can expand relevant entries here and see the logs, content of the requests and callbacks including header information.
|
|
107
|
+
|
|
108
|
+
TTK validates the schema of all the inbound requests and shows if there are any validation failures.
|
|
109
|
+
|
|
110
|
+
If there are other issues with the parameters in the mojaloop requests, the transfer will fail and DFSP can analyze the problem with the help of logs, entries in the monitoring page.
|