Skip to content

WIP Update Permissions API #3141

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

Closed
wants to merge 3 commits into from
Closed

WIP Update Permissions API #3141

wants to merge 3 commits into from

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Oct 18, 2019

This PR tries to update the permissions API, following the direction suggested in #2767.

Now Deno.permissions has 3 methods query, request, and revoke:

For example, query works like the below:

// test.js
(async () => {
  console.log(await Deno.permissions.query({ name: "net" }));
})();
$ ./target/debug/deno test.js
PermissionStatus { _desc: { name: "net" }, state: "prompt" }

Done:

  • Removed allow once deny once options in prompt because they don't make sense with the new API.

There are several remaining works:

  • correct whitelist handling for read, write, and net
  • update the usages of permissions module in rust.
  • update lib.deno_runtime.d.ts
  • update documents

closes #2767

@kt3k kt3k force-pushed the feature/perm2 branch 6 times, most recently from 5c2a641 to 4d5c321 Compare October 20, 2019 07:53
@ry
Copy link
Member

ry commented Oct 21, 2019

@kt3k Thanks for looking into this. I think it's very important to adjust our permissions API before 1.0.

Maybe we should start with a smaller change, which is to remove the prompt completely and simply fail when permissions are not available. (Maybe with something like "run again with the --allow-net flag")

@kt3k kt3k force-pushed the feature/perm2 branch 5 times, most recently from f496658 to 0508011 Compare October 22, 2019 05:03
@kt3k
Copy link
Member Author

kt3k commented Oct 22, 2019

@ry The change required was bigger than I expected. OK. I'll try that part first 👍

@kt3k kt3k closed this Oct 22, 2019
@kt3k kt3k deleted the feature/perm2 branch January 21, 2020 17:17
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.

Remove --no-prompt ... require users to explicitly prompt for permission
2 participants