-
Notifications
You must be signed in to change notification settings - Fork 1
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
Proof of Concept: Macaroons #2
Conversation
if dm is None: | ||
raise InvalidMacaroon | ||
|
||
verifier = pymacaroons.Verifier() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would need to implement our verifiers here. We can add arguments to this function like the resource we're operating on or what permission this request is trying to use to pass in values from the outside world, in order to implement something that depends on the current request.
Here's a dump of my
|
except ValueError: | ||
return None | ||
|
||
if auth_method.lower() != "macaroon": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expect to see Authorization: Bearer ABCD
and another layer dispatch on the format of the token.
Is there a spec for new credential type?
), | ||
sa.Column("last_used", sa.DateTime(), nullable=True), | ||
sa.Column( | ||
"caveats", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the rationale of storing root caveats explicitly?
IIRC:
- root macaroon == f(key, caveats)
- key must be stored (somewhere) to allow validation
- id is needed to find the key and to invalidate macaroon tree
Thus, (id, key, root macaroon (bytes) ) is all the information needed, right?
Is the idea to recompute root macaroon on demand?
Can root caveats be edited?
What's validates, caveats in request macaroon or in this table?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only reason to store the caveats in the database is to make it possible for the UI to show what the maximum scope of this token is. Of course given the way macaroons function we can't tell them what derived macaroons they've made from that initial token and what those are scoped to, but we can tell them what the max scope their token is good for.
We would never use what's in the database here for the validation, it'd just be there for informational purposes.
No description provided.