-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
Enable fosite composing with custom hashers. #170
Enable fosite composing with custom hashers. #170
Conversation
compose/compose.go
Outdated
@@ -30,14 +30,17 @@ type Factory func(config *Config, storage interface{}, strategy interface{}) int | |||
// ) | |||
// | |||
// Compose makes use of interface{} types in order to be able to handle a all types of stores, strategies and handlers. | |||
func Compose(config *Config, storage interface{}, strategy interface{}, factories ...Factory) fosite.OAuth2Provider { | |||
func Compose(config *Config, storage interface{}, strategy interface{}, hasher interface{}, factories ...Factory) fosite.OAuth2Provider { |
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.
Why is hasher an interface here? It's not being used apart from type asserting hasher.(fosite.Hasher)
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.
Good question! I was blindly copying the storage implementation. Fixed with latest commit.
1 similar comment
Signed-off-by: Matthew Hartstonge <matt@mykro.co.nz>
f479865
to
eccc205
Compare
note to self: add this to breaking changes in history.md |
Signed-off-by: Matthew Hartstonge <matt@mykro.co.nz>
Makes it a little easier for composing, plus follows the same conventions as storage. Seeks to keep compatibility by setting BCrypt as the default hasher if one isn't set.
Signed-off-by: Matthew Hartstonge matt@mykro.co.nz