-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# [1.4.0](v1.3.0...v1.4.0) (2023-07-26) ### Features * **deps:** bump dotenv from 16.1.4 to 16.3.0 ([930c04e](930c04e)) * **deps:** bump dotenv from 16.3.0 to 16.3.1 ([6f6bb28](6f6bb28)) * **deps:** bump node-fetch from 3.3.1 to 3.3.2 ([40815c5](40815c5))
- Loading branch information
1 parent
40815c5
commit 9588c28
Showing
3 changed files
with
38 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1771,7 +1771,7 @@ exports.checkBypass = checkBypass; | |
/***/ 5478: | ||
/***/ ((module) => { | ||
|
||
const re = /^dotenv_config_(encoding|path|debug|override)=(.+)$/ | ||
const re = /^dotenv_config_(encoding|path|debug|override|DOTENV_KEY)=(.+)$/ | ||
|
||
module.exports = function optionMatcher (args) { | ||
return args.reduce(function (acc, cur) { | ||
|
@@ -1808,6 +1808,10 @@ if (process.env.DOTENV_CONFIG_OVERRIDE != null) { | |
options.override = process.env.DOTENV_CONFIG_OVERRIDE | ||
} | ||
|
||
if (process.env.DOTENV_CONFIG_DOTENV_KEY != null) { | ||
options.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY | ||
} | ||
|
||
module.exports = options | ||
|
||
|
||
|
@@ -1876,7 +1880,7 @@ function _parseVault (options) { | |
|
||
// handle scenario for comma separated keys - for use with key rotation | ||
// example: DOTENV_KEY="dotenv://:[email protected]/vault/.env.vault?environment=prod,dotenv://:[email protected]/vault/.env.vault?environment=prod" | ||
const keys = _dotenvKey().split(',') | ||
const keys = _dotenvKey(options).split(',') | ||
const length = keys.length | ||
|
||
let decrypted | ||
|
@@ -1917,11 +1921,18 @@ function _debug (message) { | |
console.log(`[dotenv@${version}][DEBUG] ${message}`) | ||
} | ||
|
||
function _dotenvKey () { | ||
function _dotenvKey (options) { | ||
// prioritize developer directly setting options.DOTENV_KEY | ||
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) { | ||
return options.DOTENV_KEY | ||
} | ||
|
||
// secondary infra already contains a DOTENV_KEY environment variable | ||
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) { | ||
return process.env.DOTENV_KEY | ||
} | ||
|
||
// fallback to empty string | ||
return '' | ||
} | ||
|
||
|
@@ -1980,7 +1991,12 @@ function _configVault (options) { | |
|
||
const parsed = DotenvModule._parseVault(options) | ||
|
||
DotenvModule.populate(process.env, parsed, options) | ||
let processEnv = process.env | ||
if (options && options.processEnv != null) { | ||
processEnv = options.processEnv | ||
} | ||
|
||
DotenvModule.populate(processEnv, parsed, options) | ||
|
||
return { parsed } | ||
} | ||
|
@@ -2003,7 +2019,12 @@ function configDotenv (options) { | |
// Specifying an encoding returns a string instead of a buffer | ||
const parsed = DotenvModule.parse(fs.readFileSync(dotenvPath, { encoding })) | ||
|
||
DotenvModule.populate(process.env, parsed, options) | ||
let processEnv = process.env | ||
if (options && options.processEnv != null) { | ||
processEnv = options.processEnv | ||
} | ||
|
||
DotenvModule.populate(processEnv, parsed, options) | ||
|
||
return { parsed } | ||
} catch (e) { | ||
|
@@ -2020,7 +2041,7 @@ function config (options) { | |
const vaultPath = _vaultPath(options) | ||
|
||
// fallback to original dotenv if DOTENV_KEY is not set | ||
if (_dotenvKey().length === 0) { | ||
if (_dotenvKey(options).length === 0) { | ||
return DotenvModule.configDotenv(options) | ||
} | ||
|
||
|
@@ -7938,7 +7959,7 @@ return new B(c,{type:"multipart/form-data; boundary="+b})} | |
/***/ 9968: | ||
/***/ ((module) => { | ||
|
||
module.exports = JSON.parse('{"name":"dotenv","version":"16.1.4","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","require":"./lib/main.js","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","lint-readme":"standard-markdown","pretest":"npm run lint && npm run dts-check","test":"tap tests/*.js --100 -Rspec","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"funding":"https://github.com/motdotla/dotenv?sponsor=1","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3","decache":"^4.6.1","sinon":"^14.0.1","standard":"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0","tap":"^16.3.0","tar":"^6.1.11","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}'); | ||
module.exports = JSON.parse('{"name":"dotenv","version":"16.3.1","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","require":"./lib/main.js","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","lint-readme":"standard-markdown","pretest":"npm run lint && npm run dts-check","test":"tap tests/*.js --100 -Rspec","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"funding":"https://github.com/motdotla/dotenv?sponsor=1","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3","decache":"^4.6.1","sinon":"^14.0.1","standard":"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0","tap":"^16.3.0","tar":"^6.1.11","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}'); | ||
|
||
/***/ }) | ||
|
||
|
@@ -9793,10 +9814,6 @@ const getNodeRequestOptions = request => { | |
agent = agent(parsedURL); | ||
} | ||
|
||
if (!headers.has('Connection') && !agent) { | ||
headers.set('Connection', 'close'); | ||
} | ||
|
||
// HTTP-network fetch step 4.2 | ||
// chunked encoding is handled by Node.js | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters