-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
List all required permissions at once #3655
Comments
For |
@hayd can you elaborate? |
@isAdrisal, as @hayd pointed out, the I see two ways to write a program that doesn't suffer from the delayed exception:
E.g. assert.allowWrite('/tmp'); // throws just like writing
// but with no need to write a dummy file just to see if it can
test.allowWrite('/tmp'); // returns boolean It would also help in case when there is |
By the way, as for the permissions for |
👍 feel free to open issue for that, it's because of a hack I used in test runner, might be possible to remove it |
Thanks for the detailed explanations! @rsp I've had a brief play with the current
@bartlomieju This api provides fairly nice user prompts. Would it be possible to implement something similar in |
@bartlomieju I didn't know it was your hack - I thought it was quite clever when I discovered what's going on after I saw the |
I just faced the frustration of:
There was no long delay like the OP reported, but It is bordering on unusable like this. I hope a solution can be found. . Thanks. |
@David-Else actually not only a single message would be nice but also those wide privileges are most likely not needed at all. I'm sure it doesn't need --allow-write to the entire filesystem, but when we grant it that then any mistake in the script could potentially corrupt all your data. When I got a series of those "run again" messages, my first wishes were:
|
We can't know about permissions required by code that hasn't run yet. User code needs to use We should provide a convenience function to do this: assert a set of permissions and provide a complete error message specifying all that aren't met. |
If we could do something like this: await Deno.permissions.request(['one', 'two']); ... then a program could more easily request all of its permissions up front and it would be possible to display only a single prompt. |
Something like that might make sense in std asserts.ts? |
This:
Looks similar to: await navigator.permissions.requestAll(...); using the Web Permissions API. Maybe it would be a good idea to have a similar API with:
See:
|
Testing out Deno for the first time on Windows and ran into an ergonomic issue with permissions.
Running
deno test
without permissions flags takes around 30 seconds before aborting and prompting for--allow-env
.Running again with
--allow-env
takes another 30 seconds before aborting and prompting for--allow-write
.Is it possible to have all required permissions listed after the first attempt to run a particular script?
The text was updated successfully, but these errors were encountered: