Skip to content

Commit

Permalink
feat!: add ws client to pull updated configuration (#147)
Browse files Browse the repository at this point in the history
* feat: add ws client to pull updated configuration

* chore: rebuild package lock

* chore: fix

* chore: audit

* chore: dep update

* chore: reconfig

* chore: test

* chore: config changes

* chore: fix

* chore: fix

* chore: fix

* chore: update

* chore: dep

* chore: doc

* chore: comment

* chore: dep audit

* chore: replace standard-version

* chore(snapshot): 14.1.0-snapshot.0

* chore: address comments, update config, doc

* chore: audit, lint, dep

* chore: line

* chore: line
  • Loading branch information
kleyow authored Jun 16, 2022
1 parent 17fd37b commit 6e2e2a8
Show file tree
Hide file tree
Showing 69 changed files with 6,499 additions and 3,705 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ RUN adduser -D app-user
USER app-user
COPY --chown=app-user --from=builder /opt/app/ ./

EXPOSE 4005 4006
EXPOSE 4005 4006 4010
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,18 @@ This package exemplifies the use of the Mojaloop SDK Standard Components for TLS
and they handle the rest.

config.INBOUND.TLS represents the certs needed by the `thirdparty-sdk` Hapi Inbound server.

## PM4ML (Payment Manager for Mojaloop) (In progress)

This project has the option of being configured to work with [PM4ML](https://github.com/pm4ml) which connects to
[MCM](https://github.com/modusbox/connection-manager-api).

Setting `pm4mlEnabled` to `true` and configuring `control.mgmtAPIWsUrl` and `control.mgmtAPIWsPort` to
a [Management API service](https://github.com/pm4ml/mojaloop-payment-manager-management-api) instance
will connect to and listen to the Management API service for
management protocol messages e.g configuration changes, certificate updates etc and restart the server
with updated configuration.

## Integration Test
To run integration tests, first start `docker-compose` in root folder

Expand Down
175 changes: 165 additions & 10 deletions audit-resolve.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
},
"1070030|widdershins>markdown-it": {
"decision": "ignore",
"madeAt": 1653061084517,
"expiresAt": 1655653080778
"madeAt": 1655349503443,
"expiresAt": 1657941497879
},
"1068155|@mojaloop/central-services-shared>@mojaloop/event-sdk>lodash>moment>axios>shins>markdown-it>sanitize-html": {
"decision": "ignore",
Expand All @@ -52,13 +52,13 @@
},
"1067553|swagger2openapi>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1652763283304,
"expiresAt": 1655355269733
"madeAt": 1655349506477,
"expiresAt": 1657941497879
},
"1067946|swagger2openapi>better-ajv-errors>jsonpointer>oas-validator>ajv": {
"decision": "ignore",
"madeAt": 1652763284397,
"expiresAt": 1655355269733
"madeAt": 1655349507506,
"expiresAt": 1657941497879
},
"1068310|widdershins>markdown-it>yargs>yargs-parser": {
"decision": "ignore",
Expand Down Expand Up @@ -102,8 +102,8 @@
},
"1070030|shins>markdown-it": {
"decision": "ignore",
"madeAt": 1653056846332,
"expiresAt": 1655648843496
"madeAt": 1654268545556,
"expiresAt": 1656860541597
},
"1068310|@mojaloop/central-services-shared>@mojaloop/event-sdk>moment>widdershins>markdown-it>yargs>yargs-parser": {
"decision": "ignore",
Expand Down Expand Up @@ -172,8 +172,163 @@
},
"1070412|ejs": {
"decision": "ignore",
"madeAt": 1653669237396,
"expiresAt": 1656261231609
"madeAt": 1655349502448,
"expiresAt": 1657941497879
},
"1070449|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs": {
"decision": "ignore",
"madeAt": 1654222963857,
"expiresAt": 1656814959015
},
"1070449|@mojaloop/sdk-scheme-adapter>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs": {
"decision": "ignore",
"madeAt": 1654222963857,
"expiresAt": 1656814959015
},
"1070030|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>markdown-it": {
"decision": "ignore",
"madeAt": 1654222968580,
"expiresAt": 1656814959015
},
"1070030|@mojaloop/sdk-scheme-adapter>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>markdown-it": {
"decision": "ignore",
"madeAt": 1654222968580,
"expiresAt": 1656814959015
},
"1068155|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>markdown-it>sanitize-html": {
"decision": "ignore",
"madeAt": 1654222969644,
"expiresAt": 1656814959015
},
"1068155|@mojaloop/sdk-scheme-adapter>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>markdown-it>sanitize-html": {
"decision": "ignore",
"madeAt": 1654222969644,
"expiresAt": 1656814959015
},
"1070260|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>markdown-it>sanitize-html": {
"decision": "ignore",
"madeAt": 1654222970908,
"expiresAt": 1656814959015
},
"1070260|@mojaloop/sdk-scheme-adapter>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>markdown-it>sanitize-html": {
"decision": "ignore",
"madeAt": 1654222970908,
"expiresAt": 1656814959015
},
"1070030|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>widdershins>markdown-it": {
"decision": "ignore",
"madeAt": 1654268545556,
"expiresAt": 1656860541597
},
"1070030|@mojaloop/sdk-scheme-adapter>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>widdershins>markdown-it": {
"decision": "ignore",
"madeAt": 1654268545556,
"expiresAt": 1656860541597
},
"1068310|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>widdershins>markdown-it>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1654268546350,
"expiresAt": 1656860541597
},
"1068310|@mojaloop/sdk-scheme-adapter>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>widdershins>markdown-it>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1654268546351,
"expiresAt": 1656860541597
},
"1070483|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs": {
"decision": "ignore",
"madeAt": 1654855425468,
"expiresAt": 1657447419729
},
"1070483|@mojaloop/sdk-scheme-adapter>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs": {
"decision": "ignore",
"madeAt": 1654855425468,
"expiresAt": 1657447419729
},
"1070412|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>ejs": {
"decision": "ignore",
"madeAt": 1655349502448,
"expiresAt": 1657941497879
},
"1070412|@mojaloop/sdk-scheme-adapter>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>ejs": {
"decision": "ignore",
"madeAt": 1655349502448,
"expiresAt": 1657941497879
},
"1070030|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>ejs>markdown-it": {
"decision": "ignore",
"madeAt": 1655349503443,
"expiresAt": 1657941497879
},
"1070030|@mojaloop/sdk-scheme-adapter>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>ejs>markdown-it": {
"decision": "ignore",
"madeAt": 1655349503443,
"expiresAt": 1657941497879
},
"1068155|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>ejs>markdown-it>sanitize-html": {
"decision": "ignore",
"madeAt": 1655349504376,
"expiresAt": 1657941497879
},
"1068155|@mojaloop/sdk-scheme-adapter>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>ejs>markdown-it>sanitize-html": {
"decision": "ignore",
"madeAt": 1655349504376,
"expiresAt": 1657941497879
},
"1070260|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>ejs>markdown-it>sanitize-html": {
"decision": "ignore",
"madeAt": 1655349505283,
"expiresAt": 1657941497879
},
"1070260|@mojaloop/sdk-scheme-adapter>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>ejs>markdown-it>sanitize-html": {
"decision": "ignore",
"madeAt": 1655349505283,
"expiresAt": 1657941497879
},
"1067553|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>ejs>markdown-it>sanitize-html>widdershins>swagger2openapi>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1655349506477,
"expiresAt": 1657941497879
},
"1067553|@mojaloop/sdk-scheme-adapter>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>ejs>markdown-it>sanitize-html>widdershins>swagger2openapi>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1655349506477,
"expiresAt": 1657941497879
},
"1067553|widdershins>markdown-it>swagger2openapi>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1655349506477,
"expiresAt": 1657941497879
},
"1067946|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>ejs>markdown-it>sanitize-html>widdershins>swagger2openapi>better-ajv-errors>jsonpointer>oas-validator>ajv": {
"decision": "ignore",
"madeAt": 1655349507506,
"expiresAt": 1657941497879
},
"1067946|@mojaloop/sdk-scheme-adapter>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>ejs>markdown-it>sanitize-html>widdershins>swagger2openapi>better-ajv-errors>jsonpointer>oas-validator>ajv": {
"decision": "ignore",
"madeAt": 1655349507506,
"expiresAt": 1657941497879
},
"1067946|widdershins>markdown-it>swagger2openapi>better-ajv-errors>jsonpointer>oas-validator>ajv": {
"decision": "ignore",
"madeAt": 1655349507506,
"expiresAt": 1657941497879
},
"1068310|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>ejs>markdown-it>sanitize-html>widdershins>swagger2openapi>better-ajv-errors>jsonpointer>oas-validator>ajv>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1655349508539,
"expiresAt": 1657941497879
},
"1068310|@mojaloop/sdk-scheme-adapter>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>ejs>markdown-it>sanitize-html>widdershins>swagger2openapi>better-ajv-errors>jsonpointer>oas-validator>ajv>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1655349508539,
"expiresAt": 1657941497879
},
"1068310|widdershins>markdown-it>swagger2openapi>better-ajv-errors>jsonpointer>oas-validator>ajv>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1655349508539,
"expiresAt": 1657941497879
}
},
"rules": {},
Expand Down
94 changes: 51 additions & 43 deletions config/development.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
"INBOUND": {
"PORT": 4005,
"HOST": "0.0.0.0",
"PISP_TRANSACTION_MODE": false,
"TLS": {
"control": {
"mgmtAPIWsUrl": "127.0.0.1",
"mgmtAPIWsPort": 4010
},
"inbound": {
"port": 4005,
"host": "0.0.0.0",
"pispTransactionMode": false,
"tls": {
"mutualTLS": {
"enabled": false
},
Expand All @@ -14,10 +18,10 @@
}
}
},
"OUTBOUND": {
"PORT": 4006,
"HOST": "0.0.0.0",
"TLS": {
"outbound": {
"port": 4006,
"host": "0.0.0.0",
"tls": {
"mutualTLS": {
"enabled": false
},
Expand All @@ -28,42 +32,46 @@
}
}
},
"REQUEST_PROCESSING_TIMEOUT_SECONDS": 30,
"WSO2_AUTH": {
"staticToken": "0706c62f-c022-3c42-8d14-8b5df128876d",
"tokenEndpoint": "",
"clientKey": "test-client-key",
"clientSecret": "test-client-secret",
"refreshSeconds": 3600
"requestProcessingTimeoutSeconds": 30,
"wso2": {
"auth": {
"staticToken": "0706c62f-c022-3c42-8d14-8b5df128876d",
"tokenEndpoint": "",
"clientKey": "test-client-key",
"clientSecret": "test-client-secret",
"refreshSeconds": 3600
}
},
"REDIS": {
"PORT": 6379,
"HOST": "redis",
"TIMEOUT": 100
"redis": {
"port": 6379,
"host": "redis",
"timeout": 100
},
"INSPECT": {
"DEPTH": 4,
"SHOW_HIDDEN": false,
"COLOR": true
"inspect": {
"depth": 4,
"showHidden": false,
"color": true
},
"SHARED": {
"PEER_ENDPOINT": "0.0.0.0:4003",
"ALS_ENDPOINT": "0.0.0.0:4002",
"QUOTES_ENDPOINT": "0.0.0.0:3002",
"TRANSFERS_ENDPOINT": "0.0.0.0:3000",
"BULK_TRANSFERS_ENDPOINT": "",
"DFSP_ID": "dfsp_a",
"DFSP_BACKEND_URI": "0.0.0.0:9000",
"DFSP_BACKEND_HTTP_SCHEME": "http",
"DFSP_BACKEND_VERIFY_AUTHORIZATION_PATH": "verify-authorization",
"DFSP_BACKEND_VERIFY_CONSENT_PATH": "verify-consent",
"SDK_REQUEST_TO_PAY_TRANSFER_URI": "0.0.0.0:9000/requestToPayTransfer",
"SDK_OUTGOING_URI": "0.0.0.0:7002",
"SDK_OUTGOING_HTTP_SCHEME": "http",
"SDK_OUTGOING_PARTIES_INFORMATION_PATH": "parties/{Type}/{ID}/{SubId}",
"SDK_NOTIFY_ABOUT_TRANSFER_URI": "localhost:9000/thirdpartyRequests/transactions/{ID}",
"JWS_SIGN": false,
"JWS_SIGNING_KEY": "./secrets/jwsSigningKey.key"
"shared": {
"peerEndpoint": "0.0.0.0:4003",
"alsEndpoint": "0.0.0.0:4002",
"quotesEndpoint": "0.0.0.0:3002",
"transfersEndpoint": "0.0.0.0:3000",
"bulkTransfersEndpoint": "",
"dfspId": "dfsp_a",
"dfspBackendUri": "0.0.0.0:9000",
"dfspBackendHttpScheme": "http",
"dfspBackendVerifyAuthorizationPath": "verify-authorization",
"dfspBackendVerifyConsentPath": "verify-consent",
"sdkRequestToPayTransferUri": "0.0.0.0:9000/requestToPayTransfer",
"sdkOutgoingUri": "0.0.0.0:7002",
"sdkOutgoingHttpScheme": "http",
"sdkOutgoingPartiesInformationPath": "parties/{Type}/{ID}/{SubId}",
"sdkNotifyAboutTransferUri": "localhost:9000/thirdpartyRequests/transactions/{ID}"
},
"PM4ML_ENABLED": false
"pm4mlEnabled": false,
"validateInboundJws": false,
"jwsSign": false,
"jwsSigningKey": "/jwsSigningKey.key",
"jwsVerificationKeysDirectory": null
}
Loading

0 comments on commit 6e2e2a8

Please sign in to comment.