@mojaloop/central-services-shared 18.35.1-snapshot.0 → 18.35.2
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
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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
|
+
### [18.35.2](https://github.com/mojaloop/central-services-shared/compare/v18.35.1...v18.35.2) (2026-01-28)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **iad-573:** fixed proxy-header validation ([#502](https://github.com/mojaloop/central-services-shared/issues/502)) ([4ac356f](https://github.com/mojaloop/central-services-shared/commit/4ac356f115bbb82a5a1b2ce781c954321958763a))
|
|
11
|
+
|
|
12
|
+
### [18.35.1](https://github.com/mojaloop/central-services-shared/compare/v18.35.0...v18.35.1) (2026-01-23)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **csi-2030:** added logic to validate fspiop-proxy header ([#501](https://github.com/mojaloop/central-services-shared/issues/501)) ([b22dd5a](https://github.com/mojaloop/central-services-shared/commit/b22dd5a2bbc31ed6fb37b54df6d7b23185274c51))
|
|
18
|
+
|
|
5
19
|
## [18.35.0](https://github.com/mojaloop/central-services-shared/compare/v18.34.6...v18.35.0) (2026-01-22)
|
|
6
20
|
|
|
7
21
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mojaloop/central-services-shared",
|
|
3
|
-
"version": "18.35.
|
|
3
|
+
"version": "18.35.2",
|
|
4
4
|
"description": "Shared code for mojaloop central services",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "ModusBox",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@opentelemetry/api": "1.9.0",
|
|
74
74
|
"async-exit-hook": "2.0.1",
|
|
75
75
|
"async-retry": "1.3.3",
|
|
76
|
-
"axios": "1.13.
|
|
76
|
+
"axios": "1.13.4",
|
|
77
77
|
"clone": "2.1.2",
|
|
78
78
|
"convict": "^6.2.4",
|
|
79
79
|
"dotenv": "17.2.3",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"audit-ci": "7.1.0",
|
|
110
110
|
"base64url": "3.0.1",
|
|
111
111
|
"chance": "1.1.13",
|
|
112
|
-
"npm-check-updates": "19.3.
|
|
112
|
+
"npm-check-updates": "19.3.2",
|
|
113
113
|
"nyc": "17.1.0",
|
|
114
114
|
"portfinder": "1.0.38",
|
|
115
115
|
"pre-commit": "1.2.2",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"tapes": "4.1.0"
|
|
126
126
|
},
|
|
127
127
|
"overrides": {
|
|
128
|
-
"axios": "1.13.
|
|
128
|
+
"axios": "1.13.4",
|
|
129
129
|
"qs": "6.14.1",
|
|
130
130
|
"brace-expansion": "2.0.2",
|
|
131
131
|
"form-data": "4.0.4",
|
|
@@ -159,7 +159,7 @@ const validateProxySourceHeaders = (headers = {}) => {
|
|
|
159
159
|
return
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
if (proxy && proxy !== clientId) {
|
|
162
|
+
if (proxy && (proxy !== clientId || proxy === source)) {
|
|
163
163
|
const errMessage = errorMessages.INVALID_PROXY_HEADER
|
|
164
164
|
logger.error(errMessage, { clientId, proxy, source })
|
|
165
165
|
throw createFSPIOPError(Enums.FSPIOPErrorCodes.VALIDATION_ERROR, errMessage)
|
|
@@ -412,7 +412,21 @@ Test('headerValidation plugin test', async (pluginTest) => {
|
|
|
412
412
|
t.is(statusCode, 202)
|
|
413
413
|
}))
|
|
414
414
|
|
|
415
|
-
vpshTests.test('should
|
|
415
|
+
vpshTests.test('should throw error if proxy-header equals source-header', tryCatchEndTest(async t => {
|
|
416
|
+
const fspiopCode = ErrorHandling.Enums.FSPIOPErrorCodes.VALIDATION_ERROR
|
|
417
|
+
const sameId = 'dfspABC'
|
|
418
|
+
|
|
419
|
+
const { statusCode, result } = await testServer.inject({
|
|
420
|
+
method: 'get',
|
|
421
|
+
url: `/${resource}`,
|
|
422
|
+
headers: headersDto({ source: sameId, proxy: sameId, xClientId: sameId })
|
|
423
|
+
})
|
|
424
|
+
t.is(statusCode, fspiopCode.httpStatusCode)
|
|
425
|
+
t.is(result?.apiErrorCode?.code, fspiopCode.code)
|
|
426
|
+
t.is(result?.message, errorMessages.INVALID_PROXY_HEADER)
|
|
427
|
+
}))
|
|
428
|
+
|
|
429
|
+
vpshTests.test('should not throw error if needProxySourceValidation is false', tryCatchEndTest(async t => {
|
|
416
430
|
const testServer = await init(false)
|
|
417
431
|
|
|
418
432
|
const { statusCode } = await testServer.inject({
|