summaryrefslogtreecommitdiff
path: root/runtime/permissions
AgeCommit message (Collapse)Author
2024-11-12chore: make fields public on `PermissionDeniedError` and ↵Richard Carson
`deno_kv::KvConfig` (#26798) A few small changes to avoid needing unsafe mem transmutes to instantiate the extensions --------- Signed-off-by: Richard Carson <Rscarson@rogers.com>
2024-11-12fix(ext/node): handle `--allow-sys=inspector` (#26836)Divy Srivastava
`op_inspector_open` checks for "inspector" as one of the allowed sys value.
2024-11-10chore: forward v2.0.6 release commit to main (#26804)denobot
This is the release commit being forwarded back to main for 2.0.6 Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-11-06chore: forward v2.0.5 release commit to main (#26755)denobot
This is the release commit being forwarded back to main for 2.0.5 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-11-04refactor(runtime/permissions): use concrete error types (#26464)Leo Kettmeir
2024-11-01chore: upgrade to rust 1.82 and LLVM 19 (#26615)Divy Srivastava
Upgrade to rust 1.82 and LLVM 19 . Removes one webusb test because `requestAdapter` not working on new ubuntu 24 runners
2024-10-31fix(node): Implement `os.userInfo` properly, add missing `toPrimitive` (#24702)Nathan Whitaker
Fixes the implementation of `os.userInfo`, and adds a missing `toPrimitive` for `tmpdir`. This allows us to enable the corresponding node_compat test.
2024-10-30chore: forward v2.0.4 release commit to main (#26636)denobot
This is the release commit being forwarded back to main for 2.0.4 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-10-25chore: forward v2.0.3 commit to main (#26535)Bartek Iwańczuk
Forwarding v2.0.3 commit to `main` Co-authored-by: denobot <33910674+denobot@users.noreply.github.com> Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-10-18chore: forward v2.0.2 release commit to main (#26376)denobot
This is the release commit being forwarded back to main for 2.0.2 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-17feat(permissions): expose PromptResponse (#26358)Lucas Nogueira
follow-up for #26327
2024-10-17feat(permissions): expose PermissionPrompter and set_prompter function (#26327)Lucas Nogueira
when defining a custom runtime, it might be useful to define a custom prompter - for instance when you are not relying on the terminal and want a GUI prompter instead
2024-10-16chore: forward v2.0.1 release commit to main (#26338)denobot
This is the release commit being forwarded back to main for 2.0.1 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-15chore: upgrade to rust 1.81.0 (#26261)林炳权
2024-10-082.0.0 (#26063)denobot
Bumped versions for 2.0.0 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-04refactor: improve node permission checks (#26028)David Sherret
Does less work when requesting permissions with `-A`
2024-10-03fix: don't prompt when using `Deno.permissions.request` with `--no-prompt` ↵Simon Lecoq
(#25811)
2024-10-02chore: release deno_* crates (#25987)denobot
Testing once again if the crates are being properly released. --------- Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-02chore: release deno_* crates (#25976)denobot
Test run before Deno 2.0 release to make sure that the publishing process passes correctly. --------- Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-09-30refactor: bury descriptor parsing in PermissionsContainer (#25936)David Sherret
Closes https://github.com/denoland/deno/issues/25634
2024-09-28refactor: use deno_path_util (#25918)David Sherret
2024-09-26feat: add `--allow-import` flag (#25469)Bartek Iwańczuk
This replaces `--allow-net` for import permissions and makes the security sandbox stricter by also checking permissions for statically analyzable imports. By default, this has a value of `--allow-import=deno.land:443,jsr.io:443,esm.sh:443,raw.githubusercontent.com:443,gist.githubusercontent.com:443`, but that can be overridden by providing a different set of hosts. Additionally, when no value is provided, import permissions are inferred from the CLI arguments so the following works because `fresh.deno.dev:443` will be added to the list of allowed imports: ```ts deno run -A -r https://fresh.deno.dev ``` --------- Co-authored-by: David Sherret <dsherret@gmail.com>
2024-09-20fix(flags): properly error out for urls (#25770)Leo Kettmeir
Closes https://github.com/denoland/deno/issues/25760
2024-09-18fix: do not panic running invalid file specifier (#25530)Yazan AbdAl-Rahman
Co-authored-by: Bedis Nbiba <bedisnbiba@gmail.com>
2024-09-16refactor(permissions): split up Descriptor into Allow, Deny, and Query (#25508)David Sherret
This makes the permission system more versatile.
2024-09-10feat(cli): use NotCapable error for permission errors (#25431)Luca Casonato
Closes #7394 --------- Co-authored-by: snek <snek@deno.com>
2024-09-06refactor(permissions): remove FromStr implementations, add ::parse methods ↵Bartek Iwańczuk
(#25473) The `.parse()` calls in permission code are only making it more confusing, verbosity is encouraged and welcome in this code even at the cost of not being concise. Left a couple TODOs to not use `AnyError`.
2024-09-04fix(regression): do not expose resolved path in Deno.Command permission ↵David Sherret
denied error (#25434) Regression from https://github.com/denoland/deno/pull/25370
2024-09-04chore: forward v1.46.3 release commit to main (#25425)denobot
This is the release commit being forwarded back to main for 1.46.3
2024-09-04fix: lock down allow-run permissions more (#25370)David Sherret
`--allow-run` even with an allow list has essentially been `--allow-all`... this locks it down more. 1. Resolves allow list for `--allow-run=` on startup to an absolute path, then uses these paths when evaluating if a command can execute. Also, adds these paths to `--deny-write` 1. Resolves the environment (cwd and env vars) before evaluating permissions and before executing a command. Then uses this environment to evaluate the permissions and then evaluate the command.
2024-09-03BREAKING(permissions): remove --allow-hrtime (#25367)Luca Casonato
Remove `--allow-hrtime` and `--deny-hrtime`. We are doing this because it is already possible to get access to high resolution timers through workers and SharedArrayBuffer. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-08-29chore: forward v1.46.2 release commit to main (#25296)denobot
This is the release commit being forwarded back to main for 1.46.2
2024-08-22chore: forward v1.46.1 release commit to main (#25155)denobot
2024-08-221.46.0 (#25139)denobot
Bumped versions for 1.46.0 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-08-20fix(cli): update permission prompt message for compiled binaries (#24081)Yazan AbdAl-Rahman
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-08-19chore: improve accessing special file test (#25099)David Sherret
2024-08-08feat(permissions): link to docs in permission prompt (#24948)Bartek Iwańczuk
This commit updates permission prompt to add a link to the documentation for particular flag. Additionally the box drawings around the prompt have been slightly altered for better visibility. <img width="737" alt="Screenshot 2024-08-08 at 12 42 32" src="https://github.com/user-attachments/assets/6ae748cd-4f29-439d-b0ee-f28f565f211a">
2024-07-31chore: forward v1.45.5 release commit to main (#24818)denobot
2024-07-26chore: forward v1.45.4 release commit to main (#24754)denobot
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-07-23chore: forward v1.45.3 release commit to main (#24681)denobot
This is the release commit being forwarded back to main for 1.45.3 --------- Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-12chore: forward v1.45.2 release commit to main (#24564)denobot
Co-authored-by: dsherret <dsherret@users.noreply.github.com>
2024-07-12chore: forward v1.45.1 release commit to main (#24540)denobot
This is the release commit being forwarded back to main for 1.45.1 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-07-111.45.0 (#24512)denobot
Bumped versions for 1.45.0 --------- Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-10fix: Add sys permission kinds for node compat (#24242)Adam Gregory
Fixes #24241 * Support "statfs", "username", "getPriority" and "setPriority" kinds for `--allow-sys`. * Check individual permissions in `node:os.userInfo()` instead of a single "userInfo" permission. * Check for "uid" permission in `node:process.geteuid()` instead of "geteuid". * Add missing "homedir" to `SysPermissionDescriptor.kind` union Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-10feat(node): Support executing npm package lifecycle scripts ↵Nathan Whitaker
(preinstall/install/postinstall) (#24487) Adds support for running npm package lifecycle scripts, opted into via a new `--allow-scripts` flag. With this PR, when running `deno cache` (or `DENO_FUTURE=1 deno install`) you can specify the `--allow-scripts=pkg1,pkg2` flag to run lifecycle scripts attached to the given packages. Note at the moment this only works when `nodeModulesDir` is true (using the local resolver). When a package with un-run lifecycle scripts is encountered, we emit a warning suggesting things may not work and to try running lifecycle scripts. Additionally, if a package script implicitly requires `node-gyp` and it's not found on the system, we emit a warning. Extra things in this PR: - Extracted out bits of `task.rs` into a separate module for reuse - Added a couple fields to `process.config` in order to support `node-gyp` (it relies on a few variables being there) - Drive by fix to downloading new npm packages to test registry --- TODO: - [x] validation for allow-scripts args (make sure it looks like an npm package) - [x] make allow-scripts matching smarter - [ ] figure out what issues this closes --- Review notes: - This adds a bunch of deps to our test registry due to using `node-gyp`, so it's pretty noisy
2024-07-05fix(permissions): handle ipv6 addresses correctly (#24397)Luca Casonato
Also don't panic on invalid domain names and addresses. Extracted with cleanups up from #24080 Co-authored-by: Yazan AbdAl-Rahman <yazan.abdalrahman@exalt.ps>
2024-07-05fix(node): Implement `fs.lchown` (and `process.getegid`) (#24418)Nathan Whitaker
Closes https://github.com/denoland/deno/issues/21260. Part of https://github.com/denoland/deno/issues/18218. Implements `node:fs.lchown`, and enables the node_compat test for it. The test uses `process.getegid`, which we didn't have implemented, so I went ahead and implemented that as well to get the test working.
2024-06-19chore: forward v1.44.4 release commit to main (#24271)denobot
This is the release commit being forwarded back to main for 1.44.4 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-06-19chore: forward v1.44.3 release commit to main (#24256)denobot
This is the release commit being forwarded back to main for 1.44.3 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-06-17fix(ext/permissions): add correct feature flags to winapi (#24218)Richard Carson