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

guide reproducing JWT scope with attenuation #60

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

guide reproducing JWT scope with attenuation #60

wants to merge 1 commit into from

Conversation

Geal
Copy link
Contributor

@Geal Geal commented Feb 21, 2023

this will have to wait until the website is updated with the new biscuit version supporting check all

@divarvel
Copy link
Collaborator

divarvel commented May 2, 2023

Even with check all, I think there is an issue: the example provided requires reading facts from attenuation blocks, something which is not possible (by design) in the authorizer.

Another solution would be to use the regular attenuation mechanism: a check if in the block. The required modification would be on the authorizer side: it would need to provide a request_scope fact describing the scope required by the request.

// authority
scope(["read:article", "write:article", "read:comment", "write:comment"]);

// block 1
check if request_scope($scope), ["read:comment", "write:comment"].contains($scope);

// authorizer
request_scope("read:comment");
allow if request_scope($scope), scope($scopes), $scopes.contain($scope);

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.

2 participants