Skip to content

Commit

Permalink
feat!: add iso 20022 compatibility (#383)
Browse files Browse the repository at this point in the history
* feat(mojaloop/#3689): fx quotes pov implementation (#326)

* chore(snapshot): 15.8.0-snapshot.11

* fix(mojaloop/#3689): fx quotes fixes (#328)

* fix(mojaloop/#3689): fx quotes bug fix (#329)

* feat: enable sending events directly to Kafka (#332)

* feat(mojaloop/#3933): update participant accounts validation (#333)

feat(mojaloop/#3933): update participant accounts validation
- Added validation for `supportedCurrencies` when present in `POST /quotes` request (payer DFSP must have position account for all supported currencies
- Added validation for `payeeReceiveAmount` currency when present (payee DFSP must have position account for the `payeeReceiveAmount` currency)
- Fixed error handling to prevent sending double error callbacks
- Ensure top-level tracing spans are finished correctly
- Updated integration tests harness to support new changes
- Added integration tests for the use case
- Updated dependencies and resolve audit issues

* add check for db on api, fix docker compose

* chore(snapshot): 15.8.0-snapshot.17

* disable coverage, fix image scan

* chore(snapshot): 15.8.0-snapshot.18

* disable coverage, fix image scan

* chore(snapshot): 15.8.0-snapshot.19

* image scan

* chore(snapshot): 15.8.0-snapshot.20

* revert

* chore(snapshot): 15.8.0-snapshot.21

* feat: allow UUID v7 in the API patterns (#334)

* feat(csi-20 & csi-164): parameterize 'switch' id (#339)

* fix: quotes participants validation (#340)

* fix: quotes validation

* chore(snapshot): 15.8.0-snapshot.22

* fix: integration test

* chore: await in promise all

* fix: lint

* chore(snapshot): 15.8.0-snapshot.23

* chore(snapshot): 15.8.0-snapshot.24

* feat(mojaloop/#3991): add support for cross-network proxy routing (#341)

feat(mojaloop/#3991): add support for cross-network proxy routing (#341)
- Added proxy lib
- Added configuration for proxy
- Added unit and integration tests for proxy related functionalities

* fix: deps

* chore(snapshot): 15.8.0-snapshot.32

* feat(csi-334): updated proxyCache lib to use redis cluster (#342)

* feat(csi-334): updated proxyCache lib to use redis cluster

* chore(snapshot): 15.8.0-snapshot.33

* fix(csi-414): fixed TypeError - Cannot read properties of undefined; updated proxyCache lib; added request logging (#344)

* feat(csi-334): updated proxyCache lib; added request logging

* fix(csi-414): fixed TypeError - Cannot read properties of undefined (reading 'value')

* fix(csi-414): updated deps

* chore(snapshot): 15.8.0-snapshot.34

* fix(csi-411): disable validation on proxied request (#346)

* disable validation

* disable validation

* unit tests

* int tests

* test

* remove

* update

* harden int tests

* fix

* update int tests for persistant mode

* fix unit

* fix(csi-498): generated accept/contentType headers based on requested resource; improved logging (#347)

* fix(csi-498): generated accept/contentType headers based on requested resource; improved logging

* fix(csi-498): updated deps

* chore(snapshot): 15.8.0-snapshot.35

* chore(snapshot): 15.8.0-snapshot.36

* fix(csi-498): generated accept/contentType headers based on requested resource; improved logging

* fix(csi-498): generated accept/contentType headers based on requested resource; improved logging

* feat(mojaloop/#3885): extend fxquote functionality to persistant mode (#348)

* database functions and model logic

* upgrade harness

* fix tests

* db unit test

* int tests

* lint

* fx quote error

* lint

* addressed comments

* comments

* feat(mojaloop/#3817): harden fx quotes (#345)

* fix(mojaloop/#3817): restore proxied source validation (#349)

* chore: renable coverage and improve coverage (#350)

* coverage

* improve coverage

* fix

* lint dep

* fix(csi-550): add logs to QuotesModel (#351)

* fix(csi-550): add logs to QuotesModel

* fix(csi-550): add logs to QuotesModel

* fix(csi-550): add logs to QuotesModel

* fix(csi-550): add logs to QuotesModel

* chore(snapshot): 15.8.0-snapshot.37

* fix(csi-550): added logs to QuotesModel.forwardQuoteRequest()

* chore(snapshot): 15.8.0-snapshot.38

* fix(csi-550): improved logs in QuotesModel

* chore(snapshot): 15.8.0-snapshot.39

* fix(csi-550): improved logs in QuotesModel for handleQuoteRequest

* chore(snapshot): 15.8.0-snapshot.40

* fix: await transaction commit and rollback and avoid unhandledPromise error (#354)

* feat: add ULID support (#355)

* fix: regex

* fix: merge conflict

* test: start using mojaloop/build orb (#358)

* chore: version

* chore(release): [ci skip] 15.9.0-iso.0

* chore: continuous deployment

* chore(release): [ci skip] 15.9.0-iso.1

* feat(csi-107): add iso-20022 support (#357)

* feat(csi-107): added ISO openApi yaml

* feat(csi-107): added ISO openApi yaml

* feat(csi-107): added iso openApi yaml; added transformerLib

* feat(csi-107): skipped failed validation tests

* feat(csi-107): added isIsoApi config; made messageFromRequestDto async

* feat(csi-107): added isFxRequest util

* feat(csi-107): added PAYLOAD_STORAGES; update messageFromRequestDto input format

* feat(csi-107): added payloadCache

* feat(csi-107): added payloadCache

* feat(csi-107): added context-field

* feat(csi-107): added HapiRawPayload plugin

* feat(csi-107): fixed audit:check

* feat(csi-107): added QS-iso, added int tests

* feat(csi-107): moved context inside content

* feat(csi-107): used dataUri to store originalPayload

* feat(csi-107): updated transformerLib; stored payload in kafka as object

* feat(csi-107): fixed int-tests; ignored some places for test coverage

* chore(snapshot): 15.8.0-snapshot.44

* feat(csi-107): updated transformLib

* feat(csi-107): added ISO openApi yaml

* feat(csi-107): added ISO openApi yaml

* feat(csi-107): added iso openApi yaml; added transformerLib

* feat(csi-107): skipped failed validation tests

* feat(csi-107): added isIsoApi config; made messageFromRequestDto async

* feat(csi-107): added isFxRequest util

* feat(csi-107): added PAYLOAD_STORAGES; update messageFromRequestDto input format

* feat(csi-107): added payloadCache

* feat(csi-107): added payloadCache

* feat(csi-107): added context-field

* feat(csi-107): added HapiRawPayload plugin

* feat(csi-107): fixed audit:check

* feat(csi-107): added QS-iso, added int tests

* feat(csi-107): moved context inside content

* feat(csi-107): used dataUri to store originalPayload

* feat(csi-107): updated transformerLib; stored payload in kafka as object

* feat(csi-107): fixed int-tests; ignored some places for test coverage

* feat(csi-107): updated transformLib

* chore(release): [ci skip] 15.9.0-iso.2

* feat(csi-107): added initPayloadCache; added payloadCache to QH (#360)

* feat(csi-107): added initPayloadCache; added payloadCache to QH

* feat(csi-107): added APY_TYPE support to QH

* feat(csi-107): fixed addOriginalPayload logic

* feat(csi-107): fixed ISO header for /quotes

* feat(csi-107): fixed ISO header for /quotes

* chore(release): [ci skip] 15.9.0-iso.3

* chore: continuous deployment

* chore(release): [ci skip] 15.9.0-iso.4

* build: test package.json version

* build: test package.json version

* chore(release): [ci skip] 15.9.0-iso.5

* feat(csi-107): fixed /fxQuotes payload transforming (#362)

* feat(csi-107): fixed /fxQuotes payload transforming

* feat(csi-107): skipped ISO e2e tests

* feat(csi-107): removed some todos

* chore(release): [ci skip] 15.9.0-iso.6

* fix(csi-107): fixed QSh iso callback (#364)

* chore(release): [ci skip] 15.9.0-iso.7

* feat(csi-107): refactor QSh to avoid using API_TYPE env var (#365)

* feat(csi-107): refactor QSh to avoid using API_TYPE env var

* feat(csi-107): refactor QSh to avoid using API_TYPE env var

* chore(snapshot): 15.9.0-snapshot.0

* feat(csi-107): refactor QSh to avoid using API_TYPE env var

* feat(csi-107): fixed ISO GET requests

* feat(csi-107): fixed ISO GET requests

* chore(release): [ci skip] 15.9.0-iso.8

* feat(csi-107): updated transformLib

* chore(release): [ci skip] 15.9.0-iso.9

* feat(csi-107): fixed PUT /fxQuotes/error ISO callback

* chore(release): [ci skip] 15.9.0-iso.10

* chore: update iso api spec and dependencies (#366)

* chore: update iso api spec and dependencies

* chore: coverage...oddly

* chore(release): [ci skip] 15.9.0-iso.11

* chore: update deps and api (#367)

* chore: update deps

* chore: update api

* chore(release): [ci skip] 15.9.0-iso.12

* feat: call rules during fx quote (#361)

* chore(release): [ci skip] 15.9.0-iso.13

* fix: pass proxyClient to _fetchParticipantInfo in fxQuotesModel

* chore: dependencies

* test: update expected history length in fxQuotes integration test

* chore(release): [ci skip] 15.9.0-iso.14

* chore: forward put error callbacks (#368)

* chore(release): [ci skip] 15.9.0-iso.15

* chore: use the central-services-metrics plugin (#369)

* chore(release): [ci skip] 15.9.0-iso.16

* chore: update dependencies

* chore(release): [ci skip] 15.9.0-iso.17

* chore: update dependencies

* chore(release): [ci skip] 15.9.0-iso.18

* feat(csi-927): used common loggingPlugin (#373)

* chore(release): [ci skip] 15.9.0-iso.19

* chore: standardize egress audit and un-stringify payload (#375)

* chore: standardize egress audit and un-stringify payload

* chore: address comments

* chore(release): [ci skip] 15.9.0-iso.20

* chore: use the central-services-metrics plugin

* chore(release): [ci skip] 15.9.0-iso.21

* feat: add error counters for metrics (#378)

* feat: add error counters for metrics

* feat: add error counters for metrics

* chore: tests

* chore: tests

* chore: more metrics

* chore: add steps

* chore: better metrics

* chore: coverage

* chore(release): [ci skip] 15.9.0-iso.22

* chore: refactor error metrics (#381)

* chore: refactor error metrics

* chore: refactor error metrics

* chore: refactor error metrics

* chore: operations

* chore: use lib

* chore: fix init

* chore: dep

* chore(release): [ci skip] 15.9.0-iso.23

* chore: minor/iso dependency updates pi26 (#377)

* chore(release): [ci skip] 15.9.0-iso-depdency-updates-pi26.0

* chore: update dependencies and create custom operators for json-rules-engine

* chore(release): [ci skip] 15.9.0-iso-depdency-updates-pi26.1

* chore: fix hoek vulnerability

fixed by removing unused good-console and good-squeeze which are deprecated as of 2020

* chore(release): [ci skip] 15.9.0-iso-depdency-updates-pi26.2

* chore(release): [ci skip] 15.9.0-iso-depdency-updates-pi26.3

* chore: sync versions in package json and lock

* chore: sync versions in package json and lock

* chore(release): [ci skip] 15.9.0-iso-depdency-updates-pi26.5

---------

Co-authored-by: mojaloopci <info@mojaloop.io>

* fix: monorepo (#382)

* chore: copilot suggestions

* chore: todos

* chore(release): [ci skip] 16.1.0-iso.0

* chore: comments

* chore(release): [ci skip] 16.1.0-iso.1

---------

Co-authored-by: Steven Oderayi <oderayi@gmail.com>
Co-authored-by: Kalin Krustev <kalin.krustev@gmail.com>
Co-authored-by: vijayg10 <33152110+vijayg10@users.noreply.github.com>
Co-authored-by: Eugen Klymniuk <keramet.kh@gmail.com>
Co-authored-by: geka.evk <geka.evk@gmail.com>
Co-authored-by: mojaloopci <info@mojaloop.io>
Co-authored-by: Juan Correa <gibaros@users.noreply.github.com>
  • Loading branch information
8 people authored Jan 18, 2025
1 parent 8d664cf commit 8406c75
Show file tree
Hide file tree
Showing 77 changed files with 12,290 additions and 4,189 deletions.
871 changes: 5 additions & 866 deletions .circleci/config.yml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,5 @@ typings/
# https://devspace.sh/
devspace*
.devspace/**.*

.rush
3 changes: 2 additions & 1 deletion .ncurc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Add a comment indicating the reason for each rejected dependency upgrade added to this list, and what should be done to resolve it (i.e. handle it through a story, etc).
reject: [
"json-rules-engine"
"json-rules-engine",
"eslint"
]
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ USER root
WORKDIR /opt/app

RUN apk --no-cache add git
RUN apk add --no-cache -t build-dependencies make gcc g++ py3-setuptools python3 libtool openssl-dev autoconf automake bash \
RUN apk add --no-cache -t build-dependencies make gcc g++ python3 py3-setuptools libtool openssl-dev autoconf automake bash \
&& cd $(npm root -g)/npm

COPY package.json package-lock.json* /opt/app/
Expand Down
9 changes: 2 additions & 7 deletions audit-ci.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
// Only use one of ["low": true, "moderate": true, "high": true, "critical": true]
"moderate": true,
"allowlist": [
"GHSA-qgmg-gppg-76g5", // https://github.com/advisories/GHSA-qgmg-gppg-76g5 Mock data generator for swagger api, not a security concern at this time.
"GHSA-c429-5p7v-vgjp", // https://github.com/advisories/GHSA-c429-5p7v-vgjp
"GHSA-8hc4-vh64-cxmj", // https://github.com/advisories/GHSA-8hc4-vh64-cxmj
"GHSA-952p-6rrq-rcjv", // https://github.com/advisories/GHSA-952p-6rrq-rcjv
"GHSA-pppg-cpfq-h7wr", // https://github.com/advisories/GHSA-pppg-cpfq-h7wr Patch not released yet
"GHSA-3xgq-45jj-v275" // https://github.com/advisories/GHSA-3xgq-45jj-v275
"GHSA-mwcw-c2x4-8c55" // https://github.com/advisories/GHSA-mwcw-c2x4-8c55
]
}
}
11 changes: 11 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
},
"HOSTNAME": "http://quoting-service",
"LISTEN_ADDRESS": "0.0.0.0",
"API_TYPE": "fspiop",
"PORT": 3002,
"MONITORING_PORT": 3003,
"AMOUNT": {
Expand Down Expand Up @@ -89,6 +90,16 @@
]
}
},
"ORIGINAL_PAYLOAD_STORAGE": "",
"PAYLOAD_CACHE": {
"enabled": true,
"type": "redis-cluster",
"connectionConfig": {
"cluster": [
{ "host": "localhost", "port": 6379 }
]
}
},
"LOG_LEVEL": "info",
"KAFKA": {
"CONSUMER": {
Expand Down
22 changes: 21 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ x-quoting-service: &quotingServiceBase
- CSL_LOG_TRANSPORT=file
volumes:
- ./docker/quoting-service/default.json:/opt/app/config/default.json
# think, how to use ./config/default.json inside docker-compose
- ./secrets/:/opt/app/secrets/
depends_on:
<<: *dependsOnMysqlAndKafka
Expand Down Expand Up @@ -58,9 +57,24 @@ services:
- "19229:9229"
container_name: qs_quoting-service

quoting-service-iso:
<<: *quotingServiceBase
command: npm start
environment:
- LOG_LEVEL=debug
- QUOTE_API_TYPE=iso20022
# - QUOTE_ORIGINAL_PAYLOAD_STORAGE=redis
- QUOTE_ORIGINAL_PAYLOAD_STORAGE=kafka
ports:
- "13002:3002"
- "39229:9229"
container_name: qs_quoting-service-iso

quoting-service-handler:
<<: *quotingServiceBase
command: npm run start:handlers:debug
environment:
- LOG_LEVEL=debug
ports:
- "3003:3003"
- "29229:9229"
Expand Down Expand Up @@ -113,6 +127,7 @@ services:

# To use with proxyCache.type === 'redis-cluster'
redis-node-0:
container_name: redis-node-0
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
Expand All @@ -125,34 +140,39 @@ services:
- redis-node-4
- redis-node-5
redis-node-1:
container_name: redis-node-1
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6380
ports:
- "16380:16380"
redis-node-2:
container_name: redis-node-2
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6381
ports:
- "16381:16381"
redis-node-3:
container_name: redis-node-3
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6382
ports:
- "16382:16382"
redis-node-4:
container_name: redis-node-4
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6383
ports:
- "16383:16383"
redis-node-5:
container_name: redis-node-5
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
Expand Down
18 changes: 16 additions & 2 deletions docker/quoting-service/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
},
"HOSTNAME": "http://quoting-service",
"LISTEN_ADDRESS": "0.0.0.0",
"LOG_LEVEL": "debug",
"PORT": 3002,
"MONITORING_PORT": 3003,
"AMOUNT": {
Expand All @@ -13,15 +14,18 @@
},
"PROTOCOL_VERSIONS": {
"CONTENT": {
"DEFAULT": "1.1",
"DEFAULT": "2.0",
"VALIDATELIST": [
"2.0",
"1.1",
"1.0"
]
},
"ACCEPT": {
"DEFAULT": "1",
"DEFAULT": "2",
"VALIDATELIST": [
"2",
"2.0",
"1",
"1.0",
"1.1"
Expand Down Expand Up @@ -86,6 +90,16 @@
]
}
},
"ORIGINAL_PAYLOAD_STORAGE": "",
"PAYLOAD_CACHE": {
"enabled": true,
"type": "redis-cluster",
"connectionConfig": {
"cluster": [
{ "host": "redis-node-0", "port": 6379 }
]
}
},
"KAFKA": {
"CONSUMER": {
"QUOTE": {
Expand Down
8 changes: 3 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const path = require('path')
process.env.LOG_LEVEL = 'debug'

module.exports = {
verbose: true,
clearMocks: true, // to avoid jest.clearAllMocks() in afterEach

collectCoverageFrom: [
'**/src/**/**/*.js'
],
Expand All @@ -15,9 +17,5 @@ module.exports = {
branches: 90,
lines: 90
}
},
globals: {
__SRC__: path.resolve(__dirname, 'src'),
__ROOT__: path.resolve(__dirname)
}
}
Loading

0 comments on commit 8406c75

Please sign in to comment.