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

Add option to print stack trace of where permission is being requested #20756

Open
leighmcculloch opened this issue Oct 2, 2023 · 3 comments
Labels
feat new feature (which has been agreed to/accepted) permissions related to --allow-* flags
Milestone

Comments

@leighmcculloch
Copy link
Contributor

It would be helpful if the deno CLI provided the option to display where a permission request is coming from. In situations where a permission request is unexpected it'd help the developer understand whether the permission request is legit or not. Or in the case that a developer needs to debug where the permission request is coming from, it would assist with that.

Today when a permission request is encountered the following is output:

┌ ⚠️  Deno requests env access.
├ Run again with --allow-env to bypass this prompt.
└ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all env permissions) > 

This prompt could be modified to include an option to output the current stack trace:

┌ ⚠️  Deno requests env access.
├ Run again with --allow-env to bypass this prompt.
└ Allow? [y/n/t/A] (y = yes, allow; n = no, deny; t = trace, A = allow all env permissions) > 

Choosing t would output a stack trace of where the permission is being requested, including the filename, line numbers, etc. After outputting the trace, the same prompt would display so the developer could then choose one of the other option.

@KaKi87
Copy link

KaKi87 commented Sep 5, 2024

@bartlomieju Could we please have some feedback on this request ? 🙏

@crummy
Copy link

crummy commented Oct 16, 2024

Looks like this was initially planned in #1008 but didn't make it in.

I think this would be very useful. (One of my dependencies is trying to fetch from github?? Which one???)

@bartlomieju
Copy link
Member

This is being worked on in #25502 and we want to land it in Deno v2.1 next month.

@bartlomieju bartlomieju added feat new feature (which has been agreed to/accepted) permissions related to --allow-* flags labels Oct 16, 2024
@bartlomieju bartlomieju added this to the 2.1.0 milestone Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat new feature (which has been agreed to/accepted) permissions related to --allow-* flags
Projects
None yet
Development

No branches or pull requests

4 participants