From b79b94183cc05175086e4c5e773de057124548f7 Mon Sep 17 00:00:00 2001 From: Miguel de Barros Date: Tue, 12 Nov 2019 11:49:06 +0000 Subject: [PATCH 1/3] Updates to support story #1059 - Updated scheme-adapter.env with missing configs - Fixed OUTBOUND_ENDPOINT on sim-backend.env - Added 'container_name' to docker-compose.yml --- src/docker-compose.yml | 43 ++++++++++++++------------- src/scheme-adapter.env | 66 ++++++++++++++++++++++++++++++++++++++---- src/sim-backend.env | 2 +- 3 files changed, 85 insertions(+), 26 deletions(-) diff --git a/src/docker-compose.yml b/src/docker-compose.yml index acbafa1f..7a55296e 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -1,22 +1,25 @@ version: '3' services: - redis: - image: "redis:5.0.4-alpine" - sim: - image: "mojaloop-simulator-backend" - build: ../ - env_file: ./sim-backend.env - ports: - - "3000:3000" - - "3001:3001" - - "3003:3003" - depends_on: - - scheme-adapter - scheme-adapter: - image: "mojaloop/sdk-scheme-adapter:latest" - env_file: ./scheme-adapter.env - ports: - - "3500:3000" - - "3501:4000" - depends_on: - - redis \ No newline at end of file + redis: + container_name: redis + image: "redis:5.0.4-alpine" + sim: + container_name: sim + image: "mojaloop-simulator-backend" + build: ../ + env_file: ./sim-backend.env + ports: + - "3000:3000" + - "3001:3001" + - "3003:3003" + depends_on: + - scheme-adapter + scheme-adapter: + container_name: scheme-adapter + image: "mojaloop/sdk-scheme-adapter:latest" + env_file: ./scheme-adapter.env + ports: + - "3500:3000" + - "3501:4000" + depends_on: + - redis diff --git a/src/scheme-adapter.env b/src/scheme-adapter.env index ab0c2791..81511cda 100644 --- a/src/scheme-adapter.env +++ b/src/scheme-adapter.env @@ -10,10 +10,23 @@ OUTBOUND_LISTEN_PORT=4001 # environment, i.e. when you're running it locally against your own implementation. MUTUAL_TLS_ENABLED=false +# Enable verification or incoming JWS signatures +# Note that signatures will be required on incoming messages +# and will be validated against a public key. +VALIDATE_INBOUND_JWS=false + +# applicable only if VALIDATE_INBOUND_JWS is "true" +# allows disabling of validation on incoming PUT /parties/{idType}/{idValue} requests +VALIDATE_INBOUND_PUT_PARTIES_JWS=false + # Enable JWS verification and signing VALIDATE_INBOUND_JWS=false JWS_SIGN=true +# applicable only if JWS_SIGN is "true" +# allows disabling of signing on outgoing PUT /parties/{idType}/{idValue} requests +JWS_SIGN_PUT_PARTIES=false + # Path to JWS signing key (private key of THIS DFSP) JWS_SIGNING_KEY_PATH=/jwsSigningKey.key JWS_VERIFICATION_KEYS_DIRECTORY=/jwsVerificationKeys @@ -31,20 +44,26 @@ OUT_CLIENT_KEY_PATH=./secrets/serverkey.pem # will each be printed on a single line. LOG_INDENT=0 -# The DFSPID of this simulator. The simulator will accept any requests routed to -# FSPIOP-Destination: $DFSP_ID. Other requests will be rejected. -DFSP_ID=payeefsp - # REDIS cache connection CACHE_HOST=redis CACHE_PORT=6379 -# Switch or DFSP system under test Mojaloop API endpoint +# SWITCH ENDPOINT +# The option 'PEER_ENDPOINT' has no effect if the remaining three options 'ALS_ENDPOINT', 'QUOTES_ENDPOINT', 'TRANSFERS_ENDPOINT' are specified. PEER_ENDPOINT=172.21.0.5:4000 +# Common Account Lookup System (ALS) +# ALS_ENDPOINT=account-lookup-service.local +# QUOTES_ENDPOINT=quoting-service.local +# TRANSFERS_ENDPOINT=ml-api-adapter.local + # Simulator backend container endpoint BACKEND_ENDPOINT=sim:3000 +# The DFSPID of this simulator. The simulator will accept any requests routed to +# FSPIOP-Destination: $DFSP_ID. Other requests will be rejected. +DFSP_ID=payeefsp + # Secret used for generation and verification of secure ILP ILP_SECRET=Quaixohyaesahju3thivuiChai5cahng @@ -56,8 +75,45 @@ EXPIRY_SECONDS=60 # confirmation call will be required to complete the final transfer stage. AUTO_ACCEPT_QUOTES=false +# if set to false the SDK will not automatically accept a resolved party +# but will halt the transer after a party lookup response is received. A further +# cnofirmation call will be required to progress the transfer to quotes state. +AUTO_ACCEPT_PARTY=false + +# when set to true, when sending money via the outbound API, the SDK will use the value +# of FSPIOP-Source header from the received quote response as the payeeFsp value in the +# transfer prepare request body instead of the value received in the payee party lookup. +# This behaviour should be enabled when the SDK user DFSP is in a forex enabled switch +# ecosystem and expects quotes and transfers to be rerouted by the switch to forex +# entities i.e. forex providing DFSPs. Please see the SDK documentation and switch +# operator documentation for more information on forex use cases. +USE_QUOTE_SOURCE_FSP_AS_TRANSFER_PAYEE_FSP=false + # set to true to validate ILP, otherwise false to ignore ILP CHECK_ILP=true # set to true to enable test features such as request cacheing and retrieval endpoints ENABLE_TEST_FEATURES=true + +# set to true to mock WSO2 oauth2 token endpoint +ENABLE_OAUTH_TOKEN_ENDPOINT=false +OAUTH_TOKEN_ENDPOINT_CLIENT_KEY=test-client-key +OAUTH_TOKEN_ENDPOINT_CLIENT_SECRET=test-client-secret +OAUTH_TOKEN_ENDPOINT_LISTEN_PORT=6000 + +# WS02 Bearer Token specific to golden-fsp instance and environment +WS02_BEARER_TOKEN=7718fa9b-be13-3fe7-87f0-a12cf1628168 + +# OAuth2 data used to obtain WSO2 bearer token +OAUTH_TOKEN_ENDPOINT= +OAUTH_CLIENT_KEY= +OAUTH_CLIENT_SECRET= +OAUTH_REFRESH_SECONDS=3600 + +# Set to true to respect expirity timestamps +REJECT_EXPIRED_QUOTE_RESPONSES=false +REJECT_TRANSFERS_ON_EXPIRED_QUOTES=false +REJECT_EXPIRED_TRANSFER_FULFILS=false + +# Timeout for GET/POST/DELETE - PUT flow processing +REQUEST_PROCESSING_TIMEOUT_SECONDS=30 diff --git a/src/sim-backend.env b/src/sim-backend.env index b10c58d3..e8b2074d 100644 --- a/src/sim-backend.env +++ b/src/sim-backend.env @@ -30,7 +30,7 @@ DFSP_ID=golden MODEL_DATABASE=./model.sqlite # Outbound API endpoint (It might be a container in the compose file so remember the networking IP) -OUTBOUND_ENDPOINT=http://scheme-adapter-sim:4001 +OUTBOUND_ENDPOINT=http://scheme-adapter:4001 # The simulator can automatically add fees when generating quote responses. Use this # variable to control the fee amounts added. e.g. for a transfer of 100 USD a FEE_MULTIPLIER of 0.1 From 14ae8c4348788ebd0ac75c92183f3ec3da782dc4 Mon Sep 17 00:00:00 2001 From: Miguel de Barros Date: Tue, 12 Nov 2019 11:51:14 +0000 Subject: [PATCH 2/3] Generalised the PEER_ENDPOINT in scheme-adapter.env --- src/scheme-adapter.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scheme-adapter.env b/src/scheme-adapter.env index 81511cda..a910f9b2 100644 --- a/src/scheme-adapter.env +++ b/src/scheme-adapter.env @@ -50,7 +50,7 @@ CACHE_PORT=6379 # SWITCH ENDPOINT # The option 'PEER_ENDPOINT' has no effect if the remaining three options 'ALS_ENDPOINT', 'QUOTES_ENDPOINT', 'TRANSFERS_ENDPOINT' are specified. -PEER_ENDPOINT=172.21.0.5:4000 +PEER_ENDPOINT=api-gateway.local:4000 # Common Account Lookup System (ALS) # ALS_ENDPOINT=account-lookup-service.local From 526b707f89e927aff2e84ef6b0d9d0785297efc6 Mon Sep 17 00:00:00 2001 From: Miguel de Barros Date: Tue, 12 Nov 2019 11:52:17 +0000 Subject: [PATCH 3/3] Updated switch-endpoint description in scheme-adapter.env --- src/scheme-adapter.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scheme-adapter.env b/src/scheme-adapter.env index a910f9b2..17aba85b 100644 --- a/src/scheme-adapter.env +++ b/src/scheme-adapter.env @@ -48,7 +48,7 @@ LOG_INDENT=0 CACHE_HOST=redis CACHE_PORT=6379 -# SWITCH ENDPOINT +# SWITCH ENDPOINT - Switch or DFSP system under test Mojaloop API endpoint # The option 'PEER_ENDPOINT' has no effect if the remaining three options 'ALS_ENDPOINT', 'QUOTES_ENDPOINT', 'TRANSFERS_ENDPOINT' are specified. PEER_ENDPOINT=api-gateway.local:4000