Skip to content
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: permission stack traces in ops #26938

Merged
merged 8 commits into from
Nov 20, 2024
Merged

Conversation

crowlKats
Copy link
Member

@crowlKats crowlKats commented Nov 19, 2024

This commit improves permission prompts by adding an option
to print a full trace of where the permissions is being requested.

Due to big performance hint of stack trace collection, this is only
enabled when DENO_TRACE_PERMISSIONS env var is present.

Closes #20756

@@ -3316,6 +3317,8 @@ fn permission_args(app: Command, requires: Option<&'static str>) -> Command {
<p(245)>--deny-run | --deny-run="whoami,ps"</>
<g>--deny-ffi[=<<PATH>...]</> (Unstable) Deny loading dynamic libraries. Optionally specify denied directories or files.
<p(245)>--deny-ffi | --deny-ffi="./libfoo.so"</>
<g>DENO_TRACE_PERMISSIONS</> Environmental variable to enable stack traces in permission prompts.
<p(245)>DENO_TRACE_PERMISSIONS=1 deno run main.ts</>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added twice, once to the env docs and once to the perm docs for visibility

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

runtime/permissions/prompter.rs Show resolved Hide resolved
runtime/permissions/prompter.rs Outdated Show resolved Hide resolved
cli/args/flags.rs Outdated Show resolved Hide resolved
cli/worker.rs Outdated Show resolved Hide resolved
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM too

@bartlomieju bartlomieju enabled auto-merge (squash) November 20, 2024 19:52
@bartlomieju bartlomieju merged commit cf49599 into denoland:main Nov 20, 2024
17 checks passed
bartlomieju added a commit to bartlomieju/deno that referenced this pull request Nov 20, 2024
This commit improves permission prompts by adding an option
to print a full trace of where the permissions is being requested.

Due to big performance hint of stack trace collection, this is only
enabled when `DENO_TRACE_PERMISSIONS` env var is present.

Closes denoland#20756

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
@crowlKats crowlKats deleted the perm-traces branch November 21, 2024 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to print stack trace of where permission is being requested
3 participants