-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add permissions middleware #125
Conversation
Signed-off-by: Mike Mason <[email protected]>
dcfa6e1
to
6b495bc
Compare
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 the one change - otherwise looks good!
pkg/permissions/permissions.go
Outdated
func New(config Config, options ...Option) (*Permissions, error) { | ||
p := &Permissions{ | ||
enabled: config.URL != "", | ||
client: http.DefaultClient, |
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.
let's use a sane client with a really short timeout instead of the default client
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.
(unless you think its better for implementers to pass a client - but that feels like a 🦶 🔫 )
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.
yeah fair point
6b495bc
to
817fcc7
Compare
Produces an echo middleware which adds a checker function into the request context that is later used to check if the current actor has access to the requesting resource and action. Signed-off-by: Mike Mason <[email protected]>
817fcc7
to
73c6bf6
Compare
Produces an echo middleware which adds a checker function into the
request context that is later used to check if the current actor has
access to the requesting resource and action.