From 2bb426d52b29a9c797b1a2307110acf3c0082b7e Mon Sep 17 00:00:00 2001 From: Valentin Genev Date: Fri, 5 Mar 2021 17:31:20 +0200 Subject: [PATCH] fix: #1977 timeout enumeration for cron job fixed (#824) * fixed enum value * fixed dependencies * fix: removed unused config * fix: vulnerability check ignored urijs dependency for a month * removed unused config from docker configs --- audit-resolve.json | 12 +++++- config/default.json | 5 --- docker/central-ledger/default.json | 5 --- package-lock.json | 59 +++++++++++++++++------------- package.json | 6 +-- src/handlers/timeouts/handler.js | 2 +- src/lib/config.js | 4 -- test/integration-config.json | 5 --- 8 files changed, 49 insertions(+), 49 deletions(-) diff --git a/audit-resolve.json b/audit-resolve.json index cee741ab9..b671d3c00 100644 --- a/audit-resolve.json +++ b/audit-resolve.json @@ -114,8 +114,18 @@ "decision": "ignore", "madeAt": 1613868373740, "expiresAt": 1616460368344 + }, + "1640|@mojaloop/central-services-health>@mojaloop/central-services-shared>widdershins>urijs": { + "decision": "ignore", + "madeAt": 1614766410157, + "expiresAt": 1617358384743 + }, + "1640|@mojaloop/central-services-shared>widdershins>urijs": { + "decision": "ignore", + "madeAt": 1614766410157, + "expiresAt": 1617358384743 } }, "rules": {}, "version": 1 -} +} \ No newline at end of file diff --git a/config/default.json b/config/default.json index 286abf866..b4440af8a 100644 --- a/config/default.json +++ b/config/default.json @@ -46,11 +46,6 @@ "API": { "DISABLED": false }, - "CRON": { - "DISABLED": false, - "TIMEXP": "*/10 * * * * *", - "TIMEZONE": "UTC" - }, "TIMEOUT": { "DISABLED": false, "TIMEXP": "*/15 * * * * *", diff --git a/docker/central-ledger/default.json b/docker/central-ledger/default.json index 199a8b452..198ec260d 100644 --- a/docker/central-ledger/default.json +++ b/docker/central-ledger/default.json @@ -46,11 +46,6 @@ "API": { "DISABLED": false }, - "CRON": { - "DISABLED": false, - "TIMEXP": "*/10 * * * * *", - "TIMEZONE": "UTC" - }, "TIMEOUT": { "DISABLED": false, "TIMEXP": "*/15 * * * * *", diff --git a/package-lock.json b/package-lock.json index 4572a2571..b2ca04a99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1027,9 +1027,9 @@ } }, "@mojaloop/central-services-shared": { - "version": "11.5.5", - "resolved": "https://registry.npmjs.org/@mojaloop/central-services-shared/-/central-services-shared-11.5.5.tgz", - "integrity": "sha512-yWoylUSs27Hagf8Cj8itwKaxGJB4mGwsmQGF10y0gppfmhZtQ+gSIBFbGiefGjWuLPyNW8gJKB0vR/mTPxx/DQ==", + "version": "11.5.6", + "resolved": "https://registry.npmjs.org/@mojaloop/central-services-shared/-/central-services-shared-11.5.6.tgz", + "integrity": "sha512-tcHhrqgr5BW35ZBiBcsmHlyH290Wmn7EFFYYav1iSgP8d92Zo6agE1e2xMnUK+AvcpBslfc60PTMyQQwNkksTw==", "requires": { "@hapi/catbox": "11.1.1", "@hapi/catbox-memory": "5.0.0", @@ -7839,29 +7839,25 @@ "dev": true }, "knex": { - "version": "0.21.18", - "resolved": "https://registry.npmjs.org/knex/-/knex-0.21.18.tgz", - "integrity": "sha512-hP4Qyy2LjQLsabQYc6YgDFHb+CJJBjQz1TMPTKyN85CF2NLIsZsF4FDe0NvQXeXMeak3E/kKr5iJog1JBm6ZCQ==", + "version": "0.95.1", + "resolved": "https://registry.npmjs.org/knex/-/knex-0.95.1.tgz", + "integrity": "sha512-8vAmH4M6ks0qXHqaIacUOTtGAVc1PPFuF8W/W9bzuUHcQur4809mtufw1LY6n/tNRTLwMFBSXWkUnfFQFqFvNQ==", "requires": { "colorette": "1.2.1", - "commander": "^6.2.0", + "commander": "^7.1.0", "debug": "4.3.1", + "escalade": "^3.1.1", "esm": "^3.2.25", "getopts": "2.2.5", "interpret": "^2.2.0", - "liftoff": "3.1.0", - "lodash": "^4.17.20", + "lodash": "^4.17.21", "pg-connection-string": "2.4.0", + "rechoir": "^0.7.0", + "resolve-from": "^5.0.0", "tarn": "^3.0.1", - "tildify": "2.0.0", - "v8flags": "^3.2.0" + "tildify": "2.0.0" }, "dependencies": { - "commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==" - }, "debug": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", @@ -7874,6 +7870,19 @@ "version": "2.4.0", "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.4.0.tgz", "integrity": "sha512-3iBXuv7XKvxeMrIgym7njT+HlZkwZqqGX4Bu9cci8xHZNT+Um1gWKqCsAzcC0d95rcKMU5WBg6YRUcHyV0HZKQ==" + }, + "rechoir": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", + "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", + "requires": { + "resolve": "^1.9.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==" } } }, @@ -9311,14 +9320,14 @@ } }, "npm-check-updates": { - "version": "11.1.9", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-11.1.9.tgz", - "integrity": "sha512-Ztl5q785Hw+yiUUnlhN/lmrYdzDpH6Mopr0xtijb9t6ltS4RwkIU9qZXuYlOJtPyEXNdmEdmSc2NpfFFs/Nreg==", + "version": "11.1.10", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-11.1.10.tgz", + "integrity": "sha512-T8o/3ls74Q8i3LbO9jjxI1YWA9ioJjjAnYt9BezbFn/D99STc+7pe633H0gLmNi4/5b1Xi3nlbI6UCbc6eb/pQ==", "dev": true, "requires": { "chalk": "^4.1.0", "cint": "^8.2.1", - "cli-table": "^0.3.4", + "cli-table": "^0.3.5", "commander": "^6.2.1", "find-up": "5.0.0", "fp-and-or": "^0.1.3", @@ -9328,10 +9337,10 @@ "json-parse-helpfulerror": "^1.0.3", "jsonlines": "^0.1.1", "libnpmconfig": "^1.2.1", - "lodash": "^4.17.20", + "lodash": "^4.17.21", "mem": "^8.0.0", "p-map": "^4.0.0", - "pacote": "^11.2.3", + "pacote": "^11.2.7", "parse-github-url": "^1.0.2", "progress": "^2.0.3", "prompts": "^2.4.0", @@ -9574,9 +9583,9 @@ } }, "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", "dev": true, "requires": { "emoji-regex": "^8.0.0", diff --git a/package.json b/package.json index 53e1f8677..1acf13388 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "@mojaloop/central-services-health": "11.0.0", "@mojaloop/central-services-logger": "10.6.0", "@mojaloop/central-services-metrics": "9.5.0", - "@mojaloop/central-services-shared": "11.5.5", + "@mojaloop/central-services-shared": "11.5.6", "@mojaloop/central-services-stream": "10.6.0", "@mojaloop/event-sdk": "10.6.0", "@mojaloop/forensic-logging-client": "8.3.0", @@ -112,7 +112,7 @@ "hapi-auth-bearer-token": "8.0.0", "hapi-swagger": "14.1.0", "ilp-packet": "2.2.0", - "knex": "0.21.18", + "knex": "0.95.1", "lodash": "4.17.21", "moment": "2.29.1", "mongoose": "5.11.18", @@ -132,7 +132,7 @@ "jsonpath": "1.1.0", "nodemon": "2.0.7", "npm-audit-resolver": "2.2.1", - "npm-check-updates": "11.1.9", + "npm-check-updates": "11.1.10", "nyc": "15.1.0", "pre-commit": "1.2.2", "proxyquire": "2.1.3", diff --git a/src/handlers/timeouts/handler.js b/src/handlers/timeouts/handler.js index 74ef15104..b892a071b 100644 --- a/src/handlers/timeouts/handler.js +++ b/src/handlers/timeouts/handler.js @@ -175,7 +175,7 @@ const registerTimeoutHandler = async () => { cronTime: Config.HANDLERS_TIMEOUT_TIMEXP, onTick: timeout, start: false, - timeZone: Config.HANDLERS_CRON_TIMEZONE + timeZone: Config.HANDLERS_TIMEOUT_TIMEZONE }) isRegistered = true diff --git a/src/lib/config.js b/src/lib/config.js index 494a24599..424d50acf 100644 --- a/src/lib/config.js +++ b/src/lib/config.js @@ -14,10 +14,6 @@ module.exports = { HANDLERS_DISABLED: RC.HANDLERS.DISABLED, HANDLERS_API: RC.HANDLERS.API, HANDLERS_API_DISABLED: RC.HANDLERS.API.DISABLED, - HANDLERS_CRON: RC.HANDLERS.CRON, - HANDLERS_CRON_DISABLED: RC.HANDLERS.CRON.DISABLED, - HANDLERS_CRON_TIMEXP: RC.HANDLERS.CRON.TIMEXP, - HANDLERS_CRON_TIMEZONE: RC.HANDLERS.CRON.TIMEZONE, HANDLERS_TIMEOUT: RC.HANDLERS.TIMEOUT, HANDLERS_TIMEOUT_DISABLED: RC.HANDLERS.TIMEOUT.DISABLED, HANDLERS_TIMEOUT_TIMEXP: RC.HANDLERS.TIMEOUT.TIMEXP, diff --git a/test/integration-config.json b/test/integration-config.json index ace38126d..3a56da008 100644 --- a/test/integration-config.json +++ b/test/integration-config.json @@ -50,11 +50,6 @@ "API": { "DISABLED": false }, - "CRON": { - "DISABLED": false, - "TIMEXP": "*/10 * * * * *", - "TIMEZONE": "UTC" - }, "TIMEOUT": { "DISABLED": false, "TIMEXP": "*/15 * * * * *",