litellm/tests/test_litellm/proxy/management_endpoints
yuneng-jiang 666f6b01b4
fix: enforce disable_custom_api_keys from general_settings (#42437)
* fix: enforce disable_custom_api_keys from general_settings

The gate in _check_custom_key_allowed read the persisted UI settings row
through get_ui_settings_cached, which had two consequences.

A config-file general_settings.disable_custom_api_keys was never enforced,
because the gate only ever looked at the stored ui_settings row. POST
/key/generate with a custom key value returned 200 even with the flag set
to true in config.yaml.

The read went through a DualCache with a 600s TTL, which is per worker
without Redis, and only the worker that served PATCH /update/ui_settings
refreshed it. A gate flipped through the UI was then a coin flip across
workers for up to ten minutes.

Both go away by routing the flag the way the other runtime UI flags are
already routed. Adding it to _RUNTIME_GENERAL_SETTINGS_FLAGS and to the
settings rules' _UI_SETTINGS_FIELDS makes SettingsStore resolve it from the
ui_settings row with the config file winning, and every pod re-reads it on
its own settings sync rather than holding a private cached copy. The two
lists have to stay in step: a flag in one and not the other resolves
against the wrong stored row and silently never reaches a reader, so there
is a test for that invariant.

Writes to the ui_settings table did not publish on the config-sync channel,
so other pods only discovered a change on their next periodic reload. Adding
litellm_uisettings to _CONFIG_SYNCED_TABLE_NAMES puts it on the same pubsub
path model and SSO config writes already use, which cuts cross-pod
propagation from tens of seconds to a few.

The value reaching the gate is run through coerce_bool first. Resolution
hands back the raw YAML value, so a quoted "true" in config.yaml is a str
and the old `is True` check let custom keys straight through.

* test: assert both directions of the coerced config value

* test: assert the runtime flags read back instead of inspecting the registry
2026-09-22 13:28:31 -07:00
..
management_v1 fix(team): keep a forked member budget's reset window and audit bulk member budget writes 2026-09-17 15:17:00 -07:00
policy_endpoints fix(registry): correct eu Claude 3.5 Haiku Bedrock pricing, add Nova v1 tool_choice, Azure gpt-5.5 snapshot retirement 2026-09-09 13:16:04 +00:00
scim fix(proxy): evict the cached user row when SCIM or /user/delete removes a user 2026-09-21 13:51:26 -07:00
search_endpoints fix(proxy): sync search tools into the router on management writes 2026-08-26 11:46:54 -07:00
usage_endpoints fix(proxy): emit SSE keepalives on queue, rag, azure passthrough, usage chat and policy enrich streams (#39273) 2026-09-03 18:23:37 -07:00
jwt_key_mapping_doubles.py test(proxy): share the jwt key mapping test doubles across the deletion endpoint tests 2026-09-18 00:17:45 +00:00
test_access_group_endpoints.py feat(agents): attach access groups to agents and enforce them for models, MCP servers and agent calls 2026-09-17 19:24:14 +00:00
test_access_group_management.py test(budgets): cover management null handling 2026-09-16 21:42:55 -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 Merge pull request #42026 from BerriAI/litellm_user_jwt_savings 2026-09-21 16:41:16 -07:00
test_budget_endpoints.py feat(proxy): add tpd_limit (tokens per day) for batch submissions 2026-09-13 10:06:07 +00: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(otel v2): opt-in llm_only span scope for Langfuse destinations and the operator Langfuse exporter 2026-09-18 02:47:29 +00:00
test_common_daily_activity.py fix(ui): stop Top Virtual Keys from opening keys that are not in the database 2026-09-19 11:08:21 -07:00
test_common_utils.py feat(team): team-level model_max_budget with key-level overrides 2026-09-16 00:40:58 +00:00
test_compliance_endpoints.py Revert "refactor(guardrails): rename scoped-out evaluation status from not_run to skipped" 2026-09-14 23:46:09 +00:00
test_config_override_endpoints.py feat(vault): add separate login and secret namespaces for HashiCorp Vault 2026-09-17 01:41:48 +00:00
test_coordination_redis_endpoints.py test: drop two inert type: ignore comments 2026-09-19 14:22:19 -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 Merge pull request #41832 from BerriAI/litellm_lit_8111_cache_read_missing_rate 2026-09-18 10:56:25 -07:00
test_credential_migration.py fix(mcp): encrypt stored static headers and stdio environment (#40164) 2026-09-07 16:03:06 -07: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 test(proxy): include temp budget fields in customer budget table fixture 2026-09-17 18:10:00 +00: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_id_jag_assertion_capture.py feat(mcp): warn when an oauth2_id_jag server outruns the SSO provider's assertion capture (#35394) 2026-09-05 12:43:09 -07:00
test_internal_user_endpoints.py fix(proxy): write key deleted audit logs for cascade and alias key deletions (#42446) 2026-09-22 11:52:08 -07:00
test_key_management_endpoints.py fix: enforce disable_custom_api_keys from general_settings (#42437) 2026-09-22 13:28:31 -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): keep config-defined servers read-only (#42299) 2026-09-21 22:56:21 -07:00
test_model_management_endpoints.py fix(proxy): drop cost-map metadata echoed back on model save (#41944) 2026-09-21 19:33:16 -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 Merge pull request #41620 from BerriAI/litellm_team_member_temp_budget_increase 2026-09-18 11:38:34 -07:00
test_password_endpoints.py feat(auth): only allow password-login dashboard sessions to call /user/password/change 2026-09-21 22:22:12 +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 feat(proxy): let team admins manage projects via team_admin_editable_team_fields 2026-09-19 01:02:50 +00:00
test_prompt_cache_prediction.py Revert "test: keep prompt cache prediction logic tests and drop only their price pins" 2026-09-18 00:40:38 +00:00
test_prompt_caching_requests.py feat(ui): show prompt caching requests and net savings 2026-09-19 18:27:38 -07:00
test_ptu_model_settings.py feat(router): limit heuristic_v2 auto-routers to one without the auto_router license feature (#39468) 2026-09-03 13:39:58 -07:00
test_router_settings_endpoints.py feat(router): add group-scoped priority routing strategy (#42378) 2026-09-22 13:09:38 -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(budgets): avoid mutable fixture state 2026-09-16 22:06:31 -07:00
test_team_admin_field_permissions.py feat(proxy): let team admins manage projects via team_admin_editable_team_fields 2026-09-19 01:02:50 +00:00
test_team_callback_endpoints.py feat(arize): per-team success and error sampling rates for the Arize AX callback (#42383) 2026-09-22 11:21:40 -05:00
test_team_default_params.py refactor(proxy): make the config file win over the database 2026-09-18 01:28:21 -07:00
test_team_endpoints.py fix(proxy): write key deleted audit logs for cascade and alias key deletions (#42446) 2026-09-22 11:52:08 -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 chore(proxy): drop explanatory docstrings from credentials hint helper and tests 2026-09-14 19:29:30 +00: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