-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat(authentication): Parse auth token on root command #782
Conversation
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
b4e6f9c
to
e55dc82
Compare
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
|
||
switch aud[0].(string) { | ||
case apiTokenAudience: | ||
return &ParsedToken{Type: "api-token"}, nil |
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.
my bad, shouldn't we add the identifier of the token? That way we can know how much for example a single token is being used in an org?
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.
and I mean the identifier of both the API_TOKEN and the RobotAccount
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.
Do you see it as the ID
on the ParsedToken
or a new field TokenID
?
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.
mm, I was thinking that maybe using the current ID in the ParsedToken? Why do you think we should do it as TokenID?
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.
No no, to have different fields to filter by on the UI but we can merge them into ID
since we have the type of token to know if it's a user.
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.
ahh, I see, no idea tbh. You probably know more.
Parse the stored authentication token to know what kind of user is using the CLI.
This is a best effort approach.
Refs: #780