mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-24 00:52:24 +00:00
Previously _get_allowed_mcp_servers fell back to INTERNAL_REQUEST when both the explicit client_ip and the auth-context IP were missing, defeating the new fail-closed gate at the wrapper layer. An external request with no attributable client IP could reach internal-only MCP servers via tool/list/resource calls. Drop the auto-promote: pass None through, which now fails closed in filter_server_ids_by_ip_with_info. Internal callers must opt in to INTERNAL_REQUEST explicitly. Update test_mcp_routing_with_conflicting_alias_and_group_name to mock _get_client_ip_from_context with a real internal IP — the unit test has no HTTP request context so it would otherwise be filtered out by the fail-closed gate. Update test_mcp_ip_filtering tests to assert the new fail-closed behavior on missing IP and the INTERNAL_REQUEST escape hatch. |
||
|---|---|---|
| .. | ||
| auth | ||
| guardrail_translation | ||
| test_byok_oauth_endpoints.py | ||
| test_db_credentials.py | ||
| test_discoverable_endpoints.py | ||
| test_is_tool_name_prefixed.py | ||
| test_jwt_mcp_enforcement.py | ||
| test_jwt_mcp_simple.py | ||
| test_mcp_cost_calculator.py | ||
| test_mcp_custom_fields.py | ||
| test_mcp_debug.py | ||
| test_mcp_discovery.py | ||
| test_mcp_hook_extra_headers.py | ||
| test_mcp_metadata_preservation.py | ||
| test_mcp_server.py | ||
| test_mcp_server_manager.py | ||
| test_mcp_sigv4_auth.py | ||
| test_mcp_stale_session.py | ||
| test_mcp_toolset_scope.py | ||
| test_oauth2_token_cache.py | ||
| test_openapi_to_mcp_generator.py | ||
| test_openapi_tool_auth.py | ||
| test_rest_endpoints.py | ||
| test_semantic_tool_filter.py | ||
| test_short_mcp_tool_prefix.py | ||
| test_ui_session_utils.py | ||