1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00
denoland-deno/cli/args
Asher Gomez 6fb7e8d93b
feat(permissions): add "--deny-*" flags (#19070)
This commit adds new "--deny-*" permission flags. These are complimentary to
"--allow-*" flags.

These flags can be used to restrict access to certain resources, even if they
were granted using "--allow-*" flags or the "--allow-all" ("-A") flag.

Eg. specifying "--allow-read --deny-read" will result in a permission error,
while "--allow-read --deny-read=/etc" will allow read access to all FS but the
"/etc" directory.

Runtime permissions APIs ("Deno.permissions") were adjusted as well, mainly
by adding, a new "PermissionStatus.partial" field. This field denotes that
while permission might be granted to requested resource, it's only partial (ie.
a "--deny-*" flag was specified that excludes some of the requested resources).
Eg. specifying "--allow-read=foo/ --deny-read=foo/bar" and then querying for
permissions like "Deno.permissions.query({ name: "read", path: "foo/" })"
will return "PermissionStatus { state: "granted", onchange: null, partial: true }",
denoting that some of the subpaths don't have read access.

Closes #18804.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2023-08-03 13:19:19 +02:00
..
config_file.rs feat(unstable): optional deno_modules directory (#19977) 2023-08-02 00:49:09 +00:00
flags.rs feat(permissions): add "--deny-*" flags (#19070) 2023-08-03 13:19:19 +02:00
flags_net.rs feat(permissions): add "--deny-*" flags (#19070) 2023-08-03 13:19:19 +02:00
import_map.rs chore: upgrade to Rust 1.67 (#17548) 2023-01-27 10:43:16 -05:00
lockfile.rs chore: update to Rust 1.71 (#19822) 2023-07-13 15:16:24 -06:00
mod.rs feat(permissions): add "--deny-*" flags (#19070) 2023-08-03 13:19:19 +02:00
package_json.rs fix(check): should bust check cache when json module or npm resolution changes (#19941) 2023-07-26 17:23:07 -04:00