@mojaloop/sdk-scheme-adapter 24.9.8-snapshot.5 → 24.9.8-snapshot.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-api-svc",
3
- "version": "21.0.0-snapshot.43",
3
+ "version": "21.0.0-snapshot.45",
4
4
  "description": "An adapter for connecting to Mojaloop API enabled switches.",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -142,6 +142,8 @@ class Server extends EventEmitter {
142
142
  _shouldUpdateInboundServer(newConf) {
143
143
  const isInboundDifferent = !_.isEqual(this.conf.inbound, newConf.inbound);
144
144
  const isOutboundDifferent = !_.isEqual(this.conf.outbound, newConf.outbound);
145
+ const isPeerJWSKeysDifferent = !_.isEqual(this.conf.peerJWSKeys, newConf.peerJWSKeys);
146
+ const isJwsSigningKeyDifferent = !_.isEqual(this.conf.jwsSigningKey, newConf.jwsSigningKey);
145
147
 
146
148
  if (isInboundDifferent) {
147
149
  this.logger.debug('Inbound config is different', {
@@ -156,11 +158,26 @@ class Server extends EventEmitter {
156
158
  });
157
159
  }
158
160
 
159
- return isInboundDifferent || isOutboundDifferent;
161
+ if (isPeerJWSKeysDifferent) {
162
+ this.logger.debug('Peer JWS Keys config is different', {
163
+ oldPeerJWSKeys: this.conf.peerJWSKeys,
164
+ newPeerJWSKeys: newConf.peerJWSKeys
165
+ });
166
+ }
167
+
168
+ if (isJwsSigningKeyDifferent) {
169
+ this.logger.debug('JWS Signing Key config is different', {
170
+ oldJwsSigningKey: this.conf.jwsSigningKey,
171
+ newJwsSigningKey: newConf.jwsSigningKey
172
+ });
173
+ }
174
+
175
+ return isInboundDifferent || isOutboundDifferent || isPeerJWSKeysDifferent || isJwsSigningKeyDifferent;
160
176
  }
161
177
 
162
178
  _shouldUpdateOutboundServer(newConf) {
163
179
  const isOutboundDifferent = !_.isEqual(this.conf.outbound, newConf.outbound);
180
+ const isJwsSigningKeyDifferent = !_.isEqual(this.conf.jwsSigningKey, newConf.jwsSigningKey);
164
181
 
165
182
  if (isOutboundDifferent) {
166
183
  this.logger.debug('Outbound config is different', {
@@ -169,7 +186,14 @@ class Server extends EventEmitter {
169
186
  });
170
187
  }
171
188
 
172
- return isOutboundDifferent;
189
+ if (isJwsSigningKeyDifferent) {
190
+ this.logger.debug('JWS Signing Key config is different', {
191
+ oldJwsSigningKey: this.conf.jwsSigningKey,
192
+ newJwsSigningKey: newConf.jwsSigningKey
193
+ });
194
+ }
195
+
196
+ return isOutboundDifferent || isJwsSigningKeyDifferent;
173
197
  }
174
198
 
175
199
  async start() {
@@ -259,6 +283,9 @@ class Server extends EventEmitter {
259
283
  this.logger.isDebugEnabled && this.logger.push({ oldConf: this.conf.inbound, newConf: newConf.inbound }).debug('Inbound server configuration');
260
284
  const updateInboundServer = this._shouldUpdateInboundServer(newConf);
261
285
  if (updateInboundServer) {
286
+ const stopStartLabel = 'InboundServer stop/start duration';
287
+ // eslint-disable-next-line no-console
288
+ console.time(stopStartLabel);
262
289
  await this.inboundServer.stop();
263
290
  this.inboundServer = new InboundServer(
264
291
  newConf,
@@ -272,12 +299,17 @@ class Server extends EventEmitter {
272
299
  this.emit('error', errMessage);
273
300
  });
274
301
  await this.inboundServer.start();
302
+ // eslint-disable-next-line no-console
303
+ console.timeEnd(stopStartLabel);
275
304
  restartActionsTaken.updateInboundServer = true;
276
305
  }
277
306
 
278
307
  this.logger.isDebugEnabled && this.logger.push({ oldConf: this.conf.outbound, newConf: newConf.outbound }).debug('Outbound server configuration');
279
308
  const updateOutboundServer = this._shouldUpdateOutboundServer(newConf);
280
309
  if (updateOutboundServer) {
310
+ const stopStartLabel = 'OutboundServer stop/start duration';
311
+ // eslint-disable-next-line no-console
312
+ console.time(stopStartLabel);
281
313
  await this.outboundServer.stop();
282
314
  this.outboundServer = new OutboundServer(
283
315
  newConf,
@@ -292,23 +324,11 @@ class Server extends EventEmitter {
292
324
  this.emit('error', errMessage);
293
325
  });
294
326
  await this.outboundServer.start();
327
+ // eslint-disable-next-line no-console
328
+ console.timeEnd(stopStartLabel);
295
329
  restartActionsTaken.updateOutboundServer = true;
296
330
  }
297
331
 
298
- if(!_.isEqual(this.conf.jwsSigningKey, newConf.jwsSigningKey) ||
299
- !_.isEqual(this.conf.peerJWSKeys, newConf.peerJWSKeys)) {
300
- this.logger.isDebugEnabled && this.logger.push({
301
- oldJwsSigningKey: this.conf.jwsSigningKey,
302
- newJwsSigningKey: newConf.jwsSigningKey,
303
- oldPeerJWSKeys: this.conf.peerJWSKeys,
304
- newPeerJWSKeys: newConf.peerJWSKeys
305
- }).debug('JWS signing key or peer JWS keys configuration changed');
306
- this.outboundServer._conf.jwsSigningKey = newConf.jwsSigningKey;
307
- this.outboundServer._conf.peerJWSKeys = newConf.peerJWSKeys;
308
- this.inboundServer._conf.jwsSigningKey = newConf.jwsSigningKey;
309
- this.inboundServer._conf.peerJWSKeys = newConf.peerJWSKeys;
310
- }
311
-
312
332
  const updateFspiopEventHandler = !_.isEqual(this.conf.outbound, newConf.outbound)
313
333
  && this.conf.fspiopEventHandler.enabled;
314
334
  if (updateFspiopEventHandler) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-outbound-command-event-handler",
3
- "version": "0.3.0-snapshot.40",
3
+ "version": "0.3.0-snapshot.42",
4
4
  "description": "Mojaloop sdk scheme adapter command event handler",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/mojaloop/sdk-scheme-adapter/",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-outbound-domain-event-handler",
3
- "version": "0.3.0-snapshot.40",
3
+ "version": "0.3.0-snapshot.42",
4
4
  "description": "mojaloop sdk scheme adapter outbound domain event handler",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/mojaloop/sdk-scheme-adapter/",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter-private-shared-lib",
3
- "version": "0.4.0-snapshot.40",
3
+ "version": "0.4.0-snapshot.42",
4
4
  "description": "SDK Scheme Adapter private shared library.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/mojaloop/accounts-and-balances-bc/tree/main/modules/private-types",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mojaloop/sdk-scheme-adapter",
3
- "version": "24.9.8-snapshot.5",
3
+ "version": "24.9.8-snapshot.7",
4
4
  "description": "mojaloop sdk-scheme-adapter",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/mojaloop/sdk-scheme-adapter",