litellm/tests/test_litellm/proxy/management_endpoints
yuneng-jiang 3cac5e5cd4
fix(sso): resolve multi-valued role claims to the highest privilege role (#39480)
* fix(sso): resolve multi-valued role claims to the highest privilege role

A role claim carrying several roles used to resolve to whichever one the IdP
listed first, so a user holding both proxy_admin_viewer and internal_user lost
org-level spend visibility depending on claim ordering alone.

get_litellm_user_role now picks the highest privilege role out of a list-valued
claim, and the Entra app_roles path shares that same resolution instead of
keeping its own copy of the hierarchy. SAML assertions carrying several role
values go through the same path rather than taking the first value.

* test(sso): lock ranked-over-unranked role resolution for mixed claims

org_admin, team and customer sit outside the privilege ladder. Pin the
resolution for a claim that mixes one of them with a ranked role so the
asymmetry is covered rather than implicit.

* fix(sso): label the claim-sequence cast for the type-discipline gate

* fix(sso): resolve claim entries without recursing

The repo's recursive-function gate rejects self-recursion here, and a role
claim is flat anyway. Pull the single-value lookup into its own helper so the
list branch maps over it instead of calling back into itself.
2026-09-02 22:44:17 -07:00
..
management_v1 feat(proxy): add paginated GET /public/v1/model_hub (#38636) 2026-08-28 10:02:59 -07:00
policy_endpoints fix(policy): let the AI policy suggester drop sampling params its model refuses (#38594) 2026-08-29 10:58:27 -07:00
scim feat(scim): add placeholder listing and merge so a shadowed account can be healed (#39231) 2026-09-02 01:04:53 +00:00
search_endpoints fix(proxy): sync search tools into the router on management writes 2026-08-26 11:46:54 -07:00
usage_endpoints test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
test_access_group_endpoints.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_access_group_management.py feat(ui): set a model access group's shared budget from the dashboard 2026-08-29 16:32:28 -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(shadow_eval): compare several auto-routers on one job's sampled traffic (#39028) 2026-08-31 21:31:08 -07:00
test_budget_endpoints.py test(budget): annotate the new locals with Final 2026-08-26 17:55:33 -07:00
test_cache_settings_endpoints.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_callback_management_endpoints.py feat(newrelic): per-team New Relic trace routing via team callbacks (#37603) 2026-08-22 19:13:48 -07:00
test_common_daily_activity.py feat(spend): report prompt caching savings as total and gateway-attributed (#38134) 2026-08-28 00:19:06 -07:00
test_common_utils.py test: merge three stranded twins into the files that shadow them (#37600) 2026-08-20 14:25:23 -07:00
test_compliance_endpoints.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_config_override_endpoints.py feat(proxy): cyberark conjur secret manager configuration via Admin UI (#38445) 2026-08-29 13:36:08 -07:00
test_coordination_redis_endpoints.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_cost_estimate_endpoint.py test: run the 30 test files stranded in the second mirror (#37595) 2026-08-20 10:59:43 -07:00
test_cost_tracking_settings.py test(cost-estimate): keep the new tests inside the test-quality budgets 2026-08-26 00:32:25 -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 Merge branch 'litellm_internal_staging' into fix/34379-unblock-customer 2026-08-30 00:17:26 +08:00
test_delete_callbacks_endpoint.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_delete_verification_tokens_failed.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -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 fix(ui_sso): resolve highest privilege Entra app role, not first in claim (#36728) 2026-08-27 10:26:45 -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 feat(auth): enforce configurable password policy and SSO-only login (#39381) 2026-09-02 14:28:13 -07:00
test_key_management_endpoints.py fix: stop a cleared Team field from blocking personal key creation 2026-09-01 15:17:00 -07:00
test_mcp_connector_import.py fix(mcp): harden connector import auth handling and registration 2026-08-29 13:41:22 -07:00
test_mcp_management_endpoints.py fix(mcp): harden connector import auth handling and registration 2026-08-29 13:41:22 -07:00
test_model_management_endpoints.py fix: keep litellm_credential_name from LiteLLM Params JSON and gate stored credential attach to proxy admins (#39047) 2026-09-01 13:46:18 -07:00
test_org_admin_team_access.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_organization_endpoints.py refactor(repositories): type prisma table access with one generic protocol 2026-08-25 12:14:17 +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_ptu_model_settings.py test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
test_router_settings_endpoints.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_saml_sso.py fix(sso): resolve multi-valued role claims to the highest privilege role (#39480) 2026-09-02 22:44:17 -07:00
test_tag_management_endpoints.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_team_callback_endpoints.py refactor(repositories): type prisma table access with one generic protocol 2026-08-25 12:14:17 +00:00
test_team_default_params.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_team_endpoints.py fix(proxy): include litellm_model_table in GET /v2/team/list (#39045) 2026-08-31 23:19:45 -07:00
test_team_model_alias_merge.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_tool_management_endpoints.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_ui_sso.py fix(sso): resolve multi-valued role claims to the highest privilege role (#39480) 2026-09-02 22:44:17 -07:00
test_workflow_management_endpoints.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00