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

middleware: basic auth middleware can extract and check multiple auth… #2539

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aldas
Copy link
Contributor

@aldas aldas commented Nov 7, 2023

basic auth middleware can extract and check multiple auth headers.

This is taken from v5. Because of #2461 to get better tests in v4 for that middleware. Multiple auth headers is rare case. You probably can see this in test environments where application uses JWT token (which is also auth header) but for TEST env Nginx/Apache2 etc is configured to have basic auth for all requests. In that case your web-browser actually will send 2 auth header and it is 50/50 change that your request will pass as when previous version gets the header from Headers map you have 50/50 chance not to get JWT header.

Copy link

codecov bot commented Nov 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c7d6d43) 92.89% compared to head (6269cab) 93.08%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2539      +/-   ##
==========================================
+ Coverage   92.89%   93.08%   +0.19%     
==========================================
  Files          39       39              
  Lines        4658     4659       +1     
==========================================
+ Hits         4327     4337      +10     
+ Misses        240      235       -5     
+ Partials       91       87       -4     
Files Coverage Δ
middleware/basic_auth.go 95.74% <100.00%> (+19.65%) ⬆️
middleware/middleware.go 94.33% <ø> (ø)

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

@aldas aldas force-pushed the basic_auht_multiple_headers branch from 5f9f144 to 6269cab Compare November 7, 2023 08:20
@aldas aldas self-assigned this Mar 12, 2024
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.

2 participants