-
Notifications
You must be signed in to change notification settings - Fork 7
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
Default Permissions Infra v0.1 #1038
Draft
cool-ant
wants to merge
16
commits into
main
Choose a base branch
from
mm/plugin-oauth-perms
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…llee pair to be approved by displaying permissions.html directly, i.e., without going through Permissions plugin.isPermitted().
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the first implementation of the "permissions OAuth" flow.
WASM doesn't support async calls yet, so this isn't as smooth as it eventually will be, but this gives us a version of this tech that works with some caveats and can easily be augmented when the async upgrades to WASM are completed.
Related issue (which I'm leaving open to include the eventual async work) #749.
Permissions OAuth works on a per-method-call basis. So Caller calling Callee.plugin's xxxxx method is verified as permitted by Callee via a new Permissions Plugin.
To see this in action,
open any plugin in the plugin tester, e.g., http://branding.psibase.localhost:8079/common/plugin-tester and in the upper-most left text box that says "branding", change it to "auth-sig" and click "Load".
We'll trigger an action that requests a permission check via Auth-Sig's plugin's
setkey
method.2a) Click the "Keyvault" tab, then click
generate-keypair
, then the "Execute" button. Copy the public key (everything in the Response textbox other than the enclosing double quotes).2b) Click the "Actions" tab, then click "set-key", and paste the pub key into the "publicKey" field.
2c) Due to an encoding issue in the tester, click on the "Raw" tab, delete the "public-key" line, and then remove the first backslash of the double-escaped newline characters in the pub key (so it looks like what you pasted). There are 4 double-escaped newline characters that need attention.
2d) Finally, click the "Execute" button.
if a permissions setting hasn't already been saved (which would auto-approve/transparently-approve the request, a dialog will be displayed for the user to Approve/Disapprove the call (and the original call will fail with an instructional message in the browser console),
clientdata:permissions:[callee]<-[caller]
in the Supervisor's subdomain to enable auto-approve going forward,