account-lookup-service 17.13.0-snapshot.8 → 17.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/CHANGELOG.md +12 -0
- package/package.json +3 -4
- package/src/domain/parties/putParties.js +1 -1
- package/src/domain/parties/services/BasePartiesService.js +1 -1
- package/src/domain/parties/services/PutPartiesErrorService.js +4 -5
- package/test/unit/domain/parties/parties.test.js +5 -6
- package/test/unit/domain/parties/services/PutPartiesErrorService.test.js +5 -5
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,18 @@
|
|
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
|
+
## [17.13.0](https://github.com/mojaloop/account-lookup-service/compare/v17.12.10...v17.13.0) (2025-09-16)
|
6
|
+
|
7
|
+
|
8
|
+
### Features
|
9
|
+
|
10
|
+
* **oss-4203:** added validation of local destination for external source ([#574](https://github.com/mojaloop/account-lookup-service/issues/574)) ([8ca46d6](https://github.com/mojaloop/account-lookup-service/commit/8ca46d6bbacbf30bb4b6dcc739df970e1b46d268))
|
11
|
+
|
12
|
+
|
13
|
+
### Chore
|
14
|
+
|
15
|
+
* **sbom:** update sbom [skip ci] ([f68b088](https://github.com/mojaloop/account-lookup-service/commit/f68b088b9fa01b96682761bfb946048ea24de54f))
|
16
|
+
|
5
17
|
### [17.12.10](https://github.com/mojaloop/account-lookup-service/compare/v17.12.9...v17.12.10) (2025-09-10)
|
6
18
|
|
7
19
|
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "account-lookup-service",
|
3
3
|
"description": "Account Lookup Service is used to validate Party and Participant lookups.",
|
4
|
-
"version": "17.13.0
|
4
|
+
"version": "17.13.0",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"author": "ModusBox",
|
7
7
|
"contributors": [
|
@@ -91,7 +91,7 @@
|
|
91
91
|
"@hapi/hapi": "21.4.3",
|
92
92
|
"@hapi/inert": "7.1.0",
|
93
93
|
"@hapi/vision": "7.0.3",
|
94
|
-
"@mojaloop/central-services-error-handling": "13.1.2
|
94
|
+
"@mojaloop/central-services-error-handling": "13.1.2",
|
95
95
|
"@mojaloop/central-services-health": "15.1.0",
|
96
96
|
"@mojaloop/central-services-logger": "11.9.3",
|
97
97
|
"@mojaloop/central-services-metrics": "12.7.1",
|
@@ -101,7 +101,7 @@
|
|
101
101
|
"@mojaloop/event-sdk": "14.7.0",
|
102
102
|
"@mojaloop/inter-scheme-proxy-cache-lib": "2.6.0",
|
103
103
|
"@mojaloop/ml-schema-transformer-lib": "2.7.8",
|
104
|
-
"@mojaloop/sdk-standard-components": "19.
|
104
|
+
"@mojaloop/sdk-standard-components": "19.17.0",
|
105
105
|
"@now-ims/hapi-now-auth": "2.1.0",
|
106
106
|
"ajv": "8.17.1",
|
107
107
|
"ajv-keywords": "5.1.0",
|
@@ -124,7 +124,6 @@
|
|
124
124
|
"postcss": {
|
125
125
|
"nanoid": "^3.3.8"
|
126
126
|
},
|
127
|
-
"@mojaloop/central-services-error-handling": "13.1.2-snapshot.0",
|
128
127
|
"@mojaloop/central-services-health": {
|
129
128
|
"@mojaloop/central-services-logger": ">=11.4.0"
|
130
129
|
},
|
@@ -47,7 +47,7 @@ const services = require('./services')
|
|
47
47
|
* @param {IProxyCache} [proxyCache] - IProxyCache instance
|
48
48
|
*/
|
49
49
|
const putPartiesByTypeAndID = async (headers, params, method, payload, dataUri, cache, proxyCache = undefined) => {
|
50
|
-
//
|
50
|
+
// think, if we need to pass span here
|
51
51
|
const component = putPartiesByTypeAndID.name
|
52
52
|
const histTimerEnd = Metrics.getHistogram(
|
53
53
|
component,
|
@@ -172,7 +172,7 @@ class BasePartiesService {
|
|
172
172
|
* @returns {Promise<{ fspId: string, partySubIdOrType?: string }[]>} List of parties from oracle response
|
173
173
|
*/
|
174
174
|
async sendOracleDiscoveryRequest () {
|
175
|
-
this.stepInProgress('
|
175
|
+
this.stepInProgress('sendOracleDiscoveryRequest')
|
176
176
|
const { headers, params, query } = this.inputs
|
177
177
|
|
178
178
|
const response = await this.deps.oracle.oracleRequest(headers, RestMethods.GET, params, query, undefined, this.deps.cache)
|
@@ -30,8 +30,9 @@ const BasePartiesService = require('./BasePartiesService')
|
|
30
30
|
class PutPartiesErrorService extends BasePartiesService {
|
31
31
|
async handleRequest () {
|
32
32
|
if (this.state.proxyEnabled && this.state.proxy) {
|
33
|
-
const alsReq = this.deps.partiesUtils.alsRequestDto(this.state.destination, this.inputs.params)
|
33
|
+
const alsReq = this.deps.partiesUtils.alsRequestDto(this.state.destination, this.inputs.params)
|
34
34
|
const isInterSchemeDiscoveryCase = await this.deps.proxyCache.isPendingCallback(alsReq)
|
35
|
+
this.log.verbose(`isInterSchemeDiscoveryCase: ${isInterSchemeDiscoveryCase}`, this.state)
|
35
36
|
|
36
37
|
if (isInterSchemeDiscoveryCase) {
|
37
38
|
const isLast = await this.checkLastProxyCallback(alsReq)
|
@@ -42,11 +43,9 @@ class PutPartiesErrorService extends BasePartiesService {
|
|
42
43
|
} else {
|
43
44
|
const isExternal = await this.#isPartyFromExternalDfsp()
|
44
45
|
if (isExternal) {
|
45
|
-
this.log.info('
|
46
|
+
this.log.info('need to cleanup oracle coz party is from external DFSP')
|
46
47
|
await this.cleanupOracle()
|
47
|
-
await this.removeProxyGetPartiesTimeoutCache(alsReq)
|
48
|
-
await this.sendPartyResolutionErrorCallback() // todo: think, if we need this?
|
49
|
-
return
|
48
|
+
await this.removeProxyGetPartiesTimeoutCache(alsReq) // think if we need this
|
50
49
|
}
|
51
50
|
}
|
52
51
|
}
|
@@ -947,10 +947,10 @@ describe('Parties Tests', () => {
|
|
947
947
|
Config.PROXY_CACHE_CONFIG.enabled = true
|
948
948
|
const errorCode = MojaloopApiErrorCodes.PAYEE_IDENTIFIER_NOT_VALID.code
|
949
949
|
const payload = fixtures.errorCallbackResponseDto({ errorCode })
|
950
|
-
const
|
950
|
+
const dataUri = encodePayload(JSON.stringify(payload), 'application/json')
|
951
951
|
const destination = `dest-${Date.now()}`
|
952
952
|
const proxy = `proxy-${Date.now()}`
|
953
|
-
const headers = fixtures.partiesCallHeadersDto({
|
953
|
+
const headers = fixtures.partiesCallHeadersDto({ destination, proxy })
|
954
954
|
const { params } = Helper.putByTypeIdRequest
|
955
955
|
participant.validateParticipant = sandbox.stub().resolves(null) // external participant
|
956
956
|
participant.sendRequest = sandbox.stub().resolves()
|
@@ -963,7 +963,7 @@ describe('Parties Tests', () => {
|
|
963
963
|
data: { partyList: [{ fspId: 'fspId' }] }
|
964
964
|
})
|
965
965
|
|
966
|
-
await partiesDomain.putPartiesErrorByTypeAndID(headers, params, payload,
|
966
|
+
await partiesDomain.putPartiesErrorByTypeAndID(headers, params, payload, dataUri, null, null, proxyCache)
|
967
967
|
|
968
968
|
expect(oracle.oracleRequest.callCount).toBe(2)
|
969
969
|
expect(oracle.oracleRequest.lastCall.args[1]).toBe(RestMethods.DELETE)
|
@@ -972,9 +972,8 @@ describe('Parties Tests', () => {
|
|
972
972
|
// eslint-disable-next-line no-unused-vars
|
973
973
|
const [sentTo, _, data, cbHeaders] = participant.sendErrorToParticipant.lastCall.args
|
974
974
|
expect(sentTo).toBe(proxy)
|
975
|
-
expect(cbHeaders[Headers.FSPIOP.DESTINATION]).toBe(
|
976
|
-
expect(
|
977
|
-
expect(data.errorInformation.errorCode).toBe('2006')
|
975
|
+
expect(cbHeaders[Headers.FSPIOP.DESTINATION]).toBe(destination)
|
976
|
+
expect(JSON.parse(data).errorInformation.errorCode).toBe(errorCode)
|
978
977
|
})
|
979
978
|
})
|
980
979
|
})
|
@@ -46,15 +46,15 @@ describe('PutPartiesErrorService Tests -->', () => {
|
|
46
46
|
oracle.oracleRequest = jest.fn().mockResolvedValue({
|
47
47
|
data: { partyList: [{ fspId: 'fspId' }] }
|
48
48
|
})
|
49
|
-
const source = 'externalSource'
|
50
49
|
const destination = 'externalDestination'
|
51
50
|
const proxyDest = 'proxyDest'
|
52
51
|
const deps = createMockDeps({ oracle, participant })
|
53
52
|
deps.proxyCache.lookupProxyByDfspId = jest.fn().mockResolvedValue(proxyDest)
|
54
53
|
|
55
|
-
const headers = fixtures.partiesCallHeadersDto({
|
54
|
+
const headers = fixtures.partiesCallHeadersDto({ destination, proxy: 'proxyA' })
|
56
55
|
const params = fixtures.partiesParamsDto()
|
57
|
-
const
|
56
|
+
const data = { test: true }
|
57
|
+
const dataUri = fixtures.dataUriDto(data)
|
58
58
|
|
59
59
|
const service = new PutPartiesErrorService(deps, { headers, params, dataUri })
|
60
60
|
await service.handleRequest()
|
@@ -65,8 +65,8 @@ describe('PutPartiesErrorService Tests -->', () => {
|
|
65
65
|
|
66
66
|
const [sentTo, , payload, cbHeaders] = participant.sendErrorToParticipant.mock.lastCall
|
67
67
|
expect(sentTo).toBe(proxyDest)
|
68
|
-
expect(cbHeaders[Headers.FSPIOP.DESTINATION]).toBe(
|
69
|
-
expect(payload
|
68
|
+
expect(cbHeaders[Headers.FSPIOP.DESTINATION]).toBe(destination)
|
69
|
+
expect(payload).toBe(JSON.stringify(data))
|
70
70
|
})
|
71
71
|
|
72
72
|
test('should NOT cleanup oracle if destination is local', async () => {
|