@mojaloop/central-services-shared 18.35.6 → 18.35.7
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/.grype.yaml +39 -0
- package/.nvmrc +1 -1
- package/CHANGELOG.md +7 -0
- package/audit-ci.jsonc +14 -1
- package/package.json +26 -20
- package/src/util/hapi/plugins/headerValidation.js +4 -3
- package/test/unit/util/hapi/plugins/headerValidation.test.js +21 -6
package/.grype.yaml
CHANGED
|
@@ -7,6 +7,45 @@ ignore:
|
|
|
7
7
|
- vulnerability: GHSA-3ppc-4f35-3m26
|
|
8
8
|
include-aliases: true
|
|
9
9
|
reason: "Unfixable npm transitive vulnerability: minimatch ReDoS - fix requires v10 major version break as of 2026-02-19"
|
|
10
|
+
- vulnerability: GHSA-2w6w-674q-4c4q
|
|
11
|
+
include-aliases: true
|
|
12
|
+
reason: "Unfixable npm transitive vulnerability: handlebars (critical severity) as of 2026-04-07"
|
|
13
|
+
- vulnerability: GHSA-xjpj-3mr7-gcpf
|
|
14
|
+
include-aliases: true
|
|
15
|
+
reason: "Unfixable npm transitive vulnerability: handlebars (high severity) as of 2026-04-07"
|
|
16
|
+
- vulnerability: GHSA-3mfm-83xf-c92r
|
|
17
|
+
include-aliases: true
|
|
18
|
+
reason: "Unfixable npm transitive vulnerability: handlebars (high severity) as of 2026-04-07"
|
|
19
|
+
- vulnerability: GHSA-xhpv-hc6g-r9c6
|
|
20
|
+
include-aliases: true
|
|
21
|
+
reason: "Unfixable npm transitive vulnerability: handlebars (high severity) as of 2026-04-07"
|
|
22
|
+
- vulnerability: GHSA-25h7-pfq9-p65f
|
|
23
|
+
include-aliases: true
|
|
24
|
+
reason: "Unfixable npm transitive vulnerability: flatted (high severity) as of 2026-04-07"
|
|
25
|
+
- vulnerability: GHSA-9cx6-37pm-9jff
|
|
26
|
+
include-aliases: true
|
|
27
|
+
reason: "Unfixable npm transitive vulnerability: handlebars (high severity) as of 2026-04-07"
|
|
28
|
+
- vulnerability: GHSA-rf6f-7fwh-wjgh
|
|
29
|
+
include-aliases: true
|
|
30
|
+
reason: "Unfixable npm transitive vulnerability: flatted (high severity) as of 2026-04-07"
|
|
31
|
+
- vulnerability: GHSA-7rx3-28cr-v5wh
|
|
32
|
+
include-aliases: true
|
|
33
|
+
reason: "Unfixable npm transitive vulnerability: handlebars (moderate severity) as of 2026-04-07"
|
|
34
|
+
- vulnerability: GHSA-2qvq-rjwj-gvw9
|
|
35
|
+
include-aliases: true
|
|
36
|
+
reason: "Unfixable npm transitive vulnerability: handlebars (moderate severity) as of 2026-04-07"
|
|
37
|
+
- vulnerability: GHSA-442j-39wm-28r2
|
|
38
|
+
include-aliases: true
|
|
39
|
+
reason: "Unfixable npm transitive vulnerability: handlebars (low severity) as of 2026-04-07"
|
|
40
|
+
- vulnerability: GHSA-44fc-8fm5-q62h
|
|
41
|
+
include-aliases: true
|
|
42
|
+
reason: "Unfixable npm transitive vulnerability: unknown (unknown severity) as of 2026-04-07"
|
|
43
|
+
- vulnerability: GHSA-hf2r-9gf9-rwch
|
|
44
|
+
include-aliases: true
|
|
45
|
+
reason: "Unfixable npm transitive vulnerability: unknown (unknown severity) as of 2026-04-07"
|
|
46
|
+
- vulnerability: GHSA-48c2-rrv3-qjmp
|
|
47
|
+
include-aliases: true
|
|
48
|
+
reason: "Unfixable npm transitive vulnerability: unknown (unknown severity) as of 2026-04-07"
|
|
10
49
|
output:
|
|
11
50
|
- table
|
|
12
51
|
- json
|
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
22.22.
|
|
1
|
+
22.22.2
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
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.7](https://github.com/mojaloop/central-services-shared/compare/v18.35.6...v18.35.7) (2026-04-07)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* require Accept header for initiating methods per FSPIOP spec ([#516](https://github.com/mojaloop/central-services-shared/issues/516)) ([4d29c23](https://github.com/mojaloop/central-services-shared/commit/4d29c23464ceaf31961991fa82d6ac986d47e4d4)), closes [mojaloop/project#4183](https://github.com/mojaloop/project/issues/4183)
|
|
11
|
+
|
|
5
12
|
### [18.35.6](https://github.com/mojaloop/central-services-shared/compare/v18.35.5...v18.35.6) (2026-02-26)
|
|
6
13
|
|
|
7
14
|
|
package/audit-ci.jsonc
CHANGED
|
@@ -5,6 +5,19 @@
|
|
|
5
5
|
"moderate": true,
|
|
6
6
|
"allowlist": [ // NOTE: Please add as much information as possible to any items added to the allowList
|
|
7
7
|
"GHSA-2g4f-4pwh-qvx6",
|
|
8
|
-
"GHSA-3ppc-4f35-3m26"
|
|
8
|
+
"GHSA-3ppc-4f35-3m26",
|
|
9
|
+
"GHSA-2w6w-674q-4c4q",
|
|
10
|
+
"GHSA-xjpj-3mr7-gcpf",
|
|
11
|
+
"GHSA-3mfm-83xf-c92r",
|
|
12
|
+
"GHSA-xhpv-hc6g-r9c6",
|
|
13
|
+
"GHSA-25h7-pfq9-p65f",
|
|
14
|
+
"GHSA-9cx6-37pm-9jff",
|
|
15
|
+
"GHSA-rf6f-7fwh-wjgh",
|
|
16
|
+
"GHSA-7rx3-28cr-v5wh",
|
|
17
|
+
"GHSA-2qvq-rjwj-gvw9",
|
|
18
|
+
"GHSA-442j-39wm-28r2",
|
|
19
|
+
"GHSA-44fc-8fm5-q62h",
|
|
20
|
+
"GHSA-hf2r-9gf9-rwch",
|
|
21
|
+
"GHSA-48c2-rrv3-qjmp"
|
|
9
22
|
]
|
|
10
23
|
}
|
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.7",
|
|
4
4
|
"description": "Shared code for mojaloop central services",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "ModusBox",
|
|
@@ -67,23 +67,23 @@
|
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@hapi/catbox": "12.1.1",
|
|
69
69
|
"@hapi/catbox-memory": "5.0.1",
|
|
70
|
-
"@hapi/hapi": "21.4.
|
|
70
|
+
"@hapi/hapi": "21.4.8",
|
|
71
71
|
"@hapi/joi-date": "2.0.1",
|
|
72
|
-
"@mojaloop/inter-scheme-proxy-cache-lib": "2.
|
|
73
|
-
"@opentelemetry/api": "1.9.
|
|
72
|
+
"@mojaloop/inter-scheme-proxy-cache-lib": "2.10.0",
|
|
73
|
+
"@opentelemetry/api": "1.9.1",
|
|
74
74
|
"async-exit-hook": "2.0.1",
|
|
75
75
|
"async-retry": "1.3.3",
|
|
76
|
-
"axios": "1.
|
|
76
|
+
"axios": "1.14.0",
|
|
77
77
|
"clone": "2.1.2",
|
|
78
|
-
"convict": "
|
|
79
|
-
"dotenv": "17.
|
|
78
|
+
"convict": "6.2.5",
|
|
79
|
+
"dotenv": "17.4.1",
|
|
80
80
|
"env-var": "7.5.0",
|
|
81
81
|
"event-stream": "4.0.1",
|
|
82
82
|
"fast-safe-stringify": "2.1.1",
|
|
83
|
-
"immutable": "5.1.
|
|
83
|
+
"immutable": "5.1.5",
|
|
84
84
|
"ioredis": "5.6.1",
|
|
85
|
-
"joi": "18.
|
|
86
|
-
"lodash": "4.
|
|
85
|
+
"joi": "18.1.2",
|
|
86
|
+
"lodash": "4.18.1",
|
|
87
87
|
"mustache": "4.2.0",
|
|
88
88
|
"openapi-backend": "5.16.1",
|
|
89
89
|
"raw-body": "3.0.2",
|
|
@@ -93,14 +93,14 @@
|
|
|
93
93
|
"ulidx": "2.4.1",
|
|
94
94
|
"uuid4": "2.0.3",
|
|
95
95
|
"widdershins": "4.0.1",
|
|
96
|
-
"yaml": "2.8.
|
|
96
|
+
"yaml": "2.8.3"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@mojaloop/central-services-error-handling": "13.1.6",
|
|
100
100
|
"@mojaloop/central-services-logger": "11.10.4",
|
|
101
101
|
"@mojaloop/central-services-metrics": "12.8.5",
|
|
102
102
|
"@mojaloop/event-sdk": "14.8.3",
|
|
103
|
-
"@opentelemetry/auto-instrumentations-node": "^0.
|
|
103
|
+
"@opentelemetry/auto-instrumentations-node": "^0.72.0",
|
|
104
104
|
"@types/hapi__joi": "17.1.15",
|
|
105
105
|
"ajv": "8.18.0",
|
|
106
106
|
"ajv-formats": "^3.0.1",
|
|
@@ -108,14 +108,14 @@
|
|
|
108
108
|
"audit-ci": "7.1.0",
|
|
109
109
|
"base64url": "3.0.1",
|
|
110
110
|
"chance": "1.1.13",
|
|
111
|
-
"npm-check-updates": "
|
|
111
|
+
"npm-check-updates": "20.0.0",
|
|
112
112
|
"nyc": "18.0.0",
|
|
113
113
|
"portfinder": "1.0.38",
|
|
114
114
|
"pre-commit": "1.2.2",
|
|
115
115
|
"proxyquire": "2.1.3",
|
|
116
116
|
"replace": "1.2.2",
|
|
117
117
|
"rewire": "9.0.1",
|
|
118
|
-
"sinon": "21.0.
|
|
118
|
+
"sinon": "21.0.3",
|
|
119
119
|
"standard": "17.1.2",
|
|
120
120
|
"standard-version": "9.5.0",
|
|
121
121
|
"tap-spec": "5.0.0",
|
|
@@ -124,9 +124,9 @@
|
|
|
124
124
|
"tapes": "4.1.0"
|
|
125
125
|
},
|
|
126
126
|
"overrides": {
|
|
127
|
-
"axios": "1.
|
|
127
|
+
"axios": "1.14.0",
|
|
128
128
|
"qs": "6.14.2",
|
|
129
|
-
"brace-expansion": "
|
|
129
|
+
"brace-expansion": "1.1.13",
|
|
130
130
|
"form-data": "4.0.5",
|
|
131
131
|
"nanoid": "5.1.5",
|
|
132
132
|
"postcss": {
|
|
@@ -144,15 +144,21 @@
|
|
|
144
144
|
"swagger2openapi": "7.0.8"
|
|
145
145
|
},
|
|
146
146
|
"markdown-it": "12.3.2",
|
|
147
|
-
"fast-xml-parser": "5.
|
|
147
|
+
"fast-xml-parser": "5.5.10",
|
|
148
148
|
"trim": "0.0.3",
|
|
149
149
|
"cross-spawn": "7.0.6",
|
|
150
150
|
"yargs-parser": "21.1.1",
|
|
151
151
|
"jws": "3.2.3",
|
|
152
152
|
"validator": "13.15.22",
|
|
153
|
-
"lodash": "4.
|
|
154
|
-
"lodash-es": "4.
|
|
155
|
-
"undici": "7.
|
|
153
|
+
"lodash": "4.18.1",
|
|
154
|
+
"lodash-es": "4.18.1",
|
|
155
|
+
"undici": "7.24.7",
|
|
156
|
+
"@hapi/content": "6.0.1",
|
|
157
|
+
"replace": {
|
|
158
|
+
"minimatch": "3.1.4"
|
|
159
|
+
},
|
|
160
|
+
"path-to-regexp": "0.1.13",
|
|
161
|
+
"picomatch": "2.3.2"
|
|
156
162
|
},
|
|
157
163
|
"peerDependencies": {
|
|
158
164
|
"@mojaloop/central-services-error-handling": "13.x.x",
|
|
@@ -81,9 +81,10 @@ const plugin = {
|
|
|
81
81
|
|
|
82
82
|
if (needProxySourceValidation) validateProxySourceHeaders(request.headers)
|
|
83
83
|
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
|
|
84
|
+
// Require accept header for request-initiating methods (GET, POST, DELETE)
|
|
85
|
+
// per FSPIOP API spec. PUT/PATCH callbacks do not require Accept.
|
|
86
|
+
const methodRequiresAccept = ['get', 'post', 'delete'].includes(request.method.toLowerCase())
|
|
87
|
+
if (methodRequiresAccept || request.headers.accept) {
|
|
87
88
|
if (request.headers.accept === undefined) {
|
|
88
89
|
throw createFSPIOPError(Enums.FSPIOPErrorCodes.MISSING_ELEMENT, errorMessages.REQUIRE_ACCEPT_HEADER)
|
|
89
90
|
}
|
|
@@ -151,7 +151,8 @@ Test('headerValidation plugin test', async (pluginTest) => {
|
|
|
151
151
|
t.end()
|
|
152
152
|
})
|
|
153
153
|
|
|
154
|
-
pluginTest.test('accept validation is
|
|
154
|
+
pluginTest.test('accept validation is performed on post requests without an accept header', async t => {
|
|
155
|
+
const fspiopCode = ErrorHandling.Enums.FSPIOPErrorCodes.MISSING_ELEMENT
|
|
155
156
|
const opts = {
|
|
156
157
|
url: `/${resource}`,
|
|
157
158
|
headers: {
|
|
@@ -159,11 +160,25 @@ Test('headerValidation plugin test', async (pluginTest) => {
|
|
|
159
160
|
date: new Date().toUTCString()
|
|
160
161
|
}
|
|
161
162
|
}
|
|
162
|
-
await
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
163
|
+
const res = await server.inject({ ...opts, method: 'post' })
|
|
164
|
+
t.is(res.statusCode, fspiopCode.httpStatusCode)
|
|
165
|
+
const payload = JSON.parse(res.payload)
|
|
166
|
+
t.is(payload.apiErrorCode.code, fspiopCode.code)
|
|
167
|
+
t.is(payload.message, errorMessages.REQUIRE_ACCEPT_HEADER)
|
|
168
|
+
t.end()
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
pluginTest.test('accept validation is not required for put requests without an accept header', async t => {
|
|
172
|
+
const opts = {
|
|
173
|
+
url: `/${resource}`,
|
|
174
|
+
headers: {
|
|
175
|
+
'content-type': generateContentTypeHeader(resource, 1),
|
|
176
|
+
date: new Date().toUTCString()
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
const res = await server.inject({ ...opts, method: 'put' })
|
|
180
|
+
t.is(res.payload, '')
|
|
181
|
+
t.is(res.statusCode, 202)
|
|
167
182
|
t.end()
|
|
168
183
|
})
|
|
169
184
|
|