Ability to pass a callable to authorization middleware
Closed this issue ยท 2 comments
sled commented
The authorization middleware currently checks for a Proc
:
Wouldn't it make sense to ease this restriction and just require a callable?
Example use case:
class ComplexAuthorizer
def call
# do magic and return a token
end
end
authorizer = ComplexAuthorizer.new(....)
Faraday.new(url: ....) do |conn|
conn.request :authorization, 'Bearer', authorizer
end
iMacTia commented
That would make sense indeed, I'd happily review a PR that enhances the middleware to accept either a proc
or a callable ๐