fix(mcp): correct auth failure contract in _get_auth_headers#85
Closed
DavidJBianco wants to merge 1 commit into
Closed
fix(mcp): correct auth failure contract in _get_auth_headers#85DavidJBianco wants to merge 1 commit into
DavidJBianco wants to merge 1 commit into
Conversation
Collaborator
Author
|
Merged into dev via merge commit 27a476d. |
This was referenced Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the MCP auth bypass where
_get_auth_headersreturned{}on failure while_connect_http_serveronly gated onFalse— so misconfigured auth silently connected unauthenticated.Root cause fix (prefer over #71): Changes the
_get_auth_headersreturn contract so the function returnsNoneon any auth failure and{}only when no auth is configured._connect_http_servergates onNone. Updates all affected return sites and existing unit tests to match.Supersedes #74 (cherry-picked from that branch). Closes #71 as a weaker alternative (that PR only gated at the caller without fixing the lying return type).
Test plan
PYTHONPATH=. pytest -q tests/unit_tests/test_mcp_oauth_env_vars.pyin a full envactive_clients🤖 Generated with Claude Code