From 9ed40ce2c3de24f9d897544d6c1e937cbfe6d04f Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 12 Jun 2024 12:57:50 +0200 Subject: [PATCH 01/40] send sms actions one by one when multiple destinations --- lib/models/smsAction.js | 61 ++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/lib/models/smsAction.js b/lib/models/smsAction.js index e1134aaa..9a1f9ebf 100644 --- a/lib/models/smsAction.js +++ b/lib/models/smsAction.js @@ -71,10 +71,6 @@ function doIt(action, event, callback) { if (options.sms && options.sms.from) { from = options.sms.from; } - msg = { to: buildTo(options.to), message: options.text, from: from }; - - metrics.IncMetrics(event.service, event.subservice, metrics.actionSMS); - var url = config.sms.URL; var apiKey = config.sms.API_KEY; var apiSecret = config.sms.API_SECRET; @@ -89,33 +85,42 @@ function doIt(action, event, callback) { apiSecret = options.sms.API_SECRET; } } - myutils.requestHelper( - 'post', - { - url: url, - json: true, - body: msg, - headers: { - 'User-Agent': 'request', - API_KEY: apiKey, - API_SECRET: apiSecret - } - }, - function(err, data) { - myutils.logErrorIf(err, util.format('%s -> %s', url, msg.to)); - if (err) { - metrics.IncMetrics(event.service, event.subservice, metrics.failedActionSMS); + metrics.IncMetrics(event.service, event.subservice, metrics.actionSMS); + + var tos = buildTo(options.to); - alarm.raise(alarm.SMS); - } else { - metrics.IncMetrics(event.service, event.subservice, metrics.okActionSMS); + for (var singleto of tos) { + msg = { to: [singleto], message: options.text, from: config.sms.from }; - alarm.release(alarm.SMS); + myutils.requestHelper( + 'post', + { + url: url, + json: true, + body: msg, + headers: { + 'User-Agent': 'request', + API_KEY: apiKey, + API_SECRET: apiSecret + } + }, + function(err, data) { + myutils.logErrorIf(err, util.format('%s -> %s', url, msg.to)); + if (err) { + metrics.IncMetrics(event.service, event.subservice, metrics.failedActionSMS); + alarm.raise(alarm.SMS); + } else { + metrics.IncMetrics(event.service, event.subservice, metrics.okActionSMS); + alarm.release(alarm.SMS); + } + logger.info('smsAction.SendSMS done url:%s result:%j, msg: %j', url, err || data, msg); + if (tos[tos.length - 1] === singleto) { + // ensure callback is returned just one time + return callback(err, data); + } } - logger.info('smsAction.SendSMS done url:%s result:%j, msg: %j', url, err || data, msg); - return callback(err, data); - } - ); + ); + } } catch (ex) { metrics.IncMetrics(event.service, event.subservice, metrics.failedActionSMS); From d30710d956a81ce045c035f3995d69204939b520 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 12 Jun 2024 15:54:02 +0200 Subject: [PATCH 02/40] ignore lint about loop and functions --- lib/models/smsAction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/smsAction.js b/lib/models/smsAction.js index 9a1f9ebf..07fe5acb 100644 --- a/lib/models/smsAction.js +++ b/lib/models/smsAction.js @@ -91,7 +91,6 @@ function doIt(action, event, callback) { for (var singleto of tos) { msg = { to: [singleto], message: options.text, from: config.sms.from }; - myutils.requestHelper( 'post', { @@ -105,6 +104,7 @@ function doIt(action, event, callback) { } }, function(err, data) { + // jshint ignore:line myutils.logErrorIf(err, util.format('%s -> %s', url, msg.to)); if (err) { metrics.IncMetrics(event.service, event.subservice, metrics.failedActionSMS); From be46392bb6b65ed353e992cb265b3edaf03cdc17 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 12 Jun 2024 15:58:49 +0200 Subject: [PATCH 03/40] fix to this line From cf9468958a4158c0ce085f61a56304ddb545348e Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 12 Jun 2024 16:01:21 +0200 Subject: [PATCH 04/40] Update smsAction.js --- lib/models/smsAction.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/models/smsAction.js b/lib/models/smsAction.js index 07fe5acb..c2d4a46a 100644 --- a/lib/models/smsAction.js +++ b/lib/models/smsAction.js @@ -103,8 +103,7 @@ function doIt(action, event, callback) { API_SECRET: apiSecret } }, - function(err, data) { - // jshint ignore:line + function(err, data) { // jshint ignore:line myutils.logErrorIf(err, util.format('%s -> %s', url, msg.to)); if (err) { metrics.IncMetrics(event.service, event.subservice, metrics.failedActionSMS); From a2e0a562ae78501eb132efe39faefd0573235ce9 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 12 Jun 2024 16:38:32 +0200 Subject: [PATCH 05/40] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index e69de29b..6529c4fc 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -0,0 +1 @@ +- Send multiple sms when multiple destination in sms action From dc88fe607a5466a2582e120ae7f51247ec8a64c8 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Thu, 13 Jun 2024 11:10:18 +0200 Subject: [PATCH 06/40] provide service and subservice when update rule in mongo using findOneAndUpdate --- lib/models/rulesStore.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/models/rulesStore.js b/lib/models/rulesStore.js index 8d01fd96..2926f2b9 100644 --- a/lib/models/rulesStore.js +++ b/lib/models/rulesStore.js @@ -190,7 +190,11 @@ module.exports = { db.collection.bind(db, rulesCollectionName, { strict: true }), function(col, cb) { col.findOneAndUpdate( - { name: id }, + { + name: id, + service: r.service, + subservice: r.subservice + }, { $set: r }, { upsert: false, From 150a46d4232c053a17cddb6f090f623b0a248681 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Thu, 13 Jun 2024 11:21:13 +0200 Subject: [PATCH 07/40] update CNR --- Changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog b/Changelog index 81d41afb..82b11c67 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +Fix: upgrade rule in mongo using service and subservice to avoid match with other rule + 1.31.0 (June 11th, 2024) - Fix: release transport resources of nodemailer after send email From 5e3f0c3126ec4208e65909cf2e3981ea108eb518 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Thu, 13 Jun 2024 11:25:33 +0200 Subject: [PATCH 08/40] update CNR --- Changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 82b11c67..29945c00 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,4 @@ -Fix: upgrade rule in mongo using service and subservice to avoid match with other rule +Fix: upgrade rule in mongo using service and subservice to avoid match with other rule (#783) 1.31.0 (June 11th, 2024) From 9592a19f99984744c48757746be7b3ec20cf505c Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Thu, 13 Jun 2024 12:09:10 +0200 Subject: [PATCH 09/40] stemp 1.31.0-next -> 1.32.0 --- CHANGES_NEXT_RELEASE | 1 - Changelog | 5 ++++- package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 6529c4fc..e69de29b 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +0,0 @@ -- Send multiple sms when multiple destination in sms action diff --git a/Changelog b/Changelog index 29945c00..b2a610e0 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,7 @@ -Fix: upgrade rule in mongo using service and subservice to avoid match with other rule (#783) +1.32.0 (June 13th, 2024) + +- Add: Send multiple sms when multiple destination in sms action +- Fix: upgrade rule in mongo using service and subservice to avoid match with other rule (#783) 1.31.0 (June 11th, 2024) diff --git a/package.json b/package.json index 57132d86..1904b034 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "perseo", "description": "IOT CEP front End", "license": "AGPL-3.0-only", - "version": "1.31.0-next", + "version": "1.32.0", "author": { "name": "crbrox", "email": "carlos.romerobrox@telefonica.com" From 2fca64a4211ff97f51fefa7b387367dd7d7f3b73 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Thu, 13 Jun 2024 12:16:36 +0200 Subject: [PATCH 10/40] 1.32.0 -> 1.32.0-next --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1904b034..36b3f5cb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "perseo", "description": "IOT CEP front End", "license": "AGPL-3.0-only", - "version": "1.32.0", + "version": "1.32.0-next", "author": { "name": "crbrox", "email": "carlos.romerobrox@telefonica.com" From 84d7b55c6944002ada4043c83675cbe61322e2c8 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Tue, 16 Jul 2024 10:50:20 +0200 Subject: [PATCH 11/40] do not invoke callback two times when error retrieving token --- CHANGES_NEXT_RELEASE | 1 + lib/models/keystone.js | 3 ++- lib/models/updateAction.js | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index e69de29b..cad16a8d 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -0,0 +1 @@ +- Do not invoke calback twice when error retrieving token diff --git a/lib/models/keystone.js b/lib/models/keystone.js index 1fd2516b..10807557 100644 --- a/lib/models/keystone.js +++ b/lib/models/keystone.js @@ -59,7 +59,8 @@ function getToken(trust, callback) { // check trust was found or log it if (!trustConf) { - logger.error('Trust %s not found in configTrust file with content %s', trust, configTrust); + logger.error('Trust %s not found in configTrust file with content %j', trust, configTrust); + alarm.raise(alarm.AUTH); callback(new errors.TokenRetrievalError(trust, 'trust not found' + trust)); } var options = { diff --git a/lib/models/updateAction.js b/lib/models/updateAction.js index b9cbf3f4..ef387742 100644 --- a/lib/models/updateAction.js +++ b/lib/models/updateAction.js @@ -474,10 +474,10 @@ function doRequestV2(action, event, token, callback) { function makeTokenListenerFunc(action, event, version, callback) { return function tokenHandlerFunc(error, token) { logger.debug('tokenHandlerFunc error:%s token:%s', error, token); - if (error || !token) { - return callback(error); + if (error) { + throw error; } else { - logger.debug('tokenHandlerFunc retrying with', token); + logger.debug('tokenHandlerFunc retrying with %s', token); return doRequestV2(action, event, token, function cbDoReqUpdAxn(error, data) { callback(error, data); }); From a3c31348f7c827aa9ae6e5088fdf256e70f5ffd5 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Tue, 16 Jul 2024 13:09:53 +0200 Subject: [PATCH 12/40] thow error if not trust is found --- lib/models/keystone.js | 3 +-- lib/models/updateAction.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/models/keystone.js b/lib/models/keystone.js index 10807557..448d876d 100644 --- a/lib/models/keystone.js +++ b/lib/models/keystone.js @@ -60,8 +60,7 @@ function getToken(trust, callback) { // check trust was found or log it if (!trustConf) { logger.error('Trust %s not found in configTrust file with content %j', trust, configTrust); - alarm.raise(alarm.AUTH); - callback(new errors.TokenRetrievalError(trust, 'trust not found' + trust)); + throw errors.TokenRetrievalError(trust, 'trust not found' + trust); } var options = { url: 'http://' + trustConf.host + ':' + trustConf.port + '/v3/auth/tokens', diff --git a/lib/models/updateAction.js b/lib/models/updateAction.js index ef387742..a40e23d0 100644 --- a/lib/models/updateAction.js +++ b/lib/models/updateAction.js @@ -474,8 +474,8 @@ function doRequestV2(action, event, token, callback) { function makeTokenListenerFunc(action, event, version, callback) { return function tokenHandlerFunc(error, token) { logger.debug('tokenHandlerFunc error:%s token:%s', error, token); - if (error) { - throw error; + if (error || !token) { + return callback(error); } else { logger.debug('tokenHandlerFunc retrying with %s', token); return doRequestV2(action, event, token, function cbDoReqUpdAxn(error, data) { From 7123a252d8e84696b8da86ff531e8c2550911fa6 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Tue, 16 Jul 2024 13:49:43 +0200 Subject: [PATCH 13/40] update CNR --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index cad16a8d..146cded9 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1 @@ -- Do not invoke calback twice when error retrieving token +- Do not invoke calback twice when error about trust not found in trustConf From 91ee4fff866eea11d4aef1efd84921d8aee2c88a Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 17 Jul 2024 07:57:26 +0200 Subject: [PATCH 14/40] do not print trustConf file in error log --- lib/models/keystone.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/keystone.js b/lib/models/keystone.js index 448d876d..0d23eb85 100644 --- a/lib/models/keystone.js +++ b/lib/models/keystone.js @@ -59,7 +59,7 @@ function getToken(trust, callback) { // check trust was found or log it if (!trustConf) { - logger.error('Trust %s not found in configTrust file with content %j', trust, configTrust); + logger.error('Trust %s not found in configTrust file', trust); throw errors.TokenRetrievalError(trust, 'trust not found' + trust); } var options = { From f23178adb1db48cf43a7cbb0dd52b2efb7054a8f Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 17 Jul 2024 08:16:32 +0200 Subject: [PATCH 15/40] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 146cded9..7a4336c9 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1 @@ -- Do not invoke calback twice when error about trust not found in trustConf +- Do not invoke calback twice when error about trust not found in trustConf (#750) From f1d9018adde92b7d5549645669fa5ade106ccb1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Wed, 17 Jul 2024 09:10:27 +0200 Subject: [PATCH 16/40] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 7a4336c9..77c8426b 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1 @@ -- Do not invoke calback twice when error about trust not found in trustConf (#750) +- Fix: do not invoke calback twice when error about trust not found in trustConf (#750) From efbc2d5a683a9128d330848d8092804a162756f8 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 17 Jul 2024 09:19:21 +0200 Subject: [PATCH 17/40] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 77c8426b..a1191de3 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1 @@ -- Fix: do not invoke calback twice when error about trust not found in trustConf (#750) +- Fix: do not invoke calback twice when error about trust not found in trustConf (#790) From 13ae5eb44000b5f7853583de0ef7172bdafcf740 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Fri, 19 Jul 2024 10:54:39 +0200 Subject: [PATCH 18/40] do not try cast when expandVar entity id and entity type --- lib/models/updateAction.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/models/updateAction.js b/lib/models/updateAction.js index a40e23d0..eef03cd3 100644 --- a/lib/models/updateAction.js +++ b/lib/models/updateAction.js @@ -169,8 +169,9 @@ function processOptionParams(action, event) { changes[key].metadata = theMeta; } }); - changes.id = myutils.expandVar(action.parameters.id, event, true); - changes.type = myutils.expandVar(action.parameters.type, event, true); + // Do not expandVar with trycast, since id and type should be always string values types + changes.id = myutils.expandVar(action.parameters.id, event, false); + changes.type = myutils.expandVar(action.parameters.type, event, false); logger.debug('processOptionParams changes: %j', changes); return changes; } From 375855733b7ad6f7d54d9ab533e0587c4634b3a2 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Fri, 19 Jul 2024 10:58:27 +0200 Subject: [PATCH 19/40] update CNR --- CHANGES_NEXT_RELEASE | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index a1191de3..48ce291f 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1,2 @@ +- FIX: do not try cast entity id and entity type in update rules when expandVar (#791) - Fix: do not invoke calback twice when error about trust not found in trustConf (#790) From bcfc10f9b3f46c022f5a45a2ef51090dc8fc3012 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Fri, 19 Jul 2024 11:06:57 +0200 Subject: [PATCH 20/40] update doc --- lib/models/updateAction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/updateAction.js b/lib/models/updateAction.js index eef03cd3..1c916c25 100644 --- a/lib/models/updateAction.js +++ b/lib/models/updateAction.js @@ -169,7 +169,7 @@ function processOptionParams(action, event) { changes[key].metadata = theMeta; } }); - // Do not expandVar with trycast, since id and type should be always string values types + // Do not expandVar with trycast, since entity id and type should be always string values types changes.id = myutils.expandVar(action.parameters.id, event, false); changes.type = myutils.expandVar(action.parameters.type, event, false); logger.debug('processOptionParams changes: %j', changes); From 10df1bfa40ee251cebaf85b99f3387716cc12922 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Fri, 19 Jul 2024 11:27:05 +0200 Subject: [PATCH 21/40] Update CNR --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 48ce291f..0f0b04c3 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,2 +1,2 @@ -- FIX: do not try cast entity id and entity type in update rules when expandVar (#791) +- FIX: do not try cast entity id and entity type in update rules when expand parameters of rule to avoid BadRequest en CB tries to update that entities (#791) - Fix: do not invoke calback twice when error about trust not found in trustConf (#790) From 0ab937bc0ed62e1e0ab827a449dcf15db4ad24c0 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Fri, 19 Jul 2024 12:20:40 +0200 Subject: [PATCH 22/40] Do not search in entities collection with strict mode --- lib/models/entitiesStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/entitiesStore.js b/lib/models/entitiesStore.js index 423fcf86..2e0ef42a 100644 --- a/lib/models/entitiesStore.js +++ b/lib/models/entitiesStore.js @@ -151,7 +151,7 @@ function findSilentEntitiesByMongo(service, subservice, ruleData, alterFunc, cal async.waterfall( [ - db.collection.bind(db, entitiesCollectionName, { strict: true }), + db.collection.bind(db, entitiesCollectionName, { strict: false }), function(col, cb) { col.find(criterion) .batchSize(config.orionDb.batchSize) From aef02fe5be53966ab340864df8ebb0d93d58908d Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Fri, 19 Jul 2024 12:33:20 +0200 Subject: [PATCH 23/40] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index a1191de3..4b7bb0fb 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1,2 @@ +- Fix: Do not search in entities collection with strict mode by non_signal checker (#793) - Fix: do not invoke calback twice when error about trust not found in trustConf (#790) From 9973150e98186f2c39bb016cecfdd0eeb8c0f0b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Mon, 22 Jul 2024 10:24:20 +0200 Subject: [PATCH 24/40] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 0f0b04c3..2fe7453c 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,2 +1,2 @@ -- FIX: do not try cast entity id and entity type in update rules when expand parameters of rule to avoid BadRequest en CB tries to update that entities (#791) +- Fix: do not try cast entity id and entity type in update rules when expand parameters of rule to avoid BadRequest en CB tries to update that entities (#791) - Fix: do not invoke calback twice when error about trust not found in trustConf (#790) From e27a6deff382b2dd564698acfa3ea9143a288587 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Mon, 29 Jul 2024 10:55:24 +0200 Subject: [PATCH 25/40] step 1.32.0-next -> 1.33.0 --- CHANGES_NEXT_RELEASE | 3 --- Changelog | 6 ++++++ package.json | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 2f658ccf..e69de29b 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,3 +0,0 @@ -- Fix: do not search in entities collection with strict mode by non_signal checker (#793) -- Fix: do not try cast entity id and entity type in update rules when expand parameters of rule to avoid BadRequest en CB tries to update that entities (#791) -- Fix: do not invoke calback twice when error about trust not found in trustConf (#790) diff --git a/Changelog b/Changelog index b2a610e0..5ebdcb62 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,9 @@ +1.33.0 (July 29th, 2024) + +- Fix: do not search in entities collection with strict mode by non_signal checker (#793) +- Fix: do not try cast entity id and entity type in update rules when expand parameters of rule to avoid BadRequest en CB tries to update that entities (#791) +- Fix: do not invoke calback twice when error about trust not found in trustConf (#790) + 1.32.0 (June 13th, 2024) - Add: Send multiple sms when multiple destination in sms action diff --git a/package.json b/package.json index 36b3f5cb..8a54d753 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "perseo", "description": "IOT CEP front End", "license": "AGPL-3.0-only", - "version": "1.32.0-next", + "version": "1.33.0", "author": { "name": "crbrox", "email": "carlos.romerobrox@telefonica.com" From 1e3080ef70e9926ff94c327dcb31c62ece63ffc0 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Mon, 29 Jul 2024 11:13:04 +0200 Subject: [PATCH 26/40] 1.330 -> 1.33.0-next --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8a54d753..f011d6f1 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "perseo", "description": "IOT CEP front End", "license": "AGPL-3.0-only", - "version": "1.33.0", + "version": "1.33.0-next", "author": { "name": "crbrox", "email": "carlos.romerobrox@telefonica.com" From 88f90f72e435473c80f3b7ee00554c30c77e6692 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Mon, 29 Jul 2024 14:52:42 +0200 Subject: [PATCH 27/40] ensure smtpConfig auth is not tainted for log purposes --- lib/models/emailAction.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/models/emailAction.js b/lib/models/emailAction.js index 50721584..49ee1340 100644 --- a/lib/models/emailAction.js +++ b/lib/models/emailAction.js @@ -80,10 +80,10 @@ function SendMail(action, event, callback) { smtpConfig = config.smtp; msgFromConfig = 'from global'; } - var smtpAuth = smtpConfig.auth; - smtpConfig.auth = { user: 'UUU', pass: 'XXX' }; + var smtpAuth = { ...smtpConfig.auth }; // force clone + smtpConfig.auth = { user: 'UUU', pass: 'XXX' }; // fake auth for log purposes logger.debug('Using smtp transporter %j config: %j', msgFromConfig, smtpConfig); - smtpConfig.auth = smtpAuth; + smtpConfig.auth = smtpAuth; // restore auth transporter = nodemailer.createTransport(smtpTransport(smtpConfig)); metrics.IncMetrics(event.service, event.subservice, metrics.actionEmail); @@ -105,6 +105,7 @@ function SendMail(action, event, callback) { }; opt2log.smtp.auth = { user: 'UUU', pass: 'XXX' }; myutils.logErrorIf(err, util.format('emailAction.SendMail %j', opt2log)); + smtpConfig.auth = smtpAuth; // ensure smtpConfig.auth is not tainted alarm.raise(alarm.EMAIL); } else { metrics.IncMetrics(event.service, event.subservice, metrics.okActionEmail); From 12b80c92f9b99313df239fb89e1800f8b5dddbbc Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Mon, 29 Jul 2024 14:58:28 +0200 Subject: [PATCH 28/40] fix linter --- lib/models/emailAction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/emailAction.js b/lib/models/emailAction.js index 49ee1340..9f394414 100644 --- a/lib/models/emailAction.js +++ b/lib/models/emailAction.js @@ -80,7 +80,7 @@ function SendMail(action, event, callback) { smtpConfig = config.smtp; msgFromConfig = 'from global'; } - var smtpAuth = { ...smtpConfig.auth }; // force clone + var smtpAuth = Object.assign({}, smtpConfig.auth); // force clone smtpConfig.auth = { user: 'UUU', pass: 'XXX' }; // fake auth for log purposes logger.debug('Using smtp transporter %j config: %j', msgFromConfig, smtpConfig); smtpConfig.auth = smtpAuth; // restore auth From e9e0dbaaba220d7be18db07a1f2a2ac930b6597c Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Tue, 30 Jul 2024 08:20:57 +0200 Subject: [PATCH 29/40] update CNR --- CHANGES_NEXT_RELEASE | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index e69de29b..ec926929 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -0,0 +1 @@ +- Fix smtpConfig after error in emailAction rule (#798) From 18c9359f32c1705690262c94dd0dd92650e396ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Tue, 30 Jul 2024 09:00:25 +0200 Subject: [PATCH 30/40] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index ec926929..52c9debf 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1 @@ -- Fix smtpConfig after error in emailAction rule (#798) +- Fix: smtpConfig after error in emailAction rule (#798) From ffef43025ce78be5f9f850daa1042202fc776811 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Tue, 30 Jul 2024 10:08:32 +0200 Subject: [PATCH 31/40] step 1.33.0-next -> 1.34.0 --- Changelog | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 5ebdcb62..d428fd98 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,7 @@ +1.34.0 (July 30th, 2024) + +- Fix: smtpConfig after error in emailAction rule (#798) + 1.33.0 (July 29th, 2024) - Fix: do not search in entities collection with strict mode by non_signal checker (#793) diff --git a/package.json b/package.json index f011d6f1..b0f4badc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "perseo", "description": "IOT CEP front End", "license": "AGPL-3.0-only", - "version": "1.33.0-next", + "version": "1.34.0", "author": { "name": "crbrox", "email": "carlos.romerobrox@telefonica.com" From e66b6d3ce9c4c7a6e3dc75a975f459b700fe8de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Tue, 30 Jul 2024 10:50:50 +0200 Subject: [PATCH 32/40] FIX flush CHANGES_NEXT_RELEASE file --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 52c9debf..8b137891 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1 @@ -- Fix: smtpConfig after error in emailAction rule (#798) + From c86c09cefd7d7b55651451a195625ee8fb0d7ff9 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Tue, 30 Jul 2024 10:54:17 +0200 Subject: [PATCH 33/40] 1.34.0 -> 1.34.0-next --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b0f4badc..c5694436 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "perseo", "description": "IOT CEP front End", "license": "AGPL-3.0-only", - "version": "1.34.0", + "version": "1.34.0-next", "author": { "name": "crbrox", "email": "carlos.romerobrox@telefonica.com" From 73431e25560b36ce4ebe0185f7af308c5cd3a005 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Tue, 30 Jul 2024 12:30:41 +0200 Subject: [PATCH 34/40] check exists smtp.auth config before clone to obj --- lib/models/emailAction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/emailAction.js b/lib/models/emailAction.js index 9f394414..9e5ac7ab 100644 --- a/lib/models/emailAction.js +++ b/lib/models/emailAction.js @@ -80,7 +80,7 @@ function SendMail(action, event, callback) { smtpConfig = config.smtp; msgFromConfig = 'from global'; } - var smtpAuth = Object.assign({}, smtpConfig.auth); // force clone + var smtpAuth = smtpConfig.auth ? Object.assign({}, smtpConfig.auth) : undefined; // force clone smtpConfig.auth = { user: 'UUU', pass: 'XXX' }; // fake auth for log purposes logger.debug('Using smtp transporter %j config: %j', msgFromConfig, smtpConfig); smtpConfig.auth = smtpAuth; // restore auth From 97475b8b2722adc74257da1ddb49d26ced57f7ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Tue, 30 Jul 2024 12:54:08 +0200 Subject: [PATCH 35/40] FIX back to 1.34.0 version number to retag --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c5694436..b0f4badc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "perseo", "description": "IOT CEP front End", "license": "AGPL-3.0-only", - "version": "1.34.0-next", + "version": "1.34.0", "author": { "name": "crbrox", "email": "carlos.romerobrox@telefonica.com" From ec8608525660dab2909d2bf84eb5fb886eaa66df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Tue, 30 Jul 2024 13:25:56 +0200 Subject: [PATCH 36/40] FIX version with next in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b0f4badc..c5694436 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "perseo", "description": "IOT CEP front End", "license": "AGPL-3.0-only", - "version": "1.34.0", + "version": "1.34.0-next", "author": { "name": "crbrox", "email": "carlos.romerobrox@telefonica.com" From 11eddb6ab8a5ab13c3539d85952ffad9b617dd6d Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 11 Sep 2024 10:06:11 +0200 Subject: [PATCH 37/40] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c5694436..a9fb273d 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "keywords": [], "dependencies": { "async": "2.6.4", - "body-parser": "~1.18.2", + "body-parser": "~1.20.3", "express": "4.19.2", "logops": "2.1.2", "mongodb": "3.6.12", From fe6b330d1f2d14bb610dc204d76548e2087f6133 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 11 Sep 2024 10:06:55 +0200 Subject: [PATCH 38/40] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 8b137891..b1704bb6 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1 @@ - +- Upgrade body-parser dep from 1.18.2 to 1.20.3 From a044a18875ca751ba2a5a3c1e6c3d0a592fee32b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 08:41:33 +0000 Subject: [PATCH 39/40] Bump express from 4.19.2 to 4.20.0 Bumps [express](https://github.com/expressjs/express) from 4.19.2 to 4.20.0. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.19.2...4.20.0) --- updated-dependencies: - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a9fb273d..2106de9d 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "dependencies": { "async": "2.6.4", "body-parser": "~1.20.3", - "express": "4.19.2", + "express": "4.20.0", "logops": "2.1.2", "mongodb": "3.6.12", "ngsijs": "1.4.1", From d8c7c8686f9ec18e553afef49eae24e292db5166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Wed, 11 Sep 2024 10:43:44 +0200 Subject: [PATCH 40/40] ADD CNR entry --- CHANGES_NEXT_RELEASE | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index b1704bb6..267d2503 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1,2 @@ +- Upgrade express from 4.19.2 to 4.20.0 - Upgrade body-parser dep from 1.18.2 to 1.20.3