mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-25 22:20:43 +00:00
* fix(mcp): keep an MCP server's own Authorization key when the JWT signer is on With mcp_jwt_signer enabled, a server whose configured authentication_token is sent in Authorization (bearer_token, token, authorization, basic) had that key replaced by the signer's JWT on tools/list and tools/call, so the upstream returned 401. Both signer guards now also treat the server's own key as occupying Authorization, using the same to_server_spec mapping that sends the key upstream. Resolves LIT-10782 Fixes #47988 Co-authored-by: Arvind Kumar <arvindkumar.acad@gmail.com> * fix(mcp): keep a deferred oauth2-delegate server's own token when the JWT signer is on Servers that defer to the v1 client, such as oauth2 with delegate_auth_to_upstream, send their authentication_token in Authorization (or upstream_token_header), but the signer guard only read the v2 spec and let the gateway JWT overwrite it. The guard now falls back to v1's own header rule when to_server_spec returns None. BYOK keeps its existing behavior. * test(mcp): cover a SigV4 server's token leaving Authorization to the JWT signer * fix(mcp): only let upstream_token_header claim Authorization for auth types v1 writes a key for A SigV4 server with a stray authentication_token and upstream_token_header set to Authorization lost the signer JWT, though v1 never sends that token. The v1 rule now resolves the header v1 would write the key to, or none, before applying the override. * fix(mcp): keep the signer JWT on tools/call when the caller's auth header displaces the server key A per-request MCP auth header replaces the server's authentication_token, so the configured key is not what reaches Authorization. The tools/call guard now only consults the server's configured key when the caller sent none, matching the tools/list guard, so the upstream no longer ends up with no Authorization. --------- Co-authored-by: Arvind Kumar <arvindkumar.acad@gmail.com> |
||
|---|---|---|
| .. | ||
| auth | ||
| faults | ||
| guardrail_translation | ||
| outbound_credentials | ||
| __init__.py | ||
| conftest.py | ||
| test_byok_credential_cache.py | ||
| test_byok_oauth_endpoints.py | ||
| test_callback_oauth_error_responses.py | ||
| test_capabilities.py | ||
| test_catalog.py | ||
| test_client_allowlist.py | ||
| test_contracts.py | ||
| test_db_credentials.py | ||
| test_discoverable_endpoints.py | ||
| test_gateway_dcr_flow.py | ||
| test_id_jag_grant.py | ||
| test_idp_token_exchange.py | ||
| test_interactions.py | ||
| test_is_tool_name_prefixed.py | ||
| test_jwt_mcp_enforcement.py | ||
| test_jwt_mcp_simple.py | ||
| test_mcp_auth_header_extraction.py | ||
| test_mcp_auth_priority.py | ||
| test_mcp_block_recording.py | ||
| test_mcp_chat_completions.py | ||
| test_mcp_client_unit.py | ||
| test_mcp_cost_calculator.py | ||
| test_mcp_custom_fields.py | ||
| test_mcp_debug.py | ||
| test_mcp_discovery.py | ||
| test_mcp_elicitation_handler.py | ||
| test_mcp_env_vars.py | ||
| test_mcp_guardrail_usage_monitor.py | ||
| test_mcp_header_alias_utils.py | ||
| test_mcp_hook_extra_headers.py | ||
| test_mcp_logging.py | ||
| test_mcp_max_concurrent_requests.py | ||
| test_mcp_metadata_preservation.py | ||
| test_mcp_oauth_passthrough.py | ||
| test_mcp_oauth_passthrough_cold_start.py | ||
| test_mcp_oauth_passthrough_tools.py | ||
| test_mcp_partial_update.py | ||
| test_mcp_proxy_mode.py | ||
| test_mcp_sampling_completion_flow.py | ||
| test_mcp_sampling_model_access.py | ||
| test_mcp_sampling_model_resolution.py | ||
| test_mcp_sampling_priority_selection.py | ||
| test_mcp_sampling_request_builder.py | ||
| test_mcp_sampling_response_conversion.py | ||
| test_mcp_sampling_tool_conversion.py | ||
| test_mcp_server.py | ||
| test_mcp_server_identity_env.py | ||
| test_mcp_server_manager.py | ||
| test_mcp_server_tool_calls_and_headers.py | ||
| test_mcp_session_logging.py | ||
| test_mcp_sigv4_auth.py | ||
| test_mcp_stale_session.py | ||
| test_mcp_tool_search.py | ||
| test_mcp_toolset_scope.py | ||
| test_oauth2_flow_backfill.py | ||
| test_oauth2_mcp_config.yaml | ||
| test_oauth2_token_cache.py | ||
| test_oauth_identity_binding.py | ||
| test_oauth_issuer_stamp_backfill.py | ||
| test_openapi_spec_path_url.py | ||
| test_openapi_to_mcp_generator.py | ||
| test_openapi_tool_auth.py | ||
| test_operations.py | ||
| test_per_user_oauth_cache.py | ||
| test_proxy_api_credentials.py | ||
| test_rest_endpoints.py | ||
| test_result_conversion.py | ||
| test_semantic_tool_filter.py | ||
| test_server_resolution.py | ||
| test_short_mcp_tool_prefix.py | ||
| test_state_tokens.py | ||
| test_subscriptions.py | ||
| test_tool_registry.py | ||
| test_ui_session_utils.py | ||
| test_upstream.py | ||
| test_utils.py | ||