Refactor basic auth middleware to support multiple auth headers
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.
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 30 commits behind head on master.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| middleware/basic_auth.go | 94.87% | 1 Missing and 1 partial :warning: |
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
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.