mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-23 00:41:40 +00:00
The fail-closed gate previously denied access for any server when client_ip was None — including legitimately-public servers. A real HTTP request whose IP couldn't be extracted (ASGI middleware nulling request.client, broken X-Forwarded-* parsing, etc.) would 404 against a public OAuth endpoint with no actionable diagnostic for operators. Reorder _is_server_accessible_from_ip to check the public-server short-circuits (available_on_public_internet and litellm.public_mcp_servers) before failing closed on None. Non-public servers still fail closed when client_ip is None; the mcp_allow_unknown_client_ip opt-out still works as a wider escape hatch for operators who can't fix IP extraction. Also remove the None short-circuits in filter_server_ids_by_ip_with_info and get_filtered_registry so they delegate to the per-server gate, which now handles None correctly. Update test_gate_contract to expect public+None → True and add test_public_server_reachable_when_ip_unknown and test_no_ip_lets_public_through_blocks_private for the new semantics. |
||
|---|---|---|
| .. | ||
| test_admin_viewer_handler_access.py | ||
| test_auth_checks.py | ||
| test_auth_exception_handler.py | ||
| test_auth_hot_path_network_requests.py | ||
| test_auth_utils.py | ||
| test_cli_auth.py | ||
| test_custom_auth_end_user_budget.py | ||
| test_handle_jwt.py | ||
| test_info_routes.py | ||
| test_litellm_license.py | ||
| test_login_utils.py | ||
| test_mcp_ip_filtering.py | ||
| test_model_checks.py | ||
| test_model_checks_fallbacks.py | ||
| test_multi_budget_windows.py | ||
| test_oauth2_proxy_hook.py | ||
| test_object_permission_loading.py | ||
| test_onboarding.py | ||
| test_organization_budget_enforcement.py | ||
| test_password_hashing.py | ||
| test_route_checks.py | ||
| test_router_override_fallback_auth.py | ||
| test_team_member_budget.py | ||
| test_unmapped_model_budget_enforcement.py | ||
| test_user_api_key_auth.py | ||