Replies: 2 comments
-
|
this looks like expected behavior tbh.
the blog post is a different story — it clearly shows toObject() working with --allow-env=SOME_SECRET and returning a filtered object. So either that was the actual behavior back in 2.6 and something changed, or the blog post is just wrong. Might be worth opening a separate docs issue for that |
Beta Was this translation helpful? Give feedback.
-
|
Building on @felipeinf's answer about the blog post being off: I'm fairly sure the apparent filtering in the 2.6 post is a side effect of how the example is launched, not a real permission narrowing. That example invokes the script with a shell prefix like So the permission model is consistent: For one-off access: const pwd = Deno.env.get("PWD"); // works with --allow-env=PWDWorth opening a docs issue on the 2.6 post so the example is clearer about what the shell prefix is doing vs what the permission is doing. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Version
Deno 2.7.12
Repro Code
index.ts:Run with:
Or replace
PWDwith other valid env var.Actual Result
Permission system requests wide environment variable access.
Expected Result
Deno just reads the allowed environment variables, permission system does not request for more.
Notes
The official Deno blog post for Deno 2.6 shows a similar example:
Did I misunderstood or missed something? Is that an expected behavior?
Beta Was this translation helpful? Give feedback.
All reactions