Repository navigation
Use context for auth access controllers - #140
Conversation
3bf5063 to
56ae466
Compare
There was a problem hiding this comment.
An AccessController no longer authorizes a request; it produces an authorized context.
Should read as follows:
// Authorized returns a non-nil error if the context is granted access and
// ...
|
LGTM! We may want to place the token into the context, along with the access that is available but this is fine for now. |
56ae466 to
f681395
Compare
|
It's failing to find the package. |
|
@jlhawn After thinking about it, there is no reason to hold up the merge of this PR waiting on #86. Go ahead and add golang.org/x/net/context to godep. Add a Update app.go to push the request into the context before calling authorized (no reason to propagate context all throughout application and request context, yet): This will be compatible with what I'm doing now and should be equivalent to the current behavior. |
The auth package has been updated to use "golang.org/x/net/context" for passing information between the application and the auth backend. AccessControllers should now set a "auth.user" context value to a AuthUser struct containing a single "Name" field for now with possible, optional, values in the future. The "silly" auth backend always sets the name to "silly", while the "token" auth backend will set the name to match the "subject" claim of the JWT. Docker-DCO-1.1-Signed-off-by: Josh Hawn <[email protected]> (github: jlhawn)
f681395 to
2c3d738
Compare
|
LGTM! |
Use context for auth access controllers
Use context for auth access controllers
Use context for auth access controllers
The auth package has been updated to use "golang.org/x/net/context" for
passing information between the application and the auth backend.
AccessControllers should now set a "auth.user" context value to a AuthUser
struct containing a single "Name" field for now with possible, optional, values
in the future.
The "silly" auth backend always sets the name to "silly", while the "token" auth
backend will set the name to match the "subject" claim of the JWT.
closes #137