@mojaloop/sdk-scheme-adapter 24.9.4 → 24.9.5
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/.yarn/cache/{@babel-core-npm-7.27.3-86995da3eb-d70d5e4e99.zip → @babel-core-npm-7.27.4-801e5891a4-e7f961274f.zip} +0 -0
- package/.yarn/cache/{@babel-helpers-npm-7.27.3-fb2512a0e0-c572acf07c.zip → @babel-helpers-npm-7.27.4-ba8f87a40e-a50ce7ff92.zip} +0 -0
- package/.yarn/cache/@babel-parser-npm-7.27.4-c8d264780c-846d267688.zip +0 -0
- package/.yarn/cache/@babel-traverse-npm-7.27.4-fe457ebf1b-ae0047fe78.zip +0 -0
- package/.yarn/cache/{@types-node-npm-22.15.27-e786b3c41a-bf621456bf.zip → @types-node-npm-22.15.28-a9d86ffc23-80a82dd77d.zip} +0 -0
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +7 -0
- package/modules/api-svc/package.json +1 -1
- package/modules/api-svc/src/InboundServer/index.js +10 -0
- package/modules/api-svc/src/index.js +10 -2
- package/modules/api-svc/test/unit/index.test.js +9 -12
- package/modules/outbound-command-event-handler/package.json +1 -1
- package/modules/outbound-domain-event-handler/package.json +1 -1
- package/modules/private-shared-lib/package.json +1 -1
- package/package.json +2 -2
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
# Changelog: [mojaloop/sdk-scheme-adapter](https://github.com/mojaloop/sdk-scheme-adapter)
|
|
2
|
+
### [24.9.5](https://github.com/mojaloop/sdk-scheme-adapter/compare/v24.9.4...v24.9.5) (2025-05-30)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Chore
|
|
6
|
+
|
|
7
|
+
* hot mutate peerJwsKeys instead of restart ([#584](https://github.com/mojaloop/sdk-scheme-adapter/issues/584)) ([08983fc](https://github.com/mojaloop/sdk-scheme-adapter/commit/08983fcc5ab7cde0042cb3e17545d581accb9d3a))
|
|
8
|
+
|
|
2
9
|
### [24.9.4](https://github.com/mojaloop/sdk-scheme-adapter/compare/v24.9.3...v24.9.4) (2025-05-30)
|
|
3
10
|
|
|
4
11
|
|
|
@@ -52,6 +52,7 @@ class InboundApi extends EventEmitter {
|
|
|
52
52
|
super({ captureExceptions: true });
|
|
53
53
|
this._conf = conf;
|
|
54
54
|
this._cache = cache;
|
|
55
|
+
this._logger = logger;
|
|
55
56
|
_initialize ||= _validator.initialise(apiSpecs, conf);
|
|
56
57
|
|
|
57
58
|
if (conf.validateInboundJws) {
|
|
@@ -85,6 +86,15 @@ class InboundApi extends EventEmitter {
|
|
|
85
86
|
return this._api.callback();
|
|
86
87
|
}
|
|
87
88
|
|
|
89
|
+
_updatePeerJwsKeys(peerJwsKeys) {
|
|
90
|
+
if (this._conf.pm4mlEnabled) {
|
|
91
|
+
this._logger && this._logger.isVerboseEnabled && this._logger.verbose('Clearing existing JWS verification keys');
|
|
92
|
+
Object.keys(this._jwsVerificationKeys).forEach(key => delete this._jwsVerificationKeys[key]);
|
|
93
|
+
this._logger && this._logger.isVerboseEnabled && this._logger.verbose('Assigning new peer JWS keys');
|
|
94
|
+
Object.assign(this._jwsVerificationKeys, peerJwsKeys);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
88
98
|
_startJwsWatcher() {
|
|
89
99
|
const FS_EVENT_TYPES = {
|
|
90
100
|
CHANGE: 'change',
|
|
@@ -141,8 +141,11 @@ class Server extends EventEmitter {
|
|
|
141
141
|
|
|
142
142
|
_shouldUpdateInboundServer(newConf) {
|
|
143
143
|
return !_.isEqual(this.conf.inbound, newConf.inbound)
|
|
144
|
-
|| !_.isEqual(this.conf.outbound, newConf.outbound)
|
|
145
|
-
|
|
144
|
+
|| !_.isEqual(this.conf.outbound, newConf.outbound);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
_shouldUpdatePeerJwsKeys(newConf) {
|
|
148
|
+
return !_.isEqual(this.conf.peerJWSKeys, newConf.peerJWSKeys);
|
|
146
149
|
}
|
|
147
150
|
|
|
148
151
|
async start() {
|
|
@@ -248,6 +251,11 @@ class Server extends EventEmitter {
|
|
|
248
251
|
restartActionsTaken.updateInboundServer = true;
|
|
249
252
|
}
|
|
250
253
|
|
|
254
|
+
const updatePeerJwsKeys = this._shouldUpdatePeerJwsKeys(newConf);
|
|
255
|
+
if (updatePeerJwsKeys) {
|
|
256
|
+
this.inboundServer._api._updatePeerJwsKeys(newConf.peerJWSKeys);
|
|
257
|
+
}
|
|
258
|
+
|
|
251
259
|
this.logger.isDebugEnabled && this.logger.push({ oldConf: this.conf.outbound, newConf: newConf.outbound }).debug('Outbound server configuration');
|
|
252
260
|
const updateOutboundServer = !_.isEqual(this.conf.outbound, newConf.outbound);
|
|
253
261
|
if (updateOutboundServer) {
|
|
@@ -99,22 +99,19 @@ describe('Server', () => {
|
|
|
99
99
|
expect(server.restart).toHaveBeenCalledWith(newConf);
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
-
it('
|
|
103
|
-
//
|
|
104
|
-
const
|
|
105
|
-
|
|
102
|
+
it('hot mutates peerJwsKeys reference if peerJWSKeys config is different', async () => {
|
|
103
|
+
// Test that peerJwsKeys are updated without a full restart if config changes
|
|
104
|
+
const originalPeerJwsKeys = conf.peerJWSKeys;
|
|
105
|
+
const newPeerJwsKeys = { ...originalPeerJwsKeys, newKey: 'newValue' };
|
|
106
|
+
const newConfPeerJwsKeys = { ...conf, peerJWSKeys: newPeerJwsKeys };
|
|
106
107
|
|
|
107
|
-
|
|
108
|
-
expect(server._shouldUpdateInboundServer(newConf)).toBe(true);
|
|
108
|
+
expect(server._shouldUpdatePeerJwsKeys(newConfPeerJwsKeys)).toBe(true);
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
controlServer.broadcastConfigChange(newConf);
|
|
112
|
-
|
|
113
|
-
// Wait for the restart to be triggered
|
|
110
|
+
controlServer.broadcastConfigChange(newConfPeerJwsKeys);
|
|
114
111
|
await new Promise((wait) => setTimeout(wait, 1000));
|
|
115
112
|
|
|
116
|
-
|
|
117
|
-
expect(server.restart).toHaveBeenCalledWith(
|
|
113
|
+
// Should call restart with new config
|
|
114
|
+
expect(server.restart).toHaveBeenCalledWith(newConfPeerJwsKeys);
|
|
118
115
|
});
|
|
119
116
|
|
|
120
117
|
it('restarts inbound server if inbound or outbound is different', async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mojaloop/sdk-scheme-adapter",
|
|
3
|
-
"version": "24.9.
|
|
3
|
+
"version": "24.9.5",
|
|
4
4
|
"description": "mojaloop sdk-scheme-adapter",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/mojaloop/sdk-scheme-adapter",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@types/jest": "29.5.14",
|
|
85
|
-
"@types/node": "22.15.
|
|
85
|
+
"@types/node": "22.15.28",
|
|
86
86
|
"@types/node-cache": "4.2.5",
|
|
87
87
|
"@typescript-eslint/eslint-plugin": "8.33.0",
|
|
88
88
|
"@typescript-eslint/parser": "8.33.0",
|