account-lookup-service 15.6.0-snapshot.4 → 16.1.0-iso.1

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/LICENSE.md +3 -4
  3. package/README.md +2 -0
  4. package/audit-ci.jsonc +2 -27
  5. package/config/default.json +1 -0
  6. package/docker/mock-proxy/README.md +21 -0
  7. package/docker/mock-proxy/src/config.ts +7 -0
  8. package/docs/Proxy/Discovery.md +20 -0
  9. package/docs/Proxy/FXAPI_POC_payer_conversion_RECEIVE.plantuml +577 -0
  10. package/docs/Proxy/FXAPI_POC_payer_conversion_SEND.plantuml +1423 -0
  11. package/docs/Proxy/P2P.md +11 -0
  12. package/docs/Proxy/Proxy pattern - Happy path.plantuml +98 -0
  13. package/docs/Proxy/Proxy pattern - Lazy Discovery - No Oracles.plantuml +105 -0
  14. package/docs/Proxy/Proxy pattern - Lazy Discovery - No Oracles.png +0 -0
  15. package/docs/Proxy/Proxy pattern - Lazy Discovery - Oracles.plantuml +130 -0
  16. package/docs/Proxy/Proxy pattern - Lazy Discovery - Oracles.png +0 -0
  17. package/docs/Proxy/Proxy pattern - Lazy Discovery Identifier Cache Invalid.plantuml +72 -0
  18. package/docs/Proxy/Proxy pattern - Lazy Discovery Identifier Cache Invalid.png +0 -0
  19. package/docs/Proxy/Proxy pattern - P2P.plantuml +186 -0
  20. package/docs/Proxy/Proxy pattern - P2P.png +0 -0
  21. package/docs/Proxy/Proxy pattern - Unhappy path.plantuml +103 -0
  22. package/docs/Proxy/Proxy pattern - Unhappy path.png +0 -0
  23. package/docs/Proxy/Proxy pattern - happy path.png +0 -0
  24. package/docs/Proxy/Readme.md +39 -0
  25. package/docs/Proxy/SettingUpProxys.plantuml +31 -0
  26. package/docs/Proxy/SettingUpProxys.png +0 -0
  27. package/package.json +33 -18
  28. package/src/constants.js +1 -1
  29. package/src/domain/oracle/oracle.js +63 -4
  30. package/src/domain/participants/participants.js +246 -129
  31. package/src/domain/parties/getPartiesByTypeAndID.js +29 -8
  32. package/src/domain/parties/parties.js +33 -4
  33. package/src/domain/timeout/index.js +12 -1
  34. package/src/handlers/monitoring/index.js +1 -1
  35. package/src/interface/api-swagger-iso20022-parties.yaml +7 -6
  36. package/src/interface/api-swagger.yaml +7 -6
  37. package/src/lib/config.js +2 -1
  38. package/src/lib/db.js +2 -1
  39. package/src/models/currency/currency.js +10 -1
  40. package/src/models/endpointType/endpointType.js +10 -1
  41. package/src/models/oracle/facade.js +42 -16
  42. package/src/models/oracle/oracleEndpoint.js +65 -10
  43. package/src/models/oracle/oracleEndpointCached.js +29 -9
  44. package/src/models/participantEndpoint/facade.js +40 -4
  45. package/src/models/partyIdType/partyIdType.js +10 -1
  46. package/src/plugins.js +8 -21
  47. package/src/server.js +11 -0
  48. package/test/fixtures/index.js +29 -6
  49. package/test/unit/api/health.test.js +3 -0
  50. package/test/unit/api/participants/participants.test.js +5 -7
  51. package/test/unit/api/participants/{Type}/{ID}/{SubId}.test.js +0 -3
  52. package/test/unit/api/participants/{Type}/{ID}.test.js +0 -3
  53. package/test/unit/api/participants.test.js +36 -3
  54. package/test/unit/domain/oracle/oracle.test.js +8 -0
  55. package/test/unit/domain/participants/participants.test.js +83 -48
  56. package/test/unit/domain/parties/parties.test.js +10 -2
  57. package/test/unit/domain/timeout/index.test.js +8 -0
  58. package/test/unit/lib/config.test.js +7 -0
  59. package/test/unit/mocks.js +16 -11
  60. package/test/unit/models/oracle/oracleEndpointCached.test.js +32 -0
  61. package/test/unit/models/participantEndpoint/facade.test.js +4 -2
  62. package/test/unit/plugins.test.js +2 -2
  63. package/src/lib/requestLogger.js +0 -54
  64. package/src/metrics/handler.js +0 -33
  65. package/src/metrics/plugin.js +0 -52
  66. package/src/metrics/routes.js +0 -43
  67. package/test/unit/lib/requestLogger.test.js +0 -115
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [16.0.2](https://github.com/mojaloop/account-lookup-service/compare/v16.0.1...v16.0.2) (2025-01-07)
6
+
7
+
8
+ ### Chore
9
+
10
+ * dependency updates pi26 ([#516](https://github.com/mojaloop/account-lookup-service/issues/516)) ([08ef522](https://github.com/mojaloop/account-lookup-service/commit/08ef5226aacf5e7c0967f6912be9eec8480eecd8))
11
+
12
+ ### [16.0.1](https://github.com/mojaloop/account-lookup-service/compare/v16.0.0...v16.0.1) (2024-12-20)
13
+
14
+
15
+ ### Chore
16
+
17
+ * dependency and vulnerability updates pi26 ([#513](https://github.com/mojaloop/account-lookup-service/issues/513)) ([46d245a](https://github.com/mojaloop/account-lookup-service/commit/46d245ae04e6305408845ccd32d6abc07be6a5a8))
18
+
19
+ ## [16.0.0](https://github.com/mojaloop/account-lookup-service/compare/v15.3.4...v16.0.0) (2024-12-11)
20
+
21
+
22
+ ### ⚠ BREAKING CHANGES
23
+
24
+ * fx and interscheme implementation (#492)
25
+
26
+ ### Features
27
+
28
+ * fx and interscheme implementation ([#492](https://github.com/mojaloop/account-lookup-service/issues/492)) ([c44e5e0](https://github.com/mojaloop/account-lookup-service/commit/c44e5e019fb3092b789cfb07d37dbe087142a37d)), closes [#482](https://github.com/mojaloop/account-lookup-service/issues/482) [#483](https://github.com/mojaloop/account-lookup-service/issues/483)
29
+
5
30
  ### [15.3.4](https://github.com/mojaloop/account-lookup-service/compare/v15.3.3...v15.3.4) (2024-06-11)
6
31
 
7
32
 
package/LICENSE.md CHANGED
@@ -2,9 +2,8 @@
2
2
 
3
3
  Copyright © 2020-2024 Mojaloop Foundation
4
4
 
5
- The Mojaloop files are made available by the Mojaloop Foundation under the Apache License, Version 2.0
6
- (the "License") and you may not use these files except in compliance with the [License](http://www.apache.org/licenses/LICENSE-2.0).
5
+ The Mojaloop files are made available by the Mojaloop Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License.
7
6
 
8
- You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
7
+ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
9
8
 
10
- Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the [License](http://www.apache.org/licenses/LICENSE-2.0).
9
+ Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package/README.md CHANGED
@@ -10,6 +10,8 @@
10
10
  - [Documentation](http://docs.mojaloop.io/documentation/mojaloop-technical-overview/account-lookup-service/)
11
11
  - [API Swagger Reference](/src/interface/api-swagger.yaml)
12
12
  - [Admin Swagger Referemce](/src/interface/admin-swagger.yaml)
13
+ - [Discovery flow diagram using proxy](./docs/Proxy/Discovery.md)
14
+ - [Proxy implementation details](./docs/Proxy/Readme.md)
13
15
 
14
16
  ## Database initialisation
15
17
 
package/audit-ci.jsonc CHANGED
@@ -3,31 +3,6 @@
3
3
  // audit-ci supports reading JSON, JSONC, and JSON5 config files.
4
4
  // Only use one of ["low": true, "moderate": true, "high": true, "critical": true]
5
5
  "moderate": true,
6
- "allowlist": [ // NOTE: Please add as much information as possible to any items added to the allowList
7
- // Currently no fixes available for the following
8
- "GHSA-2p57-rm9w-gvfp", // socks>ip
9
- "GHSA-v88g-cgmw-v5xw",
10
- "GHSA-phwq-j96m-2c2q",
11
- "GHSA-282f-qqgm-c34q",
12
- "GHSA-6vfc-qv3f-vr6c",
13
- "GHSA-wc69-rhjr-hc9g",
14
- "GHSA-g954-5hwp-pp24",
15
- "GHSA-rjqq-98f6-6j3r",
16
- "GHSA-mjxr-4v3x-q3m4",
17
- "GHSA-qgmg-gppg-76g5",
18
- "GHSA-p9pc-299p-vxgp",
19
- "GHSA-8cf7-32gw-wr33",
20
- // The following issues are related to central-services-shared upgrade skip
21
- // Issue to resolve this: https://github.com/mojaloop/project/issues/3260
22
- "GHSA-hjrf-2m68-5959",
23
- "GHSA-qwph-4952-7xr6",
24
- "GHSA-4jv9-3563-23j3",
25
- "GHSA-h755-8qp9-cq85",
26
- "GHSA-f9xv-q969-pqx4",
27
- "GHSA-7fh5-64p2-3v2j",
28
- "GHSA-rm97-x556-q36h", // https://github.com/advisories/GHSA-rm97-x556-q36h
29
- "GHSA-rv95-896h-c2vc", // https://github.com/advisories/GHSA-rv95-896h-c2vc
30
- "GHSA-952p-6rrq-rcjv", // https://github.com/advisories/GHSA-952p-6rrq-rcjv
31
- "GHSA-3xgq-45jj-v275" // https://github.com/advisories/GHSA-3xgq-45jj-v275
32
- ]
6
+ // NOTE: Please add as much information as possible to any items added to the allowList
7
+ "allowlist": []
33
8
  }
@@ -15,6 +15,7 @@
15
15
  "DATABASE": "account_lookup",
16
16
  "POOL_MIN_SIZE": 10,
17
17
  "POOL_MAX_SIZE": 10,
18
+ "MAX_PENDING_ACQUIRE": null,
18
19
  "ACQUIRE_TIMEOUT_MILLIS": 30000,
19
20
  "CREATE_TIMEOUT_MILLIS": 30000,
20
21
  "DESTROY_TIMEOUT_MILLIS": 5000,
@@ -0,0 +1,21 @@
1
+ ## mock-proxy
2
+
3
+ This is a simple mock proxy server that can be used to emulate
4
+ `inter-scheme-proxy-adatper` functionality in integration tests
5
+
6
+ #### Routes
7
+ - `GET /history` - returns and array of requests made to the proxy.
8
+ It's used to assert some tests scenarios
9
+ - `DELETE /history` - cleans up history
10
+ - `ALL /echo` - returns request method, body, headers for testing purposes. Inject also some additional headers
11
+ - `GET /health` - Returns a JSON object indicating the health status of the server.
12
+ - `GET /parties/:type/:id` - Handles requests for party information. Responds with a 202 status and the request headers modified for the hub callback.
13
+ - `PUT /parties/:type/:id/error` - Handles error responses for party information. Responds with a 200 status and the request headers modified for the DFSP callback.
14
+ - `GET /oracle*` - Returns a JSON object with an empty party list.
15
+
16
+ #### Usage in integration tests
17
+ 1. In _docker-compose.yml_ file there's a service `proxy` defined. Some env vars are passed using [./test/integration/.env](../../test/integration/.env) file.
18
+ 2. Before running tests, we onboard some participants, including `proxy`, using [./test/integration/prepareTestParticipants.js](../../test/integration/prepareTestParticipants.js) script.
19
+ 3. Run tests and validate `proxy` calls (using _/history_ endpoint) according test scenarios.
20
+
21
+
@@ -9,6 +9,13 @@ export const {
9
9
  CL_PORT = 3001,
10
10
  } = process.env;
11
11
 
12
+ console.log({
13
+ PROXY_PORT,
14
+ PROXY_NAME,
15
+ CL_HOST,
16
+ CL_PORT
17
+ })
18
+
12
19
  export const ROUTES = {
13
20
  history: '/history',
14
21
  } as const;
@@ -0,0 +1,20 @@
1
+ # On Demand Discovery
2
+
3
+ The discovery flows are summarized as follows:
4
+ 1. On Demand loading of cross network identifiers - using Oracles for identifier lookups in local scheme
5
+ 2. On Demand loading for all identifiers
6
+
7
+ ## On Demand Discovery using local oracles
8
+ - Scheme uses Oracles to map local identifiers to participants of the scheme
9
+ - Identifiers for other schemes are discovered via a depth first search, but asking all participants. Proxy participant then forward the request to the connected scheme
10
+ - This diagram shows two connected schemes, but this design work for any number of connected schemes.
11
+
12
+ ![Proxy pattern - On Demand Discovery with Oracles](./Proxy%20pattern%20-%20Lazy%20Discovery%20-%20Oracles.png)
13
+
14
+
15
+ ## On Demand Discover with incorrectly cached results
16
+ - When an identifier moved to another dfsp provider, then the store cache for that participant will route to an unsuccessful get \parties call.
17
+
18
+ Here is a sequence diagram show how that gets updated.
19
+ ### Sequence Diagram
20
+ ![Invalid Cache](Proxy%20pattern%20-%20Lazy%20Discovery%20Identifier%20Cache%20Invalid.png)