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,283 @@
|
|
|
1
|
+
# Users Guide
|
|
2
|
+
|
|
3
|
+
## _OAuth Server Installation & Configuration (Hosted mode only)_
|
|
4
|
+
|
|
5
|
+
### Introduction
|
|
6
|
+
|
|
7
|
+
This document provides a basic user guide to **install and configure an oAuth server and configure for the testing toolkit**. .
|
|
8
|
+
|
|
9
|
+
To use **Hosting Capability** in the testing toolkit a Scheme / Hub should provide their OAuth server details in the toolkit for providing user authentication in the toolkit web UI and connection manager UI. Typically Schemes / Hubs may already have their own OAuth servers. This guide is just in case they want to implement it from scratch and in any case, to have a reference about the flow.
|
|
10
|
+
|
|
11
|
+
We are using an open source oAuth server called **Keycloak**. Keycloak is "Open Source Identity and Access Management" software and the documentation can be found at https://www.keycloak.org/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
**Table of Contents**
|
|
15
|
+
|
|
16
|
+
1. [Deploy Keycloak Server](#1-deploy-keycloak-server)
|
|
17
|
+
|
|
18
|
+
2. [Configure the KeyCloak Server](#2-configure-the-keycloak-server)
|
|
19
|
+
|
|
20
|
+
2.1 [Login to the admin console](#21-login-to-the-admin-console)
|
|
21
|
+
|
|
22
|
+
2.2 [Create a Realm](#22-create-a-realm)
|
|
23
|
+
|
|
24
|
+
2.3 [Create a Client](#23-create-a-client)
|
|
25
|
+
|
|
26
|
+
2.4 [Change some Client settings](#24-change-some-client-settings)
|
|
27
|
+
|
|
28
|
+
2.5 [Create Groups](#25-create-groups)
|
|
29
|
+
|
|
30
|
+
2.6 [Create Hub User](#26-create-hub-user)
|
|
31
|
+
|
|
32
|
+
2.7 [Create DFSP User](#27-create-dfsp-user)
|
|
33
|
+
|
|
34
|
+
3. [Obtain the required details from KeyCloak Server](#3-obtain-the-required-details-from-keycloak-server)
|
|
35
|
+
|
|
36
|
+
3.1 [Get the Client ID and Secret](#31-get-the-client-id-and-secret)
|
|
37
|
+
|
|
38
|
+
3.2 [Get the Public Key for decoding the Access Token](#32-get-the-public-key-for-decoding-the-access-token)
|
|
39
|
+
|
|
40
|
+
4. [Configure the Testing Toolkit](#4-configure-the-testing-toolkit)
|
|
41
|
+
|
|
42
|
+
4.1 [Enable oAuth authentication](#41-enable-oauth-authentication)
|
|
43
|
+
|
|
44
|
+
5. [Configure the Connection Manager](#5-configure-the-connection-manager)
|
|
45
|
+
|
|
46
|
+
5.1 [Enable oAuth authentication in Connection Manager](#51-enable-oauth-authentication-in-connection-manager)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### 1. Deploy Keycloak Server
|
|
50
|
+
|
|
51
|
+
There are many ways to deploy Keycloak. Here we are using docker method to run this service easily.
|
|
52
|
+
|
|
53
|
+
Just execute the following command to run the service
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
docker run -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin quay.io/keycloak/keycloak:10.0.2
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
For additional documentation please refer https://www.keycloak.org/getting-started/getting-started-docker
|
|
60
|
+
|
|
61
|
+
### 2. Configure the KeyCloak Server
|
|
62
|
+
|
|
63
|
+
#### 2.1 Login to the admin console
|
|
64
|
+
|
|
65
|
+
Open the URL http://localhost:8080/auth/admin and login with username 'admin' and password 'admin' (You can change these values in the command we used for start the server)
|
|
66
|
+
|
|
67
|
+
#### 2.2 Create a Realm
|
|
68
|
+
|
|
69
|
+
* Hover the mouse over the dropdown in the top-left corner where it says Master, then click on Add realm
|
|
70
|
+
|
|
71
|
+
* Fill in the form with the following values:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
Name: testingtoolkit
|
|
75
|
+
```
|
|
76
|
+
* Click Create
|
|
77
|
+
|
|
78
|
+
#### 2.3 Create a Client
|
|
79
|
+
|
|
80
|
+
* Click Clients (left-hand menu)
|
|
81
|
+
|
|
82
|
+
* Click Create (top-right corner of table)
|
|
83
|
+
|
|
84
|
+
* Fill in the form with the following values:
|
|
85
|
+
```
|
|
86
|
+
Client ID : ttk
|
|
87
|
+
Client Protocol : openid-connect
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### 2.4 Change some Client settings
|
|
91
|
+
|
|
92
|
+
* Click Clients (left-hand menu)
|
|
93
|
+
|
|
94
|
+
* Click on the new client (ttk)
|
|
95
|
+
|
|
96
|
+
* Change the following values in Settings tab:
|
|
97
|
+
```
|
|
98
|
+
Access Type : confidential
|
|
99
|
+
Service Accounts Enabled : ON
|
|
100
|
+
Authorization Enabled: ON
|
|
101
|
+
Valid Redirect URIs: Any random URI for now
|
|
102
|
+
Fine Grain OpenID Connect Configuration -> Access Token Signature Algorithm: RS256
|
|
103
|
+
Fine Grain OpenID Connect Configuration -> ID Token Signature Algorithm: RS256
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
* Create the following entries in the Mappers tab:
|
|
107
|
+
|
|
108
|
+
| Name | Mapper Type | Properties | Add to ID token | Add to Access token |
|
|
109
|
+
| --- | --- | --- | --- | --- |
|
|
110
|
+
| dfspId | User Attribute | User Attribute: __dfspId__ <br /> Token Claim Name: __dfspId__ <br /> Claim JSON Type: __String__ | ON | ON |
|
|
111
|
+
| aud | Audience | Included Client Audience : __ttk__ <br /> Included Custom Audience: __aud__ |
|
|
112
|
+
| Groups | Group Membership | Token Claim Name: __groups__ <br /> Full group path: __OFF__ | ON | ON |
|
|
113
|
+
|
|
114
|
+
#### 2.5 Create Groups
|
|
115
|
+
|
|
116
|
+
* Click Groups (left-hand menu)
|
|
117
|
+
|
|
118
|
+
* Click New (top-right corner of table)
|
|
119
|
+
|
|
120
|
+
* Create the following groups:
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
Application/DFSP:dfsp1
|
|
124
|
+
Application/MTA
|
|
125
|
+
Application/PTSA
|
|
126
|
+
Internal/everyone
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
#### 2.6 Create Hub User
|
|
130
|
+
|
|
131
|
+
* Click Users (left-hand menu)
|
|
132
|
+
|
|
133
|
+
* Click Add user (top-right corner of table)
|
|
134
|
+
|
|
135
|
+
* Fill in the form with the following values:
|
|
136
|
+
```
|
|
137
|
+
Username: hub
|
|
138
|
+
First Name: Hub
|
|
139
|
+
Last Name: User
|
|
140
|
+
User Enabled: ON
|
|
141
|
+
Email Verified: OFF
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
* Click on the tab "Attributes" and add the following
|
|
145
|
+
```
|
|
146
|
+
Key: dfspId
|
|
147
|
+
Value: hub
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
* Click on the tab "Credentials" and create the password
|
|
151
|
+
```
|
|
152
|
+
Password: <Some password for the Hub>
|
|
153
|
+
Password Confirmation: <Some password for the Hub>
|
|
154
|
+
Temporary: OFF
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
* Click on the tab "Groups" and join the following groups
|
|
158
|
+
```
|
|
159
|
+
Application/PTA
|
|
160
|
+
Internal/everyone
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
#### 2.7 Create DFSP User
|
|
164
|
+
|
|
165
|
+
* Click Users (left-hand menu)
|
|
166
|
+
|
|
167
|
+
* Click Add user (top-right corner of table)
|
|
168
|
+
|
|
169
|
+
* Fill in the form with the following values:
|
|
170
|
+
```
|
|
171
|
+
Username: user1
|
|
172
|
+
First Name: User
|
|
173
|
+
Last Name: One
|
|
174
|
+
User Enabled: ON
|
|
175
|
+
Email Verified: OFF
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
* Click on the tab "Attributes" and add the following
|
|
179
|
+
```
|
|
180
|
+
Key: dfspId
|
|
181
|
+
Value: dfsp1
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
* Click on the tab "Credentials" and create the password
|
|
185
|
+
```
|
|
186
|
+
Password: <Some password for User1>
|
|
187
|
+
Password Confirmation: <Some password for User1>
|
|
188
|
+
Temporary: OFF
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
* Click on the tab "Groups" and join the following groups
|
|
192
|
+
```
|
|
193
|
+
Application/DFSP:dfsp1
|
|
194
|
+
Application/MTA
|
|
195
|
+
Internal/everyone
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### 3. Obtain the required details from KeyCloak Server
|
|
199
|
+
|
|
200
|
+
#### 3.1 Get the Client ID and Secret
|
|
201
|
+
|
|
202
|
+
* Click Clients (left-hand menu)
|
|
203
|
+
|
|
204
|
+
* Click on the client 'ttk' in the table
|
|
205
|
+
|
|
206
|
+
* Note down the __Client ID__
|
|
207
|
+
|
|
208
|
+
* Click on the tab 'Credentials' and note down the __Secret__
|
|
209
|
+
|
|
210
|
+
#### 3.2 Get the Public Key for decoding the Access Token
|
|
211
|
+
|
|
212
|
+
* Click Realm Settings (left-hand menu)
|
|
213
|
+
|
|
214
|
+
* Click on the tab 'Keys'
|
|
215
|
+
|
|
216
|
+
* Click on the '__Public Key__' of RS256 Algorithm and note down the key
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
### 4. Configure the Testing Toolkit
|
|
220
|
+
|
|
221
|
+
#### 4.1 Enable oAuth authentication
|
|
222
|
+
|
|
223
|
+
* Change the system_config.json file with the following values
|
|
224
|
+
```
|
|
225
|
+
"HOSTING_ENABLED": true,
|
|
226
|
+
"OAUTH": {
|
|
227
|
+
"AUTH_ENABLED": true,
|
|
228
|
+
"APP_OAUTH_CLIENT_KEY": "ttk",
|
|
229
|
+
"APP_OAUTH_CLIENT_SECRET": "<CLIENT_SECRET>",
|
|
230
|
+
"MTA_ROLE": "Application/MTA",
|
|
231
|
+
"PTA_ROLE": "Application/PTA",
|
|
232
|
+
"EVERYONE_ROLE": "Internal/everyone",
|
|
233
|
+
"OAUTH2_TOKEN_ISS": "http://<KEYCLOAK_HOST>:8080/auth/realms/testingtoolkit",
|
|
234
|
+
"OAUTH2_ISSUER": "http://<KEYCLOAK_HOST>:8080/auth/realms/testingtoolkit/protocol/openid-connect/token",
|
|
235
|
+
"EMBEDDED_CERTIFICATE": "-----BEGIN PUBLIC KEY-----\n<PUBLIC_KEY_COPIED_FROM_KEYCLOAK>\n-----END PUBLIC KEY-----"
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
* Change the following values of the service mojaloop-testing-toolkit-ui in _'docker-compose.yml'_
|
|
240
|
+
```
|
|
241
|
+
environment:
|
|
242
|
+
- API_BASE_URL=http://localhost:5050
|
|
243
|
+
- AUTH_ENABLED=TRUE
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### 5. Configure the Connection Manager
|
|
247
|
+
|
|
248
|
+
#### 5.1 Enable oAuth authentication in Connection Manager
|
|
249
|
+
|
|
250
|
+
* Change the environment variables of the service 'connection-manager-api' in the _'connection-manager/docker-compose.yml'_
|
|
251
|
+
```
|
|
252
|
+
environment:
|
|
253
|
+
DATABASE_HOST: connection-manager-db
|
|
254
|
+
DATABASE_PORT: 3306
|
|
255
|
+
DATABASE_USER: mcm
|
|
256
|
+
DATABASE_PASSWORD: mcm
|
|
257
|
+
DATABASE_SCHEMA: mcm
|
|
258
|
+
MYSQL_ROOT_PASSWORD: <MYSQL_PASSWORD>
|
|
259
|
+
PORT: 5061
|
|
260
|
+
P12_PASS_PHRASE: 'SOME_S3C4R3_P@SS'
|
|
261
|
+
OAUTH2_ISSUER: http://<KEYCLOAK_HOST>:8080/auth/realms/testingtoolkit/protocol/openid-connect/token
|
|
262
|
+
OAUTH2_TOKEN_ISS: http://<KEYCLOAK_HOST>:8080/auth/realms/testingtoolkit
|
|
263
|
+
AUTH_ENABLED: 'TRUE'
|
|
264
|
+
APP_OAUTH_CLIENT_KEY: ttk
|
|
265
|
+
MTA_ROLE: 'Application/MTA'
|
|
266
|
+
PTA_ROLE: 'Application/PTA'
|
|
267
|
+
EVERYONE_ROLE: 'Internal/everyone'
|
|
268
|
+
APP_OAUTH_CLIENT_SECRET: <CLIENT_SECRET>
|
|
269
|
+
EMBEDDED_CERTIFICATE: |-
|
|
270
|
+
-----BEGIN PUBLIC KEY-----
|
|
271
|
+
<PUBLIC_KEY_COPIED_FROM_KEYCLOAK>
|
|
272
|
+
-----END PUBLIC KEY-----
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
* Change the environment variables of the service 'connection-manager-ui' in the _'connection-manager/docker-compose.yml'_
|
|
276
|
+
```
|
|
277
|
+
environment:
|
|
278
|
+
- API_BASE_URL=http://localhost:5050
|
|
279
|
+
- AUTH_ENABLED=TRUE
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
Now you can login with the username user1 in both testing toolkit UI and connection manager UI
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# Mojaloop Testing Toolkit
|
|
2
|
+
|
|
3
|
+
## _Onboarding DFSP_
|
|
4
|
+
|
|
5
|
+
**Table of Contents**
|
|
6
|
+
|
|
7
|
+
1. [Running the toolkit](#1-running-the-toolkit)
|
|
8
|
+
|
|
9
|
+
2. [Settings](#2-settings)
|
|
10
|
+
|
|
11
|
+
3. [Run collections](#3-run-collections)
|
|
12
|
+
|
|
13
|
+
3.1 [Web UI](#31-web-ui)
|
|
14
|
+
|
|
15
|
+
3.1.1 [Import Collection](#311-import-collection)
|
|
16
|
+
|
|
17
|
+
3.1.2 [Import Environment](#312-import-environment)
|
|
18
|
+
|
|
19
|
+
3.1.3 [Execute Collection](#313-execute-collection)
|
|
20
|
+
|
|
21
|
+
3.1.4 [View Report](#314-view-report)
|
|
22
|
+
|
|
23
|
+
3.2 [CLI tool](#32-cli-tool)
|
|
24
|
+
|
|
25
|
+
3.2.1 [Help Screen](#321-help-screen)
|
|
26
|
+
|
|
27
|
+
3.2.2 [Execute Collection](#322-execute-collection)
|
|
28
|
+
|
|
29
|
+
3.2.3 [View Report](#323-view-report)
|
|
30
|
+
|
|
31
|
+
## 1. Running the toolkit
|
|
32
|
+
|
|
33
|
+
The following softwares should be installed on your system to run the toolkit.
|
|
34
|
+
|
|
35
|
+
* Git
|
|
36
|
+
* Docker
|
|
37
|
+
|
|
38
|
+
Please execute the following lines to build and run the tool.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
git clone https://github.com/mojaloop/ml-testing-toolkit
|
|
42
|
+
cd ml-testing-toolkit
|
|
43
|
+
docker-compose up
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
To update the **Mojaloop Testing Toolkit** to the latest version and rebuild, please run the following
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cd ml-testing-toolkit
|
|
50
|
+
git pull
|
|
51
|
+
docker-compose build
|
|
52
|
+
docker-compose up
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
You should get the web interface on http://localhost:6060
|
|
56
|
+
|
|
57
|
+
If you want to test the tool for the whole functionality like schema validation, additional validation and callback generation ..etc, you can initiate a transfer cycle from mojaloop simulator UI.
|
|
58
|
+
|
|
59
|
+
Please follow the below steps from the ml-testing-toolkit folder
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
cd simulator
|
|
63
|
+
docker-compose up
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The above command will start the services scheme-adapter, mojaloop-simulator and mojaloop-simulator-ui.
|
|
67
|
+
|
|
68
|
+
## 2 Settings
|
|
69
|
+
|
|
70
|
+
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.
|
|
71
|
+
|
|
72
|
+

|
|
73
|
+
|
|
74
|
+
The _**SETTINGS**_ navigation tab will open to the **SETTINGS** window. Below is the default view of this page.
|
|
75
|
+
|
|
76
|
+

|
|
77
|
+
|
|
78
|
+
- The **SETTINGS** window consist of the following two windows;
|
|
79
|
+
- On the left **Runtime Global Configuration** displays the actual configuration that is effectively active by the **Mojaloop Testing Toolkit** service.
|
|
80
|
+
- On the right **Edit Global Configuration** amongst a couple of other options, it allows you to edit the values manually. Should you elect to use other environment values you can disable the default values by selecting the _**Override with Environment Variable**_ option.
|
|
81
|
+
|
|
82
|
+
- In a default docker deployment, the environment values will be provided in the _local.env_ file in the project root directory.
|
|
83
|
+
|
|
84
|
+

|
|
85
|
+
|
|
86
|
+
## 3 Run Collections
|
|
87
|
+
|
|
88
|
+
### 3.1 Web UI
|
|
89
|
+
|
|
90
|
+
This sections will enable you to intiate requests from the testing toolkit to your DFSP implementation.
|
|
91
|
+
|
|
92
|
+
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.
|
|
93
|
+
|
|
94
|
+
Selecting the _**Outbound Request**_ navigation tab on the left side, the following will open in the main display window.
|
|
95
|
+
|
|
96
|
+

|
|
97
|
+
|
|
98
|
+
#### 3.1.1 Import Collection
|
|
99
|
+
|
|
100
|
+
By selecting the _**Import Collection**_ button, it will allow you to import a collection or multiple collections. For your exploration, sample collections are available under the project root directory under [/examples/collections](/examples/collections) sub directory. To select one of the sample files, on the file explorer window that poped up when you selected the _**Import Collection**_ button, navigate to [/examples/collections/dfsp](/examples/collections/dfsp) under the project root directory. Select the ```p2p_happy_path.json``` file to import into the **Mojaloop Testing Toolkit** application. This sample file consist of a couple of test samples. You could add more test cases by clicking on _Add Test Case_ button
|
|
101
|
+
|
|
102
|
+
#### 3.1.2 Import Environment
|
|
103
|
+
|
|
104
|
+
By selecting the _**Import Environment**_ button, it will allow you to import input values. For your exploration, sample environments are available under the project root directory under [/examples/environments](/examples/environments) sub directory. To select one of the sample files, on the file explorer window that poped up when you selected the _**Import Environment**_ button, navigate to [/examples/environments](/examples/environments) under the project root directory. Select the ```dfsp_local_environment.json``` file to import into the **Mojaloop Testing Toolkit** application. This sample file consist of a couple of input values.
|
|
105
|
+
|
|
106
|
+
It is possible to update the **Input Values** on the right hand side window. Additional input values can be added, by selecting the _**Add Input Value**_ button on the top right of this right hand side window. These values relates to the specified variable that you can select and use in any **Request** that you create. The process is straight forward. Provide a name for the new input value and click on the _**Add**_ button. To update values of exisiting variable(s) to the **Input Values**, simply select the value next to the variable and type in a new value. It will then be available for use in the test cases imported earlier.
|
|
107
|
+
|
|
108
|
+
#### 3.1.3 Execute Collection
|
|
109
|
+
|
|
110
|
+
You could execute the whole template by clicking on _Send_ button in the top right corner.
|
|
111
|
+
|
|
112
|
+
#### 3.1.4 View Report
|
|
113
|
+
|
|
114
|
+
You could download a report in several formats by clicking on _Download Report_ in the top right corner:
|
|
115
|
+
- JSON
|
|
116
|
+
- HTML
|
|
117
|
+
- Printer Friendly HTML
|
|
118
|
+
|
|
119
|
+
### 3.2 CLI tool
|
|
120
|
+
|
|
121
|
+
#### 3.2.1 Help screen
|
|
122
|
+
|
|
123
|
+
The help screen allows you to see the usage, possible options and default values
|
|
124
|
+
|
|
125
|
+
command:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
node src/cli_client/client -h
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
output:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
Usage: client [options]
|
|
135
|
+
|
|
136
|
+
Options:
|
|
137
|
+
-v, --version output the version number
|
|
138
|
+
-c, --config <config> default configuration: {"mode": "outbound", "reportFormat": "json"}
|
|
139
|
+
-m, --mode <mode> default: "outbound" --- supported modes: "monitoring", "outbound"
|
|
140
|
+
-i, --input-files <inputFiles> csv list of json files or directories; required when the mode is "outbound" --- supported formats: "json"
|
|
141
|
+
-e, --environment-file <environmentFile> required when the mode is "outbound" --- supported formats: "json"
|
|
142
|
+
--report-format <reportFormat> default: "json" --- supported formats: "json", "html", "printhtml"
|
|
143
|
+
--report-filename <reportFilename> default: generated by the backend
|
|
144
|
+
-h, --help output usage information
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
#### 3.2.2 Execute Collection
|
|
148
|
+
|
|
149
|
+
command:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
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
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
output:
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
Listening on outboundProgress events...
|
|
159
|
+
████████████████████████████████████████ 100% | ETA: 0s | 3/3
|
|
160
|
+
--------------------TEST CASES--------------------
|
|
161
|
+
P2P Transfer Happy Path
|
|
162
|
+
Get party information - GET - /parties/{Type}/{ID} - [8/8]
|
|
163
|
+
Send quote - POST - /quotes - [11/11]
|
|
164
|
+
Send transfer - POST - /transfers - [9/9]
|
|
165
|
+
--------------------TEST CASES--------------------
|
|
166
|
+
┌───────────────────────────────────────────────────────┐
|
|
167
|
+
│ SUMMARY │
|
|
168
|
+
├───────────────────────┬───────────────────────────────┤
|
|
169
|
+
│ Total assertions │ 28 │
|
|
170
|
+
├───────────────────────┼───────────────────────────────┤
|
|
171
|
+
│ Passed assertions │ 28 │
|
|
172
|
+
├───────────────────────┼───────────────────────────────┤
|
|
173
|
+
│ Failed assertions │ 0 │
|
|
174
|
+
├───────────────────────┼───────────────────────────────┤
|
|
175
|
+
│ Total requests │ 3 │
|
|
176
|
+
├───────────────────────┼───────────────────────────────┤
|
|
177
|
+
│ Total test cases │ 1 │
|
|
178
|
+
├───────────────────────┼───────────────────────────────┤
|
|
179
|
+
│ Passed percentage │ 100.00% │
|
|
180
|
+
├───────────────────────┼───────────────────────────────┤
|
|
181
|
+
│ Started time │ Mon, 01 Jun 2020 14:46:20 GMT │
|
|
182
|
+
├───────────────────────┼───────────────────────────────┤
|
|
183
|
+
│ Completed time │ Mon, 01 Jun 2020 14:46:21 GMT │
|
|
184
|
+
├───────────────────────┼───────────────────────────────┤
|
|
185
|
+
│ Runtime duration │ 832 ms │
|
|
186
|
+
├───────────────────────┼───────────────────────────────┤
|
|
187
|
+
│ Average response time │ NA │
|
|
188
|
+
└───────────────────────┴───────────────────────────────┘
|
|
189
|
+
TTK-Assertion-Report-dfsp-p2p-tests-2020-06-01T14:46:21.303Z.html was generated
|
|
190
|
+
Terminate with exit code 0
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
#### 3.2.3 View Report
|
|
194
|
+
|
|
195
|
+
You will find the report in the project folder.
|
|
196
|
+
|
|
197
|
+
- default name format: 'TTK-Assertion-Report-{collection-name}-{ISO-date}.{report-format}'
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
# Mojaloop Testing Toolkit
|
|
3
|
+
|
|
4
|
+
## _Onboarding HUB_
|
|
5
|
+
|
|
6
|
+
**Table of Contents**
|
|
7
|
+
|
|
8
|
+
1. [Running the toolkit](#1-running-the-toolkit)
|
|
9
|
+
|
|
10
|
+
2. [Settings](#2-settings)
|
|
11
|
+
|
|
12
|
+
3. [Run collections](#3-run-collections)
|
|
13
|
+
|
|
14
|
+
3.1 [Web UI](#31-web-ui)
|
|
15
|
+
|
|
16
|
+
3.1.1 [Import Collection](#311-import-collection)
|
|
17
|
+
|
|
18
|
+
3.1.2 [Import Environment](#312-import-environment)
|
|
19
|
+
|
|
20
|
+
3.1.3 [Execute Collection](#313-execute-collection)
|
|
21
|
+
|
|
22
|
+
3.1.4 [View Report](#314-view-report)
|
|
23
|
+
|
|
24
|
+
3.2 [CLI tool](#32-cli-tool)
|
|
25
|
+
|
|
26
|
+
3.2.1 [Help Screen](#321-help-screen)
|
|
27
|
+
|
|
28
|
+
3.2.2 [Execute Collection](#322-execute-collection)
|
|
29
|
+
|
|
30
|
+
3.2.3 [View Report](#323-view-report)
|
|
31
|
+
|
|
32
|
+
## 1. Running the toolkit
|
|
33
|
+
|
|
34
|
+
The following softwares should be installed on your system to run the toolkit.
|
|
35
|
+
|
|
36
|
+
* Git
|
|
37
|
+
* Docker
|
|
38
|
+
|
|
39
|
+
Please execute the following lines to build and run the tool.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
git clone https://github.com/mojaloop/ml-testing-toolkit
|
|
43
|
+
cd ml-testing-toolkit
|
|
44
|
+
docker-compose up
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
To update the **Mojaloop Testing Toolkit** to the latest version and rebuild, please run the following
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
cd ml-testing-toolkit
|
|
51
|
+
git pull
|
|
52
|
+
docker-compose build
|
|
53
|
+
docker-compose up
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
You should get the web interface on http://localhost:6060
|
|
57
|
+
|
|
58
|
+
## 2 Settings
|
|
59
|
+
|
|
60
|
+
Setup database
|
|
61
|
+
|
|
62
|
+
After executing hub setup collection (Refer mojaloop documentation for more information), click on **Load Sample** button
|
|
63
|
+
in Outbound Requests section and import examples/collections/provisioning/testingtoolkitdfsp.json collection from provisioning tab
|
|
64
|
+
and examples/environments/hub_local_environment.json environment from hub tab
|
|
65
|
+
|
|
66
|
+
The _**SETTINGS**_ navigation tab will open to the **SETTINGS** window. Below is the default view of this page.
|
|
67
|
+
|
|
68
|
+

|
|
69
|
+
|
|
70
|
+
- The **SETTINGS** window consist of the following two sections;
|
|
71
|
+
- On the left **Runtime Global Configuration** displays the actual configuration that is effectively active by the **Mojaloop Testing Toolkit** service.
|
|
72
|
+
- On the right **Edit Global Configuration** amongst a couple of other options, it allows you to edit the values manually. Should you elect to use other environment values you can disable the default values by selecting the _**Override with Environment Variable**_ option.
|
|
73
|
+
|
|
74
|
+
- In a default docker deployment, the environment values will be provided in the _local.env_ file in the project root directory.
|
|
75
|
+
|
|
76
|
+

|
|
77
|
+
|
|
78
|
+
## 3 Run Collections
|
|
79
|
+
|
|
80
|
+
### 3.1 Web UI
|
|
81
|
+
|
|
82
|
+
This sections will enable you to intiate requests from the testing toolkit to your DFSP implementation.
|
|
83
|
+
|
|
84
|
+
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.
|
|
85
|
+
|
|
86
|
+
Selecting the _**Outbound Request**_ navigation tab on the left side, the following will open in the main display window.
|
|
87
|
+
|
|
88
|
+

|
|
89
|
+
|
|
90
|
+
#### 3.1.1 Import Collection
|
|
91
|
+
|
|
92
|
+
By selecting the _**Import Collection**_ button, it will allow you to import a collection or multiple collections. For your exploration, sample collections are available under the project root directory under [/examples/collections](/examples/collections) sub directory. To select one of the sample files, on the file explorer window that poped up when you selected the _**Import Collection**_ button, navigate to [/examples/collections/dfsp](/examples/collections/dfsp) under the project root directory. Select the ```p2p_happy_path.json``` file to import into the **Mojaloop Testing Toolkit** application. This sample file consist of a couple of test samples. You could add more test cases by clicking on _Add Test Case_ button
|
|
93
|
+
|
|
94
|
+
#### 3.1.2 Import Environment
|
|
95
|
+
|
|
96
|
+
By selecting the _**Import Environment**_ button, it will allow you to import input values. For your exploration, sample environments are available under the project root directory under [/examples/environments](/examples/environments) sub directory. To select one of the sample files, on the file explorer window that poped up when you selected the _**Import Environment**_ button, navigate to [/examples/environments](/examples/environments) under the project root directory. Select the ```dfsp_local_environment.json``` file to import into the **Mojaloop Testing Toolkit** application. This sample file consist of a couple of input values.
|
|
97
|
+
|
|
98
|
+
It is possible to update the **Input Values** on the right hand side window. Additional input values can be added, by selecting the _**Add Input Value**_ button on the top right of this right hand side window. These values relates to the specified variable that you can select and use in any **Request** that you create. The process is straight forward. Provide a name for the new input value and click on the _**Add**_ button. To update values of exisiting variable(s) to the **Input Values**, simply select the value next to the variable and type in a new value. It will then be available for use in the test cases imported earlier.
|
|
99
|
+
|
|
100
|
+
#### 3.1.3 Execute Collection
|
|
101
|
+
|
|
102
|
+
_IMPORTANT_: please make sure that the environment is updated based on your setup or update input values before execution
|
|
103
|
+
|
|
104
|
+
You could execute the whole template by clicking on _Send_ button in the top right corner.
|
|
105
|
+
|
|
106
|
+
#### 3.1.4 View Report
|
|
107
|
+
|
|
108
|
+
You could download a report in several formats by clicking on _Download Report_ in the top right corner:
|
|
109
|
+
- JSON
|
|
110
|
+
- HTML
|
|
111
|
+
- Printer Friendly HTML
|
|
112
|
+
|
|
113
|
+
### 3.2 CLI tool
|
|
114
|
+
|
|
115
|
+
#### 3.2.1 Help screen
|
|
116
|
+
|
|
117
|
+
The help screen allows you to see the usage, possible options and default values
|
|
118
|
+
|
|
119
|
+
command:
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
node src/cli_client/client -h
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
output:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
Usage: client [options]
|
|
129
|
+
|
|
130
|
+
Options:
|
|
131
|
+
-v, --version output the version number
|
|
132
|
+
-c, --config <config> default configuration: {"mode": "outbound", "reportFormat": "json"}
|
|
133
|
+
-m, --mode <mode> default: "outbound" --- supported modes: "monitoring", "outbound"
|
|
134
|
+
-i, --input-files <inputFiles> csv list of json files or directories; required when the mode is "outbound" --- supported formats: "json"
|
|
135
|
+
-e, --environment-file <environmentFile> required when the mode is "outbound" --- supported formats: "json"
|
|
136
|
+
--report-format <reportFormat> default: "json" --- supported formats: "json", "html", "printhtml"
|
|
137
|
+
--report-filename <reportFilename> default: generated by the backend
|
|
138
|
+
-h, --help output usage information
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
#### 3.2.2 Execute Collection
|
|
142
|
+
|
|
143
|
+
command:
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
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
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
output:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
Listening on outboundProgress events...
|
|
153
|
+
████████████████████████████████████████ 100% | ETA: 0s | 3/3
|
|
154
|
+
--------------------TEST CASES--------------------
|
|
155
|
+
P2P Transfer Happy Path
|
|
156
|
+
Get party information - GET - /parties/{Type}/{ID} - [8/8]
|
|
157
|
+
Send quote - POST - /quotes - [11/11]
|
|
158
|
+
Send transfer - POST - /transfers - [9/9]
|
|
159
|
+
--------------------TEST CASES--------------------
|
|
160
|
+
┌───────────────────────────────────────────────────────┐
|
|
161
|
+
│ SUMMARY │
|
|
162
|
+
├───────────────────────┬───────────────────────────────┤
|
|
163
|
+
│ Total assertions │ 28 │
|
|
164
|
+
├───────────────────────┼───────────────────────────────┤
|
|
165
|
+
│ Passed assertions │ 28 │
|
|
166
|
+
├───────────────────────┼───────────────────────────────┤
|
|
167
|
+
│ Failed assertions │ 0 │
|
|
168
|
+
├───────────────────────┼───────────────────────────────┤
|
|
169
|
+
│ Total requests │ 3 │
|
|
170
|
+
├───────────────────────┼───────────────────────────────┤
|
|
171
|
+
│ Total test cases │ 1 │
|
|
172
|
+
├───────────────────────┼───────────────────────────────┤
|
|
173
|
+
│ Passed percentage │ 100.00% │
|
|
174
|
+
├───────────────────────┼───────────────────────────────┤
|
|
175
|
+
│ Started time │ Mon, 01 Jun 2020 14:46:20 GMT │
|
|
176
|
+
├───────────────────────┼───────────────────────────────┤
|
|
177
|
+
│ Completed time │ Mon, 01 Jun 2020 14:46:21 GMT │
|
|
178
|
+
├───────────────────────┼───────────────────────────────┤
|
|
179
|
+
│ Runtime duration │ 832 ms │
|
|
180
|
+
├───────────────────────┼───────────────────────────────┤
|
|
181
|
+
│ Average response time │ NA │
|
|
182
|
+
└───────────────────────┴───────────────────────────────┘
|
|
183
|
+
TTK-Assertion-Report-dfsp-p2p-tests-2020-06-01T14:46:21.303Z.html was generated
|
|
184
|
+
Terminate with exit code 0
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
#### 3.2.3 View Report
|
|
188
|
+
|
|
189
|
+
You will find the report in the project folder.
|
|
190
|
+
|
|
191
|
+
- default name format: 'TTK-Assertion-Report-{collection-name}-{ISO-date}.{report-format}'
|