Conversation

aldas

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.

@codecovCodecov

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     
FilesCoverage Δ
middleware/basic_auth.go95.74% <100.00%> (+19.65%)⬆️
middleware/middleware.go94.33% <ø> (ø)

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

@aldasaldas force-pushed the basic_auht_multiple_headers branch from 5f9f144 to 6269cab Compare November 7, 2023 08:20
@aldasaldas self-assigned this Mar 12, 2024
Sign up for free to join this conversation on . Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.