-
Notifications
You must be signed in to change notification settings - Fork 21
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
added RawAttributes interface #162
Conversation
Vulnerable Libraries (2)
More info on how to fix Vulnerable Libraries in Go. 👉 Go to the dashboard for detailed results. 📥 Happy? Share your feedback with us. |
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.
looks good, just a couple of minor changes.
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.
Awesome, looks good.
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.
Just one question - not sure about the desired middleware functionality.
middleware.go
Outdated
@@ -23,7 +23,9 @@ func DeviceMetadataMiddleware(delegate http.Handler) http.Handler { | |||
metadata.SetSessionID(ksuid.New().String()) | |||
|
|||
if auth, ok := bascule.FromContext(ctx); ok { | |||
metadata.SetClaims(auth.Token.Attributes().FullView()) | |||
if tokenAttributes, ok := auth.Token.Attributes().(rawAttributes); ok { |
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.
Is this meant to be casting to the interface or the struct? Currently this is the struct, not the interface.
Also - what should happen if it isn't ok? It's fine to continue after we find a bascule token that wasn't a RawAttributes
like we expected?
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.
looks good 💯
This PR allows for talaria to get all of a JWT's claims from an Attribute.
Fixes #161