-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(permissions): allow env permission to take values #9825
Conversation
# Conflicts: # runtime/ops/os.rs
# Conflicts: # runtime/ops/worker_host.rs
I tried simple script like the below on my end with and without combinations of perm flags. await Deno.permissions.request({ name: 'env', variable: 'FOO' })
console.log(Deno.env.get('FOO')); The basic feature seems working to me. Good feature to have! 👍 |
# Conflicts: # runtime/ops/worker_host.rs # runtime/permissions.rs
In general this PR looks good to me, but I have one comment that makes me wanna skip it for 1.9: with this change Before making decision I will wait for other contributors opinions. |
I don't think this is needed as setting env vars only has an effect on you, and your processes children, but not siblings or parent processes. |
Hmm, doesn't that also mean that variables should be settable without permission and allowlisted thereafter? |
@nayeemrmn I don't understand the question, could you provide an example? |
I realised since setting env variables within the process doesn't affect the outside, there's no reason for it to require permission. Deno.env.get("foo"); // Requires `--allow-env=foo`. Deno.env.set("foo", "bar"); // Shouldn't require permission.
Deno.env.get("foo"); // Shouldn't require permission. |
@nayeemrmn so this suggestion alters current behavior, which would be a breaking change. I'm also not sure how would it be implemented, but I'm more than happy to discuss it for 2.0. |
If you take away a permission gate because it's not actually a security issue, I'm not sure it's a breaking change. But either way it certainly doesn't need to be part of this PR 👍 (EDIT: I suppose it would be breaking for workers? ¯_(ツ)_/¯) |
# Conflicts: # cli/flags.rs # runtime/ops/os.rs # runtime/ops/permissions.rs # runtime/ops/worker_host.rs # runtime/permissions.rs
# Conflicts: # runtime/ops/os.rs # runtime/permissions.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - nice work @crowlKats !
I think sufficient effort was put into this PR to address Windows quirks. Of course, it is not a given that windows uses case folding that is 100% compatible with |
closes #3137