deno
044bed84 - fix(ext/node): require env permission for process.loadEnvFile (#34350)

Commit
50 days ago
fix(ext/node): require env permission for process.loadEnvFile (#34350) process.loadEnvFile() checked only read permission for the dotenv file and then wrote each parsed key into the process environment via env::set_var, making it the only env-mutation API in the runtime that didn't go through the --allow-env gate. Add a check_env_all() call upfront so the call fails before any mutation when env access is denied, keeping loadEnvFile consistent with Deno.env.set and friends. The check is all-or-nothing rather than per-key — partial-grant shapes like --allow-env=FOO no longer satisfy loadEnvFile even when FOO is the only key in the file. The simpler behavior matches how dotenv files are conventionally used (you either want the whole file applied or you don't) and avoids the partial-mutation edge case where one denied key would leave the env half-populated.
Author
Parents
Loading