litellm/tests/test_litellm/proxy/management_endpoints
ryan-crabbe-berri 78addb230b
fix(proxy): deny agent access when key and team grants resolve to nothing (#36221)
* fix(proxy): deny when agent grants resolve to nothing

`get_allowed_agents` returned a plain list where the empty value meant both
"this caller was never restricted" and "this caller's grants resolved to
nothing". Downstream read either as allow-all, so a key restricted to one
agent inside a team restricted to another reached every agent on the proxy,
and an access group that resolved to no agents did the same.

Replace it with `resolve_agent_access`, returning a tagged
UnrestrictedAgentAccess | RestrictedAgentAccess. Only a caller with no grant
anywhere is unrestricted; an empty restricted set denies. Access group lookup
failures now propagate to the key/team resolvers so a DB error still fails
open exactly as before, while a group that genuinely resolves to nothing
denies.

* style(proxy): drop redundant comments from the agent access match
2026-08-07 20:44:11 +00:00
..
management_v1 feat(proxy): add GET /management/v1/budgets (#35310) 2026-07-31 11:47:05 -07:00
policy_endpoints style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
scim fix(scim): stop provisioning nested group ids as internal users (#34997) 2026-07-29 09:38:17 -07:00
search_endpoints test(proxy): type the search tool test helpers and record lookups with AsyncMock 2026-08-05 23:40:16 -07: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 fix(proxy): report when a model write does not survive the post-write reload 2026-07-28 18:52:06 -07:00
test_activity_tenant_scoping.py fix(proxy): deny agent access when key and team grants resolve to nothing (#36221) 2026-08-07 20:44:11 +00:00
test_auto_router_endpoints.py feat(spend): rebuild the auto-router benchmarks backend as a per-session rollup (#35910) 2026-08-05 20:06:32 +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(ui): reflect REDIS_* env cache config and stop the UI overwriting the stored password (#34160) 2026-07-21 18:36:26 -07: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(proxy): include today's UTC bucket when a daily activity range ends at the caller's current day (#36051) 2026-08-05 22:33:54 -07:00
test_common_utils.py test(proxy): add regression tests for management_endpoints edge cases (#32976) 2026-07-13 15:05:13 -07:00
test_compliance_endpoints.py fix(proxy): match multi-mode guardrail_mode without false-COMPLIANT (#32832) 2026-07-10 16:41:28 -07: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_coordination_redis_endpoints.py fix(proxy): give proxy_admin_viewer read parity with proxy_admin (#35851) 2026-08-05 18:33:55 +00:00
test_cost_tracking_settings.py test(proxy): add regression tests for management_endpoints edge cases (#32976) 2026-07-13 15:05:13 -07:00
test_credential_migration.py feat(proxy): add AES-256-GCM at-rest credential encryption with versioned format and re-encryption migration (#31215) 2026-06-29 20:14:22 +02:00
test_customer_budget.py feat(proxy): type Customer Management response_model for OpenAPI coverage (#31043) 2026-06-30 09:58:01 -07:00
test_customer_endpoints.py refactor(lint): apply every safe ruff autofix and zero 28 strict-rule budgets 2026-08-01 15:43:29 -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_encryption_endpoints.py feat(proxy): add AES-256-GCM at-rest credential encryption with versioned format and re-encryption migration (#31215) 2026-06-29 20:14:22 +02:00
test_entraid_app_roles.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_gateway_request_endpoints.py feat(sgr): make the gateway middleware the source of truth for successful requests (#35717) 2026-08-05 12:40:47 -07:00
test_internal_user_endpoints.py fix(proxy): allow non-admins to reach /user/daily/activity/aggregated 2026-08-05 23:24:37 -07:00
test_key_management_endpoints.py fix(proxy): give proxy_admin_viewer read parity with proxy_admin (#35851) 2026-08-05 18:33:55 +00:00
test_mcp_management_endpoints.py fix(mcp): annotate connected-app reachability on the gateway connect page (#34867) 2026-07-31 05:38:54 +00:00
test_model_management_endpoints.py feat(auto-router): let operators replace the LLM classifier's system prompt (#35855) 2026-08-05 19:48:11 +00: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 feat(organization): add RESTful PATCH /v2/organization/{organization_id} (#32350) 2026-07-23 04:53:20 +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_saml_sso.py feat(proxy): add SAML 2.0 SSO for the admin UI (#31429) 2026-07-24 12:51:28 -07:00
test_tag_management_endpoints.py refactor(test): tighten typing on the tag list verification token double 2026-07-31 09:52:46 -07:00
test_team_callback_endpoints.py fix(team-callbacks): actually stop logging when disable_logging is called (#35520) 2026-08-03 11:02:51 -07:00
test_team_default_params.py feat(teams): apply default organization to new teams from default team settings (#35540) 2026-08-03 12:57:12 -07:00
test_team_endpoints.py perf: build log messages lazily so filtered-out log records cost nothing (#35703) 2026-08-04 04:34:52 +00: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): drop unsupported prisma select kwarg from team lookup (#35293) 2026-07-31 11:42:52 -07:00
test_ui_sso.py feat(teams): apply default organization to new teams from default team settings (#35540) 2026-08-03 12:57:12 -07:00
test_workflow_management_endpoints.py fix(proxy): give proxy_admin_viewer read parity with proxy_admin (#35851) 2026-08-05 18:33:55 +00:00