Skip to content
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

[1.x] Deprecate Authorization helpers in Faraday::Connection #1306

Merged
merged 6 commits into from
Aug 14, 2021

Conversation

iMacTia
Copy link
Member

@iMacTia iMacTia commented Aug 14, 2021

Description

After reviewing the authorisation part of middleware, I realised we currently expose helpers in Faraday::Connection to setup the Authorization header. The implementation is quite old (I couldn't find any reference to the Token type, it seems it has been replaced by Bearer), 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.x branch:

  • Deprecate auth helpers in Faraday::Connection
  • Update docs to show correct usage of the authorization middleware

@iMacTia iMacTia self-assigned this Aug 14, 2021
Copy link
Member

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super deprecated!

Nice with the docs changes. Idea: promote the Authorization to first place, the others being not as recommended.

Copy link
Member

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!

@iMacTia
Copy link
Member Author

iMacTia commented Aug 14, 2021

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!

Copy link
Member

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ready to go, I think! 🥳

@olleolleolle olleolleolle changed the title Deprecate Authorization helpers in Faraday::Connection [1.x] Deprecate Authorization helpers in Faraday::Connection Aug 14, 2021
@iMacTia iMacTia merged commit fa612a0 into 1.x Aug 14, 2021
@iMacTia iMacTia deleted the deprecate-auth-headers branch August 14, 2021 12:30
@ybiquitous
Copy link

Hi, how about marking the deprecated methods by the YARD @deprecated tag?

@ybiquitous
Copy link

Oh, sorry. I see the methods were deleted via #1308. 😅

@olleolleolle
Copy link
Member

olleolleolle commented Aug 31, 2021

We'll keep the YARD tag in mind for the next time we make a release with a deprecation! Thanks!

@ghost
Copy link

ghost commented Sep 11, 2021

I'm getting WARNING: Faraday::Connection#authorization is deprecated; it will be removed in version 2.0. everywhere when using Ruby. Octokit. Is this the reason, and what would need to be done to fix it?

@iMacTia
Copy link
Member Author

iMacTia commented Sep 13, 2021

@thelucid it most definitely is, it appears something is calling the now deprecated authotization method on the connection. It's really easy to fix it, you just need to follow the updated doc page.

If you point me to the right place in the code where this happen, I might be able to provide further help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants