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

Backport authorization procs to 1.x branch #1322

Merged
merged 2 commits into from
Sep 17, 2021

Conversation

jarl-dk
Copy link

@jarl-dk jarl-dk commented Sep 9, 2021

Description

This is a backport of authorization using Procs. It is a simple cherry-pick from main branch.

(cherry picked from commit fe600c7)

Todos

List any remaining work that needs to be done, i.e:

  • Tests
  • Rubocop
  • Documentation

Additional Notes

This is a backport of authorization using Procs. It is a simple cherry-pick from main branch.
(cherry picked from commit fe600c7)

Merge Authentication middleware.
Add possibility of passing a proc.
Update documentation.

(cherry picked from commit fe600c7)
@olleolleolle
Copy link
Member

olleolleolle commented Sep 9, 2021

@jarl-dk Thanks for taking a look at this.

A blocking issue with this cherry-pick is that it takes the step of removing the feature from the 1.x release series, which we only want to fully remove in the 2.x, which is brewing.

@jarl-dk
Copy link
Author

jarl-dk commented Sep 10, 2021

@olleolleolle : Yes, I just realised this myself. Thanks. I'll see if I can make a backward compatible fixup (selective cherry-pick).

@jarl-dk
Copy link
Author

jarl-dk commented Sep 10, 2021

The PR does contains some bloat code (if just reaching for Proc support). But my aim has been minimal code diff to v1.7.1 and as close as possible to fe600c72adc79180ad7e545191edd5dd2fe61990.

@iMacTia
Copy link
Member

iMacTia commented Sep 13, 2021

Thank you @jarl-dk, indeed I can see the extra code for basic auth support in the generic Authorization middleware.
I'm happy to clean up myself after this PR if you don't have the time, but I'd really like to see the new tests ported as well and the existing ones still passing before merging this.
There also seems to be a small issue with linting that will need to be fixed before merging.

@jarl-dk
Copy link
Author

jarl-dk commented Sep 15, 2021

I'll give it a shot more...

lib/faraday/request/authorization.rb Outdated Show resolved Hide resolved
@jarl-dk
Copy link
Author

jarl-dk commented Sep 16, 2021

I have updated the PR to not remove any tests and just add the test regarding Proc.
@iMacTia : I'll leave the cleanup to you as it can be cleaned up in many different ways.

Copy link
Member

@iMacTia iMacTia 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 good enough, thanks @jarl-dk, I'll take over from here for the cleanup 👍

@iMacTia iMacTia merged commit 2a5702a into lostisland:1.x Sep 17, 2021
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.

Authorization middleware can't build a Bearer header from a lambda argument
4 participants