From ba3cb011e00a7be3f4e6ed5e8526b3c42a3d270b Mon Sep 17 00:00:00 2001 From: blaise-favor Date: Tue, 4 Jul 2023 14:52:26 +0800 Subject: [PATCH 1/7] feat: integrated exp-config and handlebarjs --- app.js | 30 ++++++++++++++++++++++++++++ config/development.json | 6 ++++++ config/production.json | 6 ++++++ config/test.json | 7 +++++++ nodemon.json | 9 +++++++++ package-lock.json | 43 +++++++++++++++++++++++++++++++++++------ package.json | 2 ++ 7 files changed, 97 insertions(+), 6 deletions(-) create mode 100644 config/development.json create mode 100644 config/production.json create mode 100644 config/test.json create mode 100644 nodemon.json diff --git a/app.js b/app.js index c6a14a8..25855a9 100644 --- a/app.js +++ b/app.js @@ -1,18 +1,48 @@ 'use strict'; +const fs = require('fs'); +const path = require('path'); const Logger = require('./lib/logger.js'); const SetupApp = require('./lib/setupApp'); const { version } = require('./package.json'); const serverPromise = SetupApp(); +const cwd = process.cwd(); +const NODE_ENV = process.env.NODE_ENV || 'development'; +const CONFIG_BASE_PATH = process.env.CONFIG_BASE_PATH || './config'; +const configFileName = `${NODE_ENV}.json`; + +let configPath; +if (path.isAbsolute(CONFIG_BASE_PATH)) { + configPath = path.normalize(CONFIG_BASE_PATH) + path.sep + configFileName; +} else { + configPath = CONFIG_BASE_PATH.replace(/\/$/, '/') + '/' + configFileName; +} + module.exports = serverPromise; module.exports.start = start; if (require.main === module) { + validateConfig(); start(); } +function validateConfig() { + try { + fs.statSync(path.relative(cwd, configPath)); + require(configPath); + } catch (err) { + if (err.code === 'ENOENT') { + const msg = `Could not find configuration file for environment ${NODE_ENV}`; + console.log('FATAL', msg); + console.log('FATAL', 'Set NODE_ENV to production or development or add', configPath); + throw new Error(msg); + } + throw new Error(err.message); + } +} + function start() { serverPromise.then((server) => { process.once('SIGTERM', terminate); diff --git a/config/development.json b/config/development.json new file mode 100644 index 0000000..7ac8a11 --- /dev/null +++ b/config/development.json @@ -0,0 +1,6 @@ +{ + "ldap": { + "databaseUser": "OVERRIDE_IN_ENV", + "databasePassword": "OVERRIDE_IN_ENV" + } +} \ No newline at end of file diff --git a/config/production.json b/config/production.json new file mode 100644 index 0000000..1fb167a --- /dev/null +++ b/config/production.json @@ -0,0 +1,6 @@ +{ + "ldap": { + "databaseUser": "OVERRIDE_IN_ENV", + "databasePassword": "OVERRIDE_IN_ENV" + } +} \ No newline at end of file diff --git a/config/test.json b/config/test.json new file mode 100644 index 0000000..95565d2 --- /dev/null +++ b/config/test.json @@ -0,0 +1,7 @@ +{ + "ldap": { + "databaseUser": "cn=read-only-admin,dc=example,dc=com", + "databasePassword": "password", + "url": "ldap%3A%2F%2Fldap.forumsys.com" + } +} \ No newline at end of file diff --git a/nodemon.json b/nodemon.json new file mode 100644 index 0000000..f002b15 --- /dev/null +++ b/nodemon.json @@ -0,0 +1,9 @@ +{ + "ignore": ["tmp/", "node_modules/", "logs/", "test/"], + "ext": "js json env", + "watch": ["*", ".env"], + "env": { + "ENV_PREFIX": "ONIFY_", + "INTERPRET_CHAR_AS_DOT": "_" + } +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 76d3d80..887ae42 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "hub-functions", - "version": "1.4.1", + "version": "1.4.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "hub-functions", - "version": "1.4.1", + "version": "1.4.2", "license": "MIT", "dependencies": { "@hapi/glue": "^8.0.0", @@ -14,7 +14,9 @@ "@hapi/inert": "^7.0.0", "@hapi/vision": "^7.0.0", "activedirectory2": "^2.1.0", + "exp-config": "^4.2.1", "fast-xml-parser": "^4.2.4", + "handlebars": "^4.7.7", "hapi-swagger": "^15.0.0", "joi": "^17.6.3", "ldapjs": "^3.0.2", @@ -2299,6 +2301,14 @@ "node": ">=6.0.0" } }, + "node_modules/dotenv": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", + "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==", + "engines": { + "node": ">=8" + } + }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", @@ -2642,6 +2652,15 @@ "node": ">=0.8.x" } }, + "node_modules/exp-config": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/exp-config/-/exp-config-4.2.1.tgz", + "integrity": "sha512-EBH+NJdqfTb7sv4eMmJznfnxJ7FBu48ndFEpNLzj53XCK9iJqd82miHyMpfnSfk5lM2I+ueXchLOgxY4OOsjVQ==", + "dependencies": { + "dotenv": "~8.2.0", + "lodash.merge": "^4.6.2" + } + }, "node_modules/extsprintf": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz", @@ -3750,8 +3769,7 @@ "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, "node_modules/lru-cache": { "version": "7.14.0", @@ -7102,6 +7120,11 @@ "esutils": "^2.0.2" } }, + "dotenv": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", + "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" + }, "ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", @@ -7358,6 +7381,15 @@ "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" }, + "exp-config": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/exp-config/-/exp-config-4.2.1.tgz", + "integrity": "sha512-EBH+NJdqfTb7sv4eMmJznfnxJ7FBu48ndFEpNLzj53XCK9iJqd82miHyMpfnSfk5lM2I+ueXchLOgxY4OOsjVQ==", + "requires": { + "dotenv": "~8.2.0", + "lodash.merge": "^4.6.2" + } + }, "extsprintf": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz", @@ -8163,8 +8195,7 @@ "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, "lru-cache": { "version": "7.14.0", diff --git a/package.json b/package.json index 9ab40f5..47c5f26 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,9 @@ "@hapi/inert": "^7.0.0", "@hapi/vision": "^7.0.0", "activedirectory2": "^2.1.0", + "exp-config": "^4.2.1", "fast-xml-parser": "^4.2.4", + "handlebars": "^4.7.7", "hapi-swagger": "^15.0.0", "joi": "^17.6.3", "ldapjs": "^3.0.2", From f73b8d93782ff1e344475473f1c8dcafffab9c7f Mon Sep 17 00:00:00 2001 From: blaise-favor Date: Tue, 4 Jul 2023 14:53:04 +0800 Subject: [PATCH 2/7] feat: implemented support for env templating for route inputs --- functions/ldap.js | 4 ++++ lib/helpers.js | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 lib/helpers.js diff --git a/functions/ldap.js b/functions/ldap.js index 8f84755..39a72c7 100644 --- a/functions/ldap.js +++ b/functions/ldap.js @@ -5,6 +5,8 @@ const LDAP = require('ldapjs'); const Logger = require('../lib/logger.js'); const Utils = require('../lib/utils.js'); const Qs = require('qs'); +const config = require('exp-config'); +const helpers = require("../lib/helpers.js") /** * @@ -14,6 +16,8 @@ exports.plugin = { name: 'ldap', register: async function (server) { server.ext('onRequest', (request, h) => { + helpers.setQueryParameterTemplateValues(request.query, config.ldap); + let { tlsOptions, attributes } = request.query; if (tlsOptions) { diff --git a/lib/helpers.js b/lib/helpers.js new file mode 100644 index 0000000..4b85ed6 --- /dev/null +++ b/lib/helpers.js @@ -0,0 +1,14 @@ +'use strict'; + +const Handlebars = require("handlebars"); + +Handlebars.registerHelper('ENV', (value) => { + return new Handlebars.SafeString(value); +}); + +exports.setQueryParameterTemplateValues = (query, context) => { + for (const key of Object.keys(query)) { + const template = Handlebars.compile(query[key]); + query[key] = template(context); + } +} \ No newline at end of file From 095b1235dc03251c963a36c0d87e5c3e8c936778 Mon Sep 17 00:00:00 2001 From: blaise-favor Date: Tue, 4 Jul 2023 14:55:39 +0800 Subject: [PATCH 3/7] test: test script for input route inputs env template support --- test/functions/ldap.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/functions/ldap.js b/test/functions/ldap.js index dc6da1c..a92c995 100644 --- a/test/functions/ldap.js +++ b/test/functions/ldap.js @@ -128,4 +128,28 @@ describe('ldap:', () => { expect(res.statusCode).to.equal(200); expect(res.result.length === 5).to.equal(true); }); + + it(`GET ${FUNCTION_ENDPOINT}/search - search result for query with environment variable placeholder in parameters - returns 200`, async () => { + const username = '%7B%7BENV databaseUser%7D%7D'; + const password = '%7B%7BENV databasePassword%7D%7D'; + + const res = await server.inject({ + method: 'GET', + url: `${FUNCTION_ENDPOINT}/search?url=${url}&username=${username}&password=${password}&base=${base}&filter=${filter}&scope=${scope}&paged=true&pageSize=5`, + }); + + expect(res.statusCode).to.equal(200); + }); + + it(`GET ${FUNCTION_ENDPOINT}/search - search result for query without using helper function on environment variable placeholder in parameters - returns 200`, async () => { + const username = '%7B%7BdatabaseUser%7D%7D'; + const password = '%7B%7BdatabasePassword%7D%7D'; + + const res = await server.inject({ + method: 'GET', + url: `${FUNCTION_ENDPOINT}/search?url=${url}&username=${username}&password=${password}&base=${base}&filter=${filter}&scope=${scope}&paged=true&pageSize=5`, + }); + + expect(res.statusCode).to.equal(401); + }); }); From 53eafe957065b9da9fe3b26f5a94941b37b38f7b Mon Sep 17 00:00:00 2001 From: blaise-favor Date: Tue, 4 Jul 2023 15:40:05 +0800 Subject: [PATCH 4/7] fix: removed replacement of a substring with itself --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 25855a9..56ad08b 100644 --- a/app.js +++ b/app.js @@ -17,7 +17,7 @@ let configPath; if (path.isAbsolute(CONFIG_BASE_PATH)) { configPath = path.normalize(CONFIG_BASE_PATH) + path.sep + configFileName; } else { - configPath = CONFIG_BASE_PATH.replace(/\/$/, '/') + '/' + configFileName; + configPath = CONFIG_BASE_PATH + '/' + configFileName; } module.exports = serverPromise; From 0feaa8b6880a0dc1cdb527245f219cb68a3d6612 Mon Sep 17 00:00:00 2001 From: blaise-favor Date: Tue, 4 Jul 2023 16:26:44 +0800 Subject: [PATCH 5/7] test: updated description due to typo error --- test/functions/ldap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functions/ldap.js b/test/functions/ldap.js index a92c995..2d50723 100644 --- a/test/functions/ldap.js +++ b/test/functions/ldap.js @@ -141,7 +141,7 @@ describe('ldap:', () => { expect(res.statusCode).to.equal(200); }); - it(`GET ${FUNCTION_ENDPOINT}/search - search result for query without using helper function on environment variable placeholder in parameters - returns 200`, async () => { + it(`GET ${FUNCTION_ENDPOINT}/search - search result for query without using helper function on environment variable placeholder in parameters - returns 401`, async () => { const username = '%7B%7BdatabaseUser%7D%7D'; const password = '%7B%7BdatabasePassword%7D%7D'; From 296260f5c11219ec5ebb72edcd5728a9bb909081 Mon Sep 17 00:00:00 2001 From: blaise-favor Date: Tue, 4 Jul 2023 17:00:16 +0800 Subject: [PATCH 6/7] docs: updated docs --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6ba9ab9..3417322 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,10 @@ ## Changelog +### latest + +* feat: support on templating env for route inputs + ### 1.4.2 * chore: bump fast-xml-parser from 4.0.11 to 4.2.4 From 5cc29e68811223df18f94cd5615cac8ace345d1a Mon Sep 17 00:00:00 2001 From: blaise-favor Date: Wed, 5 Jul 2023 16:28:18 +0800 Subject: [PATCH 7/7] feat: removed config files and used environment vars directly --- app.js | 30 ---------------------------- config/development.json | 6 ------ config/production.json | 6 ------ config/test.json | 7 ------- functions/ldap.js | 3 +-- lib/helpers.js | 6 ++++-- nodemon.json | 9 ++++----- package-lock.json | 43 ++++++++++++++--------------------------- package.json | 2 +- 9 files changed, 25 insertions(+), 87 deletions(-) delete mode 100644 config/development.json delete mode 100644 config/production.json delete mode 100644 config/test.json diff --git a/app.js b/app.js index 56ad08b..c6a14a8 100644 --- a/app.js +++ b/app.js @@ -1,48 +1,18 @@ 'use strict'; -const fs = require('fs'); -const path = require('path'); const Logger = require('./lib/logger.js'); const SetupApp = require('./lib/setupApp'); const { version } = require('./package.json'); const serverPromise = SetupApp(); -const cwd = process.cwd(); -const NODE_ENV = process.env.NODE_ENV || 'development'; -const CONFIG_BASE_PATH = process.env.CONFIG_BASE_PATH || './config'; -const configFileName = `${NODE_ENV}.json`; - -let configPath; -if (path.isAbsolute(CONFIG_BASE_PATH)) { - configPath = path.normalize(CONFIG_BASE_PATH) + path.sep + configFileName; -} else { - configPath = CONFIG_BASE_PATH + '/' + configFileName; -} - module.exports = serverPromise; module.exports.start = start; if (require.main === module) { - validateConfig(); start(); } -function validateConfig() { - try { - fs.statSync(path.relative(cwd, configPath)); - require(configPath); - } catch (err) { - if (err.code === 'ENOENT') { - const msg = `Could not find configuration file for environment ${NODE_ENV}`; - console.log('FATAL', msg); - console.log('FATAL', 'Set NODE_ENV to production or development or add', configPath); - throw new Error(msg); - } - throw new Error(err.message); - } -} - function start() { serverPromise.then((server) => { process.once('SIGTERM', terminate); diff --git a/config/development.json b/config/development.json deleted file mode 100644 index 7ac8a11..0000000 --- a/config/development.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ldap": { - "databaseUser": "OVERRIDE_IN_ENV", - "databasePassword": "OVERRIDE_IN_ENV" - } -} \ No newline at end of file diff --git a/config/production.json b/config/production.json deleted file mode 100644 index 1fb167a..0000000 --- a/config/production.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ldap": { - "databaseUser": "OVERRIDE_IN_ENV", - "databasePassword": "OVERRIDE_IN_ENV" - } -} \ No newline at end of file diff --git a/config/test.json b/config/test.json deleted file mode 100644 index 95565d2..0000000 --- a/config/test.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "ldap": { - "databaseUser": "cn=read-only-admin,dc=example,dc=com", - "databasePassword": "password", - "url": "ldap%3A%2F%2Fldap.forumsys.com" - } -} \ No newline at end of file diff --git a/functions/ldap.js b/functions/ldap.js index 39a72c7..f050e93 100644 --- a/functions/ldap.js +++ b/functions/ldap.js @@ -5,7 +5,6 @@ const LDAP = require('ldapjs'); const Logger = require('../lib/logger.js'); const Utils = require('../lib/utils.js'); const Qs = require('qs'); -const config = require('exp-config'); const helpers = require("../lib/helpers.js") /** @@ -16,7 +15,7 @@ exports.plugin = { name: 'ldap', register: async function (server) { server.ext('onRequest', (request, h) => { - helpers.setQueryParameterTemplateValues(request.query, config.ldap); + helpers.setQueryParameterTemplateValues(request.query); let { tlsOptions, attributes } = request.query; diff --git a/lib/helpers.js b/lib/helpers.js index 4b85ed6..baaeae5 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -1,14 +1,16 @@ 'use strict'; +require("dotenv").config(); + const Handlebars = require("handlebars"); Handlebars.registerHelper('ENV', (value) => { return new Handlebars.SafeString(value); }); -exports.setQueryParameterTemplateValues = (query, context) => { +exports.setQueryParameterTemplateValues = (query) => { for (const key of Object.keys(query)) { const template = Handlebars.compile(query[key]); - query[key] = template(context); + query[key] = template(process.env); } } \ No newline at end of file diff --git a/nodemon.json b/nodemon.json index f002b15..db4ce61 100644 --- a/nodemon.json +++ b/nodemon.json @@ -1,9 +1,8 @@ { "ignore": ["tmp/", "node_modules/", "logs/", "test/"], "ext": "js json env", - "watch": ["*", ".env"], - "env": { - "ENV_PREFIX": "ONIFY_", - "INTERPRET_CHAR_AS_DOT": "_" - } + "watch": [ + "*", + ".env" + ] } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 887ae42..debbb9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@hapi/inert": "^7.0.0", "@hapi/vision": "^7.0.0", "activedirectory2": "^2.1.0", - "exp-config": "^4.2.1", + "dotenv": "^16.3.1", "fast-xml-parser": "^4.2.4", "handlebars": "^4.7.7", "hapi-swagger": "^15.0.0", @@ -2302,11 +2302,14 @@ } }, "node_modules/dotenv": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", - "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==", + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" } }, "node_modules/ecdsa-sig-formatter": { @@ -2652,15 +2655,6 @@ "node": ">=0.8.x" } }, - "node_modules/exp-config": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/exp-config/-/exp-config-4.2.1.tgz", - "integrity": "sha512-EBH+NJdqfTb7sv4eMmJznfnxJ7FBu48ndFEpNLzj53XCK9iJqd82miHyMpfnSfk5lM2I+ueXchLOgxY4OOsjVQ==", - "dependencies": { - "dotenv": "~8.2.0", - "lodash.merge": "^4.6.2" - } - }, "node_modules/extsprintf": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz", @@ -3769,7 +3763,8 @@ "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true }, "node_modules/lru-cache": { "version": "7.14.0", @@ -7121,9 +7116,9 @@ } }, "dotenv": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", - "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==" }, "ecdsa-sig-formatter": { "version": "1.0.11", @@ -7381,15 +7376,6 @@ "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" }, - "exp-config": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/exp-config/-/exp-config-4.2.1.tgz", - "integrity": "sha512-EBH+NJdqfTb7sv4eMmJznfnxJ7FBu48ndFEpNLzj53XCK9iJqd82miHyMpfnSfk5lM2I+ueXchLOgxY4OOsjVQ==", - "requires": { - "dotenv": "~8.2.0", - "lodash.merge": "^4.6.2" - } - }, "extsprintf": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz", @@ -8195,7 +8181,8 @@ "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true }, "lru-cache": { "version": "7.14.0", diff --git a/package.json b/package.json index 47c5f26..e2527a8 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@hapi/inert": "^7.0.0", "@hapi/vision": "^7.0.0", "activedirectory2": "^2.1.0", - "exp-config": "^4.2.1", + "dotenv": "^16.3.1", "fast-xml-parser": "^4.2.4", "handlebars": "^4.7.7", "hapi-swagger": "^15.0.0",