oauth2
oauth2 copied to clipboard
Allow configurable HTTP Client library
Users can supply their own HTTP Client module to be used by OAuth2.Request:
config :oauth2, http_client: MyCustomClient
The default is OAuth2.HTTPClient.Hackney which conforms to the OAuth2.HTTPClient behaviour.
I am writing a Ueberauth strategy using this library, and I want to be able to mock the HTTP client for automated tests. Making it configurable allows that to be possible. There are other legitimate reasons someone might want to provide their own module.
Would be prudent to leverage https://github.com/teamon/tesla?
Would be prudent to leverage https://github.com/teamon/tesla?
I'm +1 for this, this abstracts away different http client internals so there's no need to create multiple adapters.
This is possible in the latest version using Tesla.
@alexgleason thank you so much for the work regardless.
Cool!