litellm/tests/test_litellm/proxy/management_endpoints
tin-berri db2402754a
feat(mcp): let users select the entra_obo token_exchange profile in the UI and API (#32144)
* feat(mcp): let users select the entra_obo token_exchange profile in the UI and API

The backend token_exchange arm supports two wire dialects via token_exchange_profile
("rfc8693" default, or "entra_obo" for Microsoft Entra's On-Behalf-Of, the RFC 7523
jwt-bearer grant), but it could only be set through config.yaml. This surfaces it to the
create/update REST API and the dashboard so an admin can create an entra_obo server there,
completing the parity started in the parent PR for the other token-exchange fields.

token_exchange_profile becomes a dedicated column on LiteLLM_MCPServerTable, mirroring the
sibling fields: it is added to the request models, read column-first in
build_mcp_server_from_table with the credentials-blob as a back-compat fallback and a
default of rfc8693, and carried through both runtime-to-table builders so registry
round-trips preserve it. It is a non-secret dialect selector, so it is not scrubbed from
non-admin or virtual-key responses.

In the dashboard a Profile dropdown (RFC 8693 vs Microsoft Entra OBO) is added to the
token-exchange section. Entra OBO carries the target resource in the scope, so selecting it
makes the scope required and hints the api://<app-id>/.default form, while audience and
subject_token_type (which that dialect ignores) are hidden.

* fix(mcp): extend the blob-to-column lift and non-admin scrubbing to token_exchange_profile

token_exchange_profile gets the same storage contract as the other three
token-exchange settings: the column is authoritative, a blob copy is the legacy
shape — lifted into the column on every write and stripped from the stored
blob — and switching auth_type away from token exchange clears it
(_AUTH_FLOW_SCOPED_FIELDS). Both restricted-view sanitizers scrub it for
uniformity, and the edit form's auth-switch payload nulling includes it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test(mcp): assert every token-exchange setting is configurable via config.yaml

Pins the config surface: token_exchange_endpoint, audience, subject_token_type
and token_exchange_profile load from top-level config keys onto the built
server and through to the resolver spec; omitted keys resolve to their
documented defaults (RFC 8693 subject token type, rfc8693 profile), and
token_exchange servers need no oauth2_flow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 16:39:20 -07:00
..
policy_endpoints style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
scim feat(proxy): audit remaining system-wide settings updates (#31754) 2026-06-30 19:32:27 -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(cache): mask inline url credentials and drop discrete username under url precedence 2026-07-03 13:55:45 -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(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 staging 250626 (#31305) 2026-06-25 21:00:28 -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_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 feat(mcp): add mcp_tool_search virtual tools for large tool catalogs (#31777) 2026-06-30 20:03:59 -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_internal_user_endpoints.py fix(proxy): admin-gate permissions on /user/new and /user/update (LIT-4138) (#31998) 2026-07-02 22:08:53 -07:00
test_key_management_endpoints.py feat(budget): throttle keys after spend limit instead of revoking access (#31300) 2026-07-07 09:41:01 -07:00
test_mcp_management_endpoints.py feat(mcp): let users select the entra_obo token_exchange profile in the UI and API (#32144) 2026-07-07 16:39:20 -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 feat(proxy): audit remaining system-wide settings updates (#31754) 2026-06-30 19:32:27 -07:00
test_team_endpoints.py fix(mcp): stop 'Team doesn't exist' warnings for UI dashboard sessions (#32348) 2026-07-07 10:27:00 -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 fix(cli): mint per-session agent credential on lite login (#31072) 2026-06-26 09:05:15 -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