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

Select the closest auth according to auth type #125

Closed
wants to merge 1 commit into from

Conversation

lykling
Copy link

@lykling lykling commented Apr 7, 2021

  • If token auth is not main_auth with customized header, then selected_auth will always be main_auth
  • If digest auth is not main_auth, it return main_auth too, because there may no Authorization header in the first request of digest auth

@codecov-io
Copy link

Codecov Report

Merging #125 (ea562ec) into master (ccf98aa) will decrease coverage by 3.33%.
The diff coverage is 70.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##            master     #125      +/-   ##
===========================================
- Coverage   100.00%   96.66%   -3.34%     
===========================================
  Files            1        1              
  Lines          254      270      +16     
  Branches        34       40       +6     
===========================================
+ Hits           254      261       +7     
- Misses           0        6       +6     
- Partials         0        3       +3     
Impacted Files Coverage Δ
flask_httpauth.py 96.66% <70.00%> (-3.34%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ccf98aa...ea562ec. Read the comment docs.

@miguelgrinberg
Copy link
Owner

While I like that you have made it possible to include auth objects that use custom headers, overall I find that this is a fairly big change and that the same could be achieved by just making a small change while keeping the current logic of the multi auth object. In particular I do not like that you have removed the concept of a main auth object and replaced it with auth[0], which is obscure.

I will take it as a feature request for the custom header support and re-implement this, if you don't mind. If there is any other aspect of this change that you think important to preserve let me know.

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

Successfully merging this pull request may close these issues.

3 participants