[1.x] Deprecate Authorization helpers in Faraday::Connection#1306
[1.x] Deprecate Authorization helpers in Faraday::Connection#1306
Conversation
olleolleolle
left a comment
There was a problem hiding this comment.
Super deprecated!
Nice with the docs changes. Idea: promote the Authorization to first place, the others being not as recommended.
I like this suggestion, and also the introduction could use some rewording, it's much better now! |
olleolleolle
left a comment
There was a problem hiding this comment.
This is ready to go, I think! 🥳
|
Hi, how about marking the deprecated methods by the YARD |
|
Oh, sorry. I see the methods were deleted via #1308. 😅 |
|
We'll keep the YARD tag in mind for the next time we make a release with a deprecation! Thanks! |
|
I'm getting |
|
@theLucid it most definitely is, it appears something is calling the now deprecated If you point me to the right place in the code where this happen, I might be able to provide further help |
Faraday [updated their authentication/authorization middleware in version 2](lostisland/faraday#1306), which was a breaking change for the Twitter auth health check. The relevant test was manually mocking and stubbing the individual Faraday objects, so the relevant code path wasn't exercised by our tests. This commit: - Updates the test to use `stub_request` instead. (This correctly catches the deprecated method error.) - Updates the health check to use the new middleware.
Description
After reviewing the authorisation part of middleware, I realised we currently expose helpers in
Faraday::Connectionto setup theAuthorizationheader. The implementation is quite old (I couldn't find any reference to theTokentype, it seems it has been replaced byBearer), with intra-dependencies that make the code hard to read and maintain.I believe in v2.0 we should remove the helpers and rework the middleware, but in the meantime this PR will add a deprecation warning to the
1.xbranch: