dotenv-webpack icon indicating copy to clipboard operation
dotenv-webpack copied to clipboard

Systemvars array

Open tysonmatanich opened this issue 3 years ago • 2 comments

Adding support for systemvars to also be an array of whitelisted variables. The allows using specific system variables without worrying about accidentally leaking others for better security.

new Dotenv({
  path: '.env',
  systemvars: ['VAR1', 'VAR2', 'VAR3'],
}),

tysonmatanich avatar Oct 22 '20 02:10 tysonmatanich

Codecov Report

Merging #256 into master will increase coverage by 0.09%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #256      +/-   ##
==========================================
+ Coverage   98.69%   98.78%   +0.09%     
==========================================
  Files           2        2              
  Lines         153      165      +12     
  Branches       38       40       +2     
==========================================
+ Hits          151      163      +12     
  Misses          2        2              
Impacted Files Coverage Δ
src/index.js 98.50% <100.00%> (+0.14%) :arrow_up:
index.js 98.97% <0.00%> (+0.06%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c2c3b15...90b6464. Read the comment docs.

codecov[bot] avatar Oct 23 '20 19:10 codecov[bot]

Thanks @tysonmatanich for the PR, but I also imagine this is an issue of trust with the plugin.

If you look at the source that gets generated by this plugin, you shouldn't see any variables exposed that you didn't explicitly request. Unless there is something else I am missing, you shouldn't need to worry about exposing variables unless your users have a way to inject code, in which I think you could have a bigger problem on your hands.

If you could please help me out with a use-case so I can better understand this particular issue.

mrsteele avatar Mar 05 '21 23:03 mrsteele

Closing due to the new environment variable experience on Netlify and lack of interest by others.

tysonmatanich avatar Feb 19 '23 23:02 tysonmatanich