summaryrefslogtreecommitdiff
path: root/runtime/permissions/prompter.rs
AgeCommit message (Collapse)Author
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-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-15chore: upgrade to rust 1.81.0 (#26261)林炳权
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-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-05-08chore: enable clippy::print_stdout and clippy::print_stderr (#23732)David Sherret
1. Generally we should prefer to use the `log` crate. 2. I very often accidentally commit `eprintln`s. When we should use `println` or `eprintln`, it's not too bad to be a bit more verbose and ignore the lint rule.
2024-04-04fix(runtime): fix Windows permission prompt (#23212)Matt Mastracci
Followup to https://github.com/denoland/deno/pull/23184
2024-04-02fix(cli): Enforce a human delay in prompt to fix paste problem (#23184)Matt Mastracci
The permission prompt doesn't wait for quiescent input, so someone pasting a large text file into the console may end up losing the prompt. We enforce a minimum human delay and wait for a 100ms quiescent period before we write and accept prompt input to avoid this problem. This does require adding a human delay in all prompt tests, but that's pretty straightforward. I rewrote the locked stdout/stderr test while I was in here.
2024-02-19feat(core): highlight unprintable chars in permission prompts (#22468)Matt Mastracci
If we strip out unprintable chars, we don't see the full filename being requested by permission prompts. Instead, we highlight and escape them to make them visible.
2024-02-07refactor: extract out `runtime::colors` to `deno_terminal::colors` (#22324)David Sherret
2024-01-04fix(cli): harden permission stdio check (#21778)Matt Mastracci
Harden the code that does permission checks to protect against re-opening of stdin. Code that runs FFI is vulnerable to an attack where fd 0 is closed during a permission check and re-opened with a file that contains a positive response (ie: `y` or `A`). While FFI code is dangerous in general, we can make it more difficult for FFI-enabled code to bypass additional permission checks. - Checks to see if the underlying file for stdin has changed from the start to the end of the permission check (detects races) - Checks to see if the message is excessively long (lowering the window for races) - Checks to see if stdin and stderr are still terminals at the end of the function (making races more difficult)
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-08-25chore(cli): remove atty crate (#20275)Matt Mastracci
Removes a crate with an outstanding vulnerability.
2023-06-09chore: fix flaky stdio_streams_are_locked_in_permission_prompt (#19443)David Sherret
2023-03-28chore: restore pty tests and make them run on the Linux CI (#18424)David Sherret
1. Rewrites the tests to be more back and forth rather than getting the output all at once (which I believe was causing the hangs on linux and maybe mac) 2. Runs the pty tests on the linux ci. 3. Fixes a bunch of tests that were just wrong. 4. Adds timeouts on the pty tests.
2023-03-10fix(prompt): better output with control chars (#18108)Bartek Iwańczuk
2023-02-22feat(permissions): grant all permission for a group in permission prompt ↵Asher Gomez
(#17140) This commit adds new "A" option to the interactive permission prompt, that will allow all subsequent permissions for given group (domain). Ie. when querying for permissions to access eg. env variables responding with "A" will allow access to all environmental variables. This works for all permission domains and should make permission prompts more ergonomic for users.
2023-02-10refactor(permissions): use less space for permissions prompt (#17708)Bartek Iwańczuk
2023-01-27chore: upgrade to Rust 1.67 (#17548)David Sherret
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-13fix(permissions): lock stdio streams when prompt is shown (#17392)Bartek Iwańczuk
This commit changes permission prompt to lock stdio streams when prompt is shown.
2023-01-03fix(permissions): fix italic font in permission prompt (#17249)Bartek Iwańczuk
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-12-19fix: hide progress bars when showing permission prompt (#17130)David Sherret
Also adds download bytes progress when downloading remote specifiers. Closes #16860
2022-12-18refactor(permissions): factor out PermissionPrompter trait, add callbacks ↵Bartek Iwańczuk
(#16975) This commit refactors several things in "runtime/permissions" module: - splits it into "mod.rs" and "prompter.rs" - adds "PermissionPrompter" trait with two implementations: * "TtyPrompter" * "TestPrompter" - adds "before" and "after" prompt callback which can be used to hide progress bar in the CLI (to be done in a follow up) - "permissions_prompt" API returns "PromptResponse" enum, instead of a boolean; this allows to add "allow all"/"deny all" functionality for the prompt