litellm/tests/test_litellm/proxy/management_endpoints
tin-berri 360adbe765
fix(mcp): resolve config-defined servers in per-user credential and env-var endpoints (#31171)
The per-user BYOK, OAuth (OBO), and env-var management endpoints resolved the
target MCP server through a DB-only lookup (get_mcp_server / get_all_mcp_servers_for_user).
A server defined in config.yaml lives only in the in-memory registry and never
gets a row in LiteLLM_MCPServerTable, so those endpoints raised 404 "MCP Server
<id> not found" (or 403 for non-admins) before any credential could be stored,
leaving config-server users unable to connect and forced to re-authorize forever.

Route all three through a single registry-aware resolver: DB first, then the
in-memory registry (built into LiteLLM_MCPServerTable via _build_mcp_server_table,
the same fallback fetch_mcp_server already uses), then the canonical
get_allowed_mcp_servers authorization the MCP gateway enforces on tool calls.
Admins get a 404 for an unknown id; non-admins get 403 for a missing-or-forbidden
server so server ids stay non-enumerable. This also closes a gap where the two
store endpoints performed no per-server authorization at all.
2026-06-23 21:38:10 -07:00
..
policy_endpoints style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
scim feat(scim): ingest enterprise extension attributes into user metadata (#30893) 2026-06-22 12:17:41 -07:00
search_endpoints fix(proxy): self-heal startup/reload prisma reads on engine disconnect (#28803) 2026-06-10 20:16:58 +02:00
usage_endpoints fix(proxy): reject user_id=None on non-admin analytics endpoints (cross-tenant disclosure) 2026-04-30 23:54:01 +02:00
test_access_group_endpoints.py update test cases to match new behaviour. The earlier test cases assumed the cache stores a pydantic object 2026-04-28 21:08:46 +00:00
test_access_group_management.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_activity_tenant_scoping.py fix(proxy): guard agent activity owned-fallback against null user_id 2026-05-01 22:04:54 +00:00
test_budget_endpoints.py fix(budget): recompute budget_reset_at when budget_duration changes on /budget/update (#30555) 2026-06-16 14:12:39 -07:00
test_cache_settings_endpoints.py fix(proxy): self-heal startup/reload prisma reads on engine disconnect (#28803) 2026-06-10 20:16:58 +02:00
test_callback_management_endpoints.py fix(galileo): use ingest traces API and standard logging payload (#29651) 2026-06-05 09:03:17 -07:00
test_common_daily_activity.py fix(ui): resolve user_id to email in Spend Per User usage chart (#30992) 2026-06-22 12:36:22 -07:00
test_common_utils.py chore: litellm oss 170626 (#30637) 2026-06-17 21:11:12 -07:00
test_compliance_endpoints.py Add compliance checker endpoints + UI panel (#21432) 2026-02-17 18:22:26 -08:00
test_config_override_endpoints.py fix(audit): label vault POST as updated when DB row exists 2026-05-01 02:44:47 +00:00
test_cost_tracking_settings.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_customer_budget.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_customer_endpoints.py chore(oss): litellm oss staging 150626 (#30463) 2026-06-16 12:06:41 -07:00
test_delete_callbacks_endpoint.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_delete_verification_tokens_failed.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_entraid_app_roles.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_internal_user_endpoints.py fix(ui): resolve user_id to email in Spend Per User usage chart (#30992) 2026-06-22 12:36:22 -07:00
test_key_management_endpoints.py chore: litellm oss staging (#30745) 2026-06-18 13:55:35 -07:00
test_mcp_management_endpoints.py fix(mcp): resolve config-defined servers in per-user credential and env-var endpoints (#31171) 2026-06-23 21:38:10 -07:00
test_model_management_endpoints.py fix(team-management): delete a team's BYOK models when the team is deleted (#29977) 2026-06-08 16:55:35 -07:00
test_org_admin_team_access.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_organization_endpoints.py fix(team): also gate organization-scoped endpoints behind _verify_org_access 2026-04-29 22:51:59 +00:00
test_policy_endpoints.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_project_org_authz.py fix(tests): use canonical litellm_enterprise import path (#27699) 2026-05-12 12:32:57 -07:00
test_router_settings_endpoints.py feat: routing groups ui 2026-05-04 18:09:14 -07:00
test_tag_management_endpoints.py Fix internal tag usage scoping (#27315) 2026-05-11 10:44:50 -07:00
test_team_callback_endpoints.py encrypt callback_vars in key/team metadata at rest (#27141) 2026-05-23 12:15:44 -07:00
test_team_default_params.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_team_endpoints.py chore: litellm oss 170626 (#30637) 2026-06-17 21:11:12 -07:00
test_team_model_alias_merge.py chore(oss): litellm oss staging 120626 (#30292) 2026-06-12 09:49:25 -07:00
test_tool_management_endpoints.py Fix tool management tests using wrong field name call_policy 2026-03-04 11:20:17 -03:00
test_ui_sso.py feat(proxy): configurable response headers and login-page hint (#30792) 2026-06-18 18:12:45 -07:00
test_workflow_management_endpoints.py feat(proxy): durable agent workflow run tracking via /v1/workflows/runs (#26793) 2026-04-29 17:12:18 -07:00