Skip to content

Comments

Support validation for all http schemes#244

Open
x-delfino wants to merge 1 commit intopb33f:mainfrom
x-delfino:http_validate_all_schemes
Open

Support validation for all http schemes#244
x-delfino wants to merge 1 commit intopb33f:mainfrom
x-delfino:http_validate_all_schemes

Conversation

@x-delfino
Copy link

addresses #242

previously the validated http security schemes were limited to basic, bearer, or digest and the validation just checked that there was an Authorization header that wasn't empty

case "basic", "bearer", "digest":
if request.Header.Get("Authorization") == "" {

This updates the validation check to support all http auth schemes that follow the spec by validating that the Authorization header value starts with the scheme name (case insensitive)

This introduces a new validation error when the authorization header is present, but the value does not match the expected scheme

I've updated test cases to reflect this change

@codecov
Copy link

codecov bot commented Feb 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.63%. Comparing base (26d43b7) to head (dac23cf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #244   +/-   ##
=======================================
  Coverage   97.63%   97.63%           
=======================================
  Files          56       56           
  Lines        5323     5334   +11     
=======================================
+ Hits         5197     5208   +11     
  Misses        126      126           
Flag Coverage Δ
unittests 97.63% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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
Member

@daveshanley daveshanley left a comment

Choose a reason for hiding this comment

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

Nice upgrade! Thank you.

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