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

Refactor basic auth middleware to support multiple auth headers #2695

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aldas
Copy link
Contributor

@aldas aldas commented Oct 30, 2024

This is taken from v5 branch + improved tests

reasoning for it:
multiple auth headers is something that can happen in environments like corporate test environments that are secured by application proxy servers where front facing proxy is configured to require own basic auth value + checks it and your application also requires basic auth headers from clients. As Go standard library stores headers in map and keys are retrieved in random order the middleware may need to check multiple headers to match correct one.

Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 94.87179% with 2 lines in your changes missing coverage. Please review.

Project coverage is 93.09%. Comparing base (447c92d) to head (4ab78e4).
Report is 15 commits behind head on master.

Files with missing lines Patch % Lines
middleware/basic_auth.go 94.87% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2695      +/-   ##
==========================================
+ Coverage   93.03%   93.09%   +0.05%     
==========================================
  Files          41       40       -1     
  Lines        4707     4762      +55     
==========================================
+ Hits         4379     4433      +54     
- Misses        236      238       +2     
+ Partials       92       91       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant