Skip to content

fix(middleware): correct documented KeyAuth KeyLookup default#2992

Merged
aldas merged 1 commit into
labstack:masterfrom
leestana01:fix-keyauth-keylookup-default
Jun 5, 2026
Merged

fix(middleware): correct documented KeyAuth KeyLookup default#2992
aldas merged 1 commit into
labstack:masterfrom
leestana01:fix-keyauth-keylookup-default

Conversation

@leestana01
Copy link
Copy Markdown
Contributor

The KeyLookup field comment in KeyAuthConfig documents the default as "header:Authorization", but the default applied by DefaultKeyAuthConfig is:

KeyLookup: "header:" + echo.HeaderAuthorization + ":Bearer ",

which evaluates to "header:Authorization:Bearer " (also the value ToMiddleware falls back to when KeyLookup is empty). The :Bearer cut-prefix trims the scheme from the header value, exactly as the same comment block describes.

The comment was correct in v4, where AuthScheme: "Bearer" was a separate field. In v5 AuthScheme was folded into KeyLookup, but this comment was left showing the old default.

Doc comment only — no behavior change.

DefaultKeyAuthConfig sets KeyLookup to "header:Authorization:Bearer "
in v5, but the KeyAuthConfig.KeyLookup comment still shows the v4
default of "header:Authorization". Update the comment to match.

Signed-off-by: leestana01 <leestana01@naver.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.17%. Comparing base (01b45be) to head (1cdb55b).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2992      +/-   ##
==========================================
- Coverage   93.17%   93.17%   -0.01%     
==========================================
  Files          43       43              
  Lines        4501     4499       -2     
==========================================
- Hits         4194     4192       -2     
  Misses        189      189              
  Partials      118      118              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@aldas aldas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aldas aldas merged commit 29727ff into labstack:master Jun 5, 2026
10 checks passed
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