From 2e2609ac9086c50e2b4de1113ba85f5294327f35 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Fri, 1 Sep 2023 13:41:25 -0500 Subject: [PATCH 01/11] fix tile title Signed-off-by: 1000TurquoisePogs --- lib/apiml.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/apiml.js b/lib/apiml.js index a8d5525b..7b71082b 100644 --- a/lib/apiml.js +++ b/lib/apiml.js @@ -68,7 +68,7 @@ const MEDIATION_LAYER_INSTANCE_DEFAULTS = (zluxProto, zluxHostname, zluxPort) => "apiml.catalog.tile.version": zluxUtil.getZoweVersion(), - "apiml.service.title": "Core and Plugin Dataservice APIs", + "apiml.service.title": "App Server", "apiml.service.description": `This list includes core APIs for management of plugins, management of the server itself, and APIs brought by plugins and the app server agent, ZSS. Plugins that do not bring their own API documentation are shown here as stubs.`, "apiml.authentication.sso": "true", From cd1cf6af732fe80e3003e11a0584232f66a05786 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Wed, 20 Sep 2023 15:39:16 -0400 Subject: [PATCH 02/11] Skip unused auth plugins. Fix a bug where _internal contents were not loaded at dataservice init time. Signed-off-by: 1000TurquoisePogs --- lib/auth-manager.js | 34 +++++++++++++++++++++++++++++++++- lib/index.js | 7 +++---- lib/plugin-loader.js | 4 ++++ lib/webapp.js | 4 ++-- 4 files changed, 42 insertions(+), 7 deletions(-) diff --git a/lib/auth-manager.js b/lib/auth-manager.js index a96f0417..f31520f6 100644 --- a/lib/auth-manager.js +++ b/lib/auth-manager.js @@ -82,9 +82,29 @@ AuthManager.prototype = { registerAuthenticator(plugin) { this.pendingPlugins.push(plugin); }, + + getRequestedAuthCategories(startupPlugins, componentConfig) { + const requestedCategories = []; + startupPlugins.forEach((plugin)=> { + plugin.dataServices.forEach((service)=> { + const authenticationData = + configService.getServiceConfiguration(plugin.identifier, plugin.location, + service.name, componentConfig, + componentConfig.productCode) + .getContents(['authentication.json']); + if (authenticationData && !requestedCategories.includes(authenticationData.authType)) { + requestedCategories.push(authenticationData.authType); + } + }); + }); + return requestedCategories; + }, - loadAuthenticators: Promise.coroutine(function*(config, tlsOptions) { + loadAuthenticators: Promise.coroutine(function*(config, tlsOptions, startupPlugins) { + const requestedCategories = this.getRequestedAuthCategories(startupPlugins, config); + + let plugin; const isHaMode = zluxUtil.isHaMode(); while ((plugin = this.pendingPlugins.pop()) !== undefined) { @@ -116,6 +136,18 @@ AuthManager.prototype = { } else { categories = [plugin.authenticationCategory]; } + + //do not load this plugin if no dataservices are going to use it + let categoryFound = false; + for (let i = 0; i < categories.length; i++) { + if (requestedCategories.includes(categories[i])) { + categoryFound = true; + break; + } + } + if (!categoryFound) { + continue; //this plugin was not needed by any dataservice. including it may cause unnecessary auth requests to unnecessary endpoints. + } categories.forEach((category)=> { let pluginsByCategory = this.authTypes[category]; if (!pluginsByCategory) { diff --git a/lib/index.js b/lib/index.js index 97fe593c..64df1860 100755 --- a/lib/index.js +++ b/lib/index.js @@ -259,7 +259,6 @@ Server.prototype = { util.deepFreeze(this.zoweConfig); this.webApp = makeWebApp(webAppOptions); - yield this.webServer.startListening(this.webApp); this.webApp.init(); bootstrapLogger.info('ZWED0302I', util.isHaMode() ? 'enabled' : 'disabled'); // "HA mode is %s" @@ -267,10 +266,10 @@ Server.prototype = { this.configureApimlStorage(apimlConfig); } - yield this.loadPlugins(); - - yield this.authManager.loadAuthenticators(this.zoweConfig, Object.assign({},this.tlsOptions)); + const plugins = yield this.loadPlugins(); + yield this.authManager.loadAuthenticators(this.zoweConfig, Object.assign({},this.tlsOptions), plugins); this.authManager.validateAuthPluginList(); + yield this.webServer.startListening(this.webApp); this.processManager.addCleanupFunction(function() { this.webServer.close(); diff --git a/lib/plugin-loader.js b/lib/plugin-loader.js index 94abcc30..8e61cda6 100644 --- a/lib/plugin-loader.js +++ b/lib/plugin-loader.js @@ -867,12 +867,16 @@ PluginLoader.prototype = { } } this.registerStaticPluginsWithManagers(sortedAndRejectedPlugins.plugins); + + + for (const plugin of newPlugins) { this.emit('pluginFound', { data: plugin, count: newPlugins.length }); } + return newPlugins; }), // Note - Not to be confused with auth capabilities, that describe what an auth plugin can do diff --git a/lib/webapp.js b/lib/webapp.js index 6e7df64a..7097c397 100644 --- a/lib/webapp.js +++ b/lib/webapp.js @@ -1821,8 +1821,8 @@ WebApp.prototype = { case "router": { //installLog.info(`${plugin.identifier}: installing node router at ${subUrl}`); const serviceConfiguration = configService.getServiceConfiguration( - plugin.identifier, service.name, - pluginContext.server.config.app, this.options.componentConfig.node.productCode); + plugin.identifier, plugin.location, service.name, + this.options.componentConfig, this.options.componentConfig.node.productCode); const dataserviceContext = new DataserviceContext(service, serviceConfiguration, pluginContext, this); From 43fac66b25bc5179f6168587369abce5d6cb4896 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Wed, 20 Sep 2023 15:42:07 -0400 Subject: [PATCH 03/11] Update changelog Signed-off-by: 1000TurquoisePogs --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aea3b8c2..e712e3a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to the Zlux Server Framework package will be documented in this file.. This repo is part of the app-server Zowe Component, and the change logs here may appear on Zowe.org in that section. +## 2.12.0 + +- Enhancement: Auth plugins that are not requested by any dataservice found at startup are no longer loaded by the server. + ## 2.11.0 - Enhancement: The title and description of the app server within the api catalog has been updated to be more complete, accurate, and useful. From 55482244082fbb78c99648764c98a96d432583d1 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Wed, 20 Sep 2023 15:57:55 -0400 Subject: [PATCH 04/11] Add default auth type into array Signed-off-by: 1000TurquoisePogs --- lib/auth-manager.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/auth-manager.js b/lib/auth-manager.js index f31520f6..be54724d 100644 --- a/lib/auth-manager.js +++ b/lib/auth-manager.js @@ -84,7 +84,7 @@ AuthManager.prototype = { }, getRequestedAuthCategories(startupPlugins, componentConfig) { - const requestedCategories = []; + const requestedCategories = [componentConfig.node.dataserviceAuthentication.defaultAuthentication]; startupPlugins.forEach((plugin)=> { plugin.dataServices.forEach((service)=> { const authenticationData = @@ -102,7 +102,8 @@ AuthManager.prototype = { loadAuthenticators: Promise.coroutine(function*(config, tlsOptions, startupPlugins) { - const requestedCategories = this.getRequestedAuthCategories(startupPlugins, config); + const componentConfig = config.components['app-server']; + const requestedCategories = this.getRequestedAuthCategories(startupPlugins, componentConfig); let plugin; @@ -112,7 +113,7 @@ AuthManager.prototype = { const authenticationHandler = yield plugin.authenticationModule( plugin, this.configuration, - config.components['app-server'], + componentConfig, new AuthPluginContext(plugin, tlsOptions)); // at this time we should have resolved plugin configuration to have a // nice list of info about what we are using to authenticate against From fb6f2a886fef0a4359a7075a39cceefe339b09ba Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Wed, 20 Sep 2023 16:06:39 -0400 Subject: [PATCH 05/11] Revert change of listening order Signed-off-by: 1000TurquoisePogs --- lib/index.js | 2 +- lib/webserver.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 64df1860..9a6441c7 100755 --- a/lib/index.js +++ b/lib/index.js @@ -259,6 +259,7 @@ Server.prototype = { util.deepFreeze(this.zoweConfig); this.webApp = makeWebApp(webAppOptions); + yield this.webServer.startListening(this.webApp); this.webApp.init(); bootstrapLogger.info('ZWED0302I', util.isHaMode() ? 'enabled' : 'disabled'); // "HA mode is %s" @@ -269,7 +270,6 @@ Server.prototype = { const plugins = yield this.loadPlugins(); yield this.authManager.loadAuthenticators(this.zoweConfig, Object.assign({},this.tlsOptions), plugins); this.authManager.validateAuthPluginList(); - yield this.webServer.startListening(this.webApp); this.processManager.addCleanupFunction(function() { this.webServer.close(); diff --git a/lib/webserver.js b/lib/webserver.js index 8216d1dd..0787af25 100644 --- a/lib/webserver.js +++ b/lib/webserver.js @@ -355,7 +355,7 @@ WebServer.prototype = { bootstrapLogger.debug('TLS trace:', this.httpsOptions.enableTrace ? 'enabled' : 'disabled'); readTlsOptionsFromConfig(nodeConfig, this.httpsOptions, zoweConfig.zowe?.certificate?.keystore?.password); } - }, + }, startListening: Promise.coroutine(function* (webapp) { if (this.config.https && this.config.https.port) { From c6565950bb59b922bff6b97289a2965c5b2110a9 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Thu, 21 Sep 2023 15:48:29 -0400 Subject: [PATCH 06/11] Fixed incorrect object Signed-off-by: 1000TurquoisePogs --- lib/auth-manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/auth-manager.js b/lib/auth-manager.js index be54724d..9053575f 100644 --- a/lib/auth-manager.js +++ b/lib/auth-manager.js @@ -84,7 +84,7 @@ AuthManager.prototype = { }, getRequestedAuthCategories(startupPlugins, componentConfig) { - const requestedCategories = [componentConfig.node.dataserviceAuthentication.defaultAuthentication]; + const requestedCategories = [componentConfig.dataserviceAuthentication.defaultAuthentication]; startupPlugins.forEach((plugin)=> { plugin.dataServices.forEach((service)=> { const authenticationData = From cc6962d601491e672a26a59d739ebd76f5b4dc0a Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Thu, 21 Sep 2023 16:48:43 -0400 Subject: [PATCH 07/11] Got logic working by changing yields, returns, promises Signed-off-by: 1000TurquoisePogs --- lib/auth-manager.js | 23 +++++++++++++---------- lib/index.js | 2 +- lib/plugin-loader.js | 4 ++-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/auth-manager.js b/lib/auth-manager.js index 9053575f..bc2d01a1 100644 --- a/lib/auth-manager.js +++ b/lib/auth-manager.js @@ -86,16 +86,18 @@ AuthManager.prototype = { getRequestedAuthCategories(startupPlugins, componentConfig) { const requestedCategories = [componentConfig.dataserviceAuthentication.defaultAuthentication]; startupPlugins.forEach((plugin)=> { - plugin.dataServices.forEach((service)=> { - const authenticationData = - configService.getServiceConfiguration(plugin.identifier, plugin.location, - service.name, componentConfig, - componentConfig.productCode) - .getContents(['authentication.json']); - if (authenticationData && !requestedCategories.includes(authenticationData.authType)) { - requestedCategories.push(authenticationData.authType); - } - }); + if (plugin.dataServices) { + plugin.dataServices.forEach((service)=> { + const authenticationData = + configService.getServiceConfiguration(plugin.identifier, plugin.location, + service.name, componentConfig, + componentConfig.productCode) + .getContents(['authentication.json']); + if (authenticationData && !requestedCategories.includes(authenticationData.authType)) { + requestedCategories.push(authenticationData.authType); + } + }); + } }); return requestedCategories; }, @@ -147,6 +149,7 @@ AuthManager.prototype = { } } if (!categoryFound) { + bootstrapLogger.info(`Plugin ${plugin.identifier} will not be loaded because no dataservices requested it.`); continue; //this plugin was not needed by any dataservice. including it may cause unnecessary auth requests to unnecessary endpoints. } categories.forEach((category)=> { diff --git a/lib/index.js b/lib/index.js index 9a6441c7..0a058589 100755 --- a/lib/index.js +++ b/lib/index.js @@ -333,7 +333,7 @@ Server.prototype = { }); } }, installLogger)); - yield this.pluginLoader.loadPlugins(); + return yield this.pluginLoader.loadPlugins(); }), configureApimlStorage(apimlConfig) { diff --git a/lib/plugin-loader.js b/lib/plugin-loader.js index 8e61cda6..78f9eb12 100644 --- a/lib/plugin-loader.js +++ b/lib/plugin-loader.js @@ -770,7 +770,7 @@ PluginLoader.prototype = { loadPlugins: Promise.coroutine(function*() { const defs = this.readPluginDefs(); - yield this.installPlugins(defs); + return yield this.installPlugins(defs); }), scanForPlugins() { @@ -876,7 +876,7 @@ PluginLoader.prototype = { count: newPlugins.length }); } - return newPlugins; + return yield Promise.resolve(newPlugins); }), // Note - Not to be confused with auth capabilities, that describe what an auth plugin can do From 3b9d66b356864883ca0a480181b349ea0346a7a5 Mon Sep 17 00:00:00 2001 From: MarkAckert Date: Wed, 27 Sep 2023 14:26:40 -0400 Subject: [PATCH 08/11] update mocha to fix minimatch vers Signed-off-by: MarkAckert --- package-lock.json | 435 ++++++++++++++++++---------------------------- package.json | 2 +- 2 files changed, 173 insertions(+), 264 deletions(-) diff --git a/package-lock.json b/package-lock.json index 184fa87b..dc770e65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,7 @@ "@types/qs": "6.9.3", "chai": "~4.2.0", "chai-http": "~4.2.0", - "mocha": "~8.4.0", + "mocha": "~10.2.0", "typescript": "~5.0.0" }, "optionalDependencies": { @@ -297,12 +297,6 @@ "@types/node": "*" } }, - "node_modules/@ungap/promise-all-settled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", - "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true - }, "node_modules/accept-language-parser": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/accept-language-parser/-/accept-language-parser-1.5.0.tgz", @@ -344,15 +338,6 @@ "node": ">=6" } }, - "node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -679,24 +664,30 @@ } }, "node_modules/chokidar": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", - "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], "dependencies": { - "anymatch": "~3.1.1", + "anymatch": "~3.1.2", "braces": "~3.0.2", - "glob-parent": "~5.1.0", + "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" + "readdirp": "~3.6.0" }, "engines": { "node": ">= 8.10.0" }, "optionalDependencies": { - "fsevents": "~2.3.1" + "fsevents": "~2.3.2" } }, "node_modules/cliui": { @@ -1418,15 +1409,6 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" }, - "node_modules/growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true, - "engines": { - "node": ">=4.x" - } - }, "node_modules/har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -1590,15 +1572,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -1646,18 +1619,24 @@ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "dev": true }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, "node_modules/isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", @@ -1750,15 +1729,19 @@ "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" }, "node_modules/log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { - "chalk": "^4.0.0" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/media-typer": { @@ -1855,43 +1838,39 @@ } }, "node_modules/mocha": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz", - "integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", + "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", "dev": true, "dependencies": { - "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.5.1", - "debug": "4.3.1", + "chokidar": "3.5.3", + "debug": "4.3.4", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", - "glob": "7.1.6", - "growl": "1.10.5", + "glob": "7.2.0", "he": "1.2.0", - "js-yaml": "4.0.0", - "log-symbols": "4.0.0", - "minimatch": "3.0.4", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", "ms": "2.1.3", - "nanoid": "3.1.20", - "serialize-javascript": "5.0.1", + "nanoid": "3.3.3", + "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", - "which": "2.0.2", - "wide-align": "1.1.3", - "workerpool": "6.1.0", + "workerpool": "6.2.1", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" }, "bin": { "_mocha": "bin/_mocha", - "mocha": "bin/mocha" + "mocha": "bin/mocha.js" }, "engines": { - "node": ">= 10.12.0" + "node": ">= 14.0.0" }, "funding": { "type": "opencollective", @@ -1905,9 +1884,9 @@ "dev": true }, "node_modules/mocha/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -1928,9 +1907,9 @@ "dev": true }, "node_modules/mocha/node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -1947,10 +1926,22 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/mocha/node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/mocha/node_modules/js-yaml": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", - "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { "argparse": "^2.0.1" @@ -1960,15 +1951,24 @@ } }, "node_modules/mocha/node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/minimatch/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" } }, "node_modules/mocha/node_modules/ms": { @@ -1983,9 +1983,9 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/nanoid": { - "version": "3.1.20", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", - "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", + "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", "dev": true, "bin": { "nanoid": "bin/nanoid.cjs" @@ -2307,9 +2307,9 @@ "dev": true }, "node_modules/readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "dependencies": { "picomatch": "^2.2.1" @@ -2412,9 +2412,9 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/serialize-javascript": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "dependencies": { "randombytes": "^2.1.0" @@ -2504,31 +2504,6 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -2789,34 +2764,10 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "dependencies": { - "string-width": "^1.0.2 || 2" - } - }, "node_modules/workerpool": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz", - "integrity": "sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", "dev": true }, "node_modules/wrap-ansi": { @@ -3267,12 +3218,6 @@ "@types/node": "*" } }, - "@ungap/promise-all-settled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", - "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true - }, "accept-language-parser": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/accept-language-parser/-/accept-language-parser-1.5.0.tgz", @@ -3304,12 +3249,6 @@ "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, - "ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true - }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -3573,19 +3512,19 @@ "dev": true }, "chokidar": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", - "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "requires": { - "anymatch": "~3.1.1", + "anymatch": "~3.1.2", "braces": "~3.0.2", - "fsevents": "~2.3.1", - "glob-parent": "~5.1.0", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" + "readdirp": "~3.6.0" } }, "cliui": { @@ -4132,12 +4071,6 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -4252,12 +4185,6 @@ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true - }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -4293,18 +4220,18 @@ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "dev": true }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", @@ -4384,12 +4311,13 @@ "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" }, "log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "requires": { - "chalk": "^4.0.0" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" } }, "media-typer": { @@ -4456,33 +4384,29 @@ } }, "mocha": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz", - "integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", + "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", "dev": true, "requires": { - "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.5.1", - "debug": "4.3.1", + "chokidar": "3.5.3", + "debug": "4.3.4", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", - "glob": "7.1.6", - "growl": "1.10.5", + "glob": "7.2.0", "he": "1.2.0", - "js-yaml": "4.0.0", - "log-symbols": "4.0.0", - "minimatch": "3.0.4", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", "ms": "2.1.3", - "nanoid": "3.1.20", - "serialize-javascript": "5.0.1", + "nanoid": "3.3.3", + "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", - "which": "2.0.2", - "wide-align": "1.1.3", - "workerpool": "6.1.0", + "workerpool": "6.2.1", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" @@ -4495,9 +4419,9 @@ "dev": true }, "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { "ms": "2.1.2" @@ -4512,9 +4436,9 @@ } }, "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -4523,24 +4447,46 @@ "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" + }, + "dependencies": { + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } } }, "js-yaml": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", - "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { "argparse": "^2.0.1" } }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + } } }, "ms": { @@ -4557,9 +4503,9 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "nanoid": { - "version": "3.1.20", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", - "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", + "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", "dev": true }, "ncp": { @@ -4790,9 +4736,9 @@ } }, "readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "requires": { "picomatch": "^2.2.1" @@ -4865,9 +4811,9 @@ } }, "serialize-javascript": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "requires": { "randombytes": "^2.1.0" @@ -4942,25 +4888,6 @@ } } }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -5156,28 +5083,10 @@ } } }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, "workerpool": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz", - "integrity": "sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", "dev": true }, "wrap-ansi": { diff --git a/package.json b/package.json index 6394e230..6b3ddf2e 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "@types/qs": "6.9.3", "chai": "~4.2.0", "chai-http": "~4.2.0", - "mocha": "~8.4.0", + "mocha": "~10.2.0", "typescript": "~5.0.0" }, "optionalDependencies": { From 509a2bed435ea903e84d0f390a2649b60bf6b9b5 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Fri, 6 Oct 2023 08:30:13 -0400 Subject: [PATCH 09/11] Moved handler array setting to bugfix auth plugin still being loaded Signed-off-by: 1000TurquoisePogs --- lib/assets/i18n/log/messages_en.json | 1 + lib/auth-manager.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/assets/i18n/log/messages_en.json b/lib/assets/i18n/log/messages_en.json index 74c04fc8..46725905 100644 --- a/lib/assets/i18n/log/messages_en.json +++ b/lib/assets/i18n/log/messages_en.json @@ -187,6 +187,7 @@ "ZWED0300I": "APIML Storage configured", "ZWED0301I": "Found %s in config for '%s'", "ZWED0302I": "HA mode is %s", + "ZWED0303I": "Plugin %s will not be loaded because no dataservices requested it", "ZWED0003W":"User=%s (%s): Session %s failed. Plugin response: %s", "ZWED0004W":"Tomcat for ID=%s not starting, no services succeeded loading", diff --git a/lib/auth-manager.js b/lib/auth-manager.js index bc2d01a1..4a13ca10 100644 --- a/lib/auth-manager.js +++ b/lib/auth-manager.js @@ -130,7 +130,6 @@ AuthManager.prototype = { bootstrapLogger.warn('ZWED0178W', plugin.identifier); // "Skipping authentication plugin %s because it's not HA compatible" continue; } - this.handlers[plugin.identifier] = authenticationHandler; let categories; if (authenticationHandler.capabilities && authenticationHandler.capabilities.canGetCategories) { categories = authenticationHandler.getCategories(); @@ -149,7 +148,7 @@ AuthManager.prototype = { } } if (!categoryFound) { - bootstrapLogger.info(`Plugin ${plugin.identifier} will not be loaded because no dataservices requested it.`); + bootstrapLogger.info('ZWED0303I', plugin.identifier); continue; //this plugin was not needed by any dataservice. including it may cause unnecessary auth requests to unnecessary endpoints. } categories.forEach((category)=> { @@ -172,6 +171,8 @@ AuthManager.prototype = { //`Authentication plugin ${plugin.identifier} added to category ` //+ `${category}`); }); + //load the plugin + this.handlers[plugin.identifier] = authenticationHandler; } catch (e) { authLog.warn('ZWED0008W', plugin.identifier, e); //authLog.warn(`error loading auth plugin ${plugin.identifier}: ` + e); } From ee3c0a876801fd19f11c921af7325673ab8990ae Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Mon, 9 Oct 2023 17:25:16 -0400 Subject: [PATCH 10/11] Bugfixes for plugin config loader using wrong object, and product code being in node Signed-off-by: 1000TurquoisePogs --- lib/auth-manager.js | 2 +- lib/plugin-loader.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/auth-manager.js b/lib/auth-manager.js index 4a13ca10..783ff90e 100644 --- a/lib/auth-manager.js +++ b/lib/auth-manager.js @@ -91,7 +91,7 @@ AuthManager.prototype = { const authenticationData = configService.getServiceConfiguration(plugin.identifier, plugin.location, service.name, componentConfig, - componentConfig.productCode) + componentConfig.node.productCode) .getContents(['authentication.json']); if (authenticationData && !requestedCategories.includes(authenticationData.authType)) { requestedCategories.push(authenticationData.authType); diff --git a/lib/plugin-loader.js b/lib/plugin-loader.js index 78f9eb12..032bc179 100644 --- a/lib/plugin-loader.js +++ b/lib/plugin-loader.js @@ -1063,7 +1063,7 @@ PluginLoader.prototype = { bootstrapLogger.info("ZWED0046I", pluginDef.identifier); //bootstrapLogger.info("Adding dynamic plugin " + pluginDef.identifier); const pluginConfiguration = configService.getPluginConfiguration( pluginDef.identifier, pluginDef.location, - this.options.serverConfig, this.options.productCode); + this.options.serverConfig.components['app-server'], this.options.productCode); const plugin = makePlugin(pluginDef, pluginConfiguration, pluginContext, true); // if (!this.unresolvedImports.allImportsResolved(pluginContext.plugins)) { From d24e801de785f8254388d2c5238fc2b2c5be9d00 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Tue, 10 Oct 2023 15:18:58 -0400 Subject: [PATCH 11/11] revert bug spotted with 401 warn Signed-off-by: 1000TurquoisePogs --- lib/plugin-loader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugin-loader.js b/lib/plugin-loader.js index 032bc179..78f9eb12 100644 --- a/lib/plugin-loader.js +++ b/lib/plugin-loader.js @@ -1063,7 +1063,7 @@ PluginLoader.prototype = { bootstrapLogger.info("ZWED0046I", pluginDef.identifier); //bootstrapLogger.info("Adding dynamic plugin " + pluginDef.identifier); const pluginConfiguration = configService.getPluginConfiguration( pluginDef.identifier, pluginDef.location, - this.options.serverConfig.components['app-server'], this.options.productCode); + this.options.serverConfig, this.options.productCode); const plugin = makePlugin(pluginDef, pluginConfiguration, pluginContext, true); // if (!this.unresolvedImports.allImportsResolved(pluginContext.plugins)) {