Skip to content

fix: reject conflicting auth sources instead of silently preferring ?token=#36

Open
xyaz1313 wants to merge 1 commit intoopenapi:mainfrom
xyaz1313:fix/conflicting-auth-sources
Open

fix: reject conflicting auth sources instead of silently preferring ?token=#36
xyaz1313 wants to merge 1 commit intoopenapi:mainfrom
xyaz1313:fix/conflicting-auth-sources

Conversation

@xyaz1313
Copy link
Copy Markdown

Fixes #27

Problem

When both header and query parameter are provided, silently replaces the header with the query token. This hides client misconfiguration and makes debugging auth problems harder.

Fix

Reject the request with when both auth sources are present, returning a clear error message. This makes the conflict visible immediately rather than silently choosing one.

Behavior:

  • alone → works as before (lifted to header)
  • header alone → works as before
  • Both present → with descriptive message

…token=

When both Authorization header and ?token= query parameter are provided,
the middleware previously stripped the header and used the query token
without any warning. This could hide client misconfiguration.

Now returns 400 with a clear error message when both are present.

Fixes openapi#27
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.

Bug: conflicting auth sources silently prefer ?token= over Authorization header

1 participant