litellm/tests/integration/management
jesus-berri 0462e6903e
fix(proxy)!: drop a user from the organization's teams when they are removed from the organization (#49904)
* fix(proxy): drop a user from the organization's teams when they are removed from the organization

* fix(proxy): resolve the removed member's user id once in organization_member_delete

* fix(proxy): read organization teams from the writer when cascading org member removal

A team the user joined moments ago may not be on the read replica yet, which would
leave that team membership and its keys behind. Adds an integration regression that
removes an org member and checks team rows and team keys on the gateway and its peer.

* test(proxy): check org-team key refusal on fresh requests after both proxies converge

Also trims the cascade helper's docstring to the business rule.

* fix(proxy): finish org member removal when a team already dropped the user

A concurrent /team/member_delete can take the user off a team between the org's
team lookup and the per-team lock. That team now counts as done instead of failing
the org removal. Every other team error still stops it with the org row in place.

Drops the user_email case from the unit test, since email lookup is broken on main
(LIT-11345), and covers the unknown-email path touching nothing.

* fix(proxy): clear stale team references on organization member removal

* test(proxy): mark organization cleanup test locals final

* test(proxy): lag the user table on the replica so the org member delete test proves the writer read
2026-12-04 11:53:46 -08:00
..
__init__.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
_batch_file_caps.py feat(proxy): cap batch file records, daily batch uploads, and per-file downloads (#43632) 2026-10-06 03:06:36 +00:00
cost_center_service.py test: migrate SDK and proxy-booting legacy CircleCI tests to their tiers (#45758) 2026-10-11 00:17:21 -07:00
team_metadata_validation_proxy_config.yaml test: migrate SDK and proxy-booting legacy CircleCI tests to their tiers (#45758) 2026-10-11 00:17:21 -07:00
test_access_group_team_sync.py test(access-groups): store the two groups in scan order instead of asserting the order Postgres chose (#54532) 2026-11-25 22:10:37 +00:00
test_added_backup_deployment_serves_peer_fallbacks.py fix(proxy): apply new model rows on every worker as soon as they are written (#49034) 2026-10-30 03:19:25 -07:00
test_agent_management.py test(integration): repair agent reads and bulk deletion setup (#49719) 2026-11-02 13:44:45 -08:00
test_audit_log_listing.py fix(proxy): read audit update rows stored before #50929 in GET /audit (#53305) 2026-11-21 04:58:51 +00:00
test_auto_router_databricks_classifier_writes.py test(integration): match Databricks classifier budget telemetry (#49382) 2026-10-30 20:13:51 -07:00
test_batch_file_usage_caps.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_batch_file_usage_caps_chaos.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_batch_limit_metadata_admin_only.py feat(proxy): cap batch file records, daily batch uploads, and per-file downloads (#43632) 2026-10-06 03:06:36 +00:00
test_batch_output_file_listing.py test(integration): keep a background retry loop from spanning provider recovery in the batch output refresh test (#56139) 2026-12-04 01:48:44 +00:00
test_budget_list_sorting.py feat(ui): sort budgets by reset duration (#48107) 2026-10-23 16:21:53 -07:00
test_budget_model_limits.py feat(budgets): add per-model tpm and rpm limit maps to budgets and customers (#50797) 2026-11-09 22:15:18 -08:00
test_budget_reset_windows.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_budget_throttle_admin_only.py fix(proxy): refuse throttle_on_budget_exceeded inside key metadata for non-admins (#56304) 2026-12-04 19:38:29 +00:00
test_budget_updates.py test(budgets): allow a 31 day month in the 30d budget reset window (#55560) 2026-12-01 13:14:33 -08:00
test_claude_code_plugin_installation_preference.py test(skills): assert patch publication and serialize preference writes (#50252) 2026-11-05 20:16:15 +00:00
test_cli_models_list.py feat(cli): list models alphabetically in lite models list (#51248) 2026-11-28 16:11:42 -08:00
test_credential_display_name.py fix(credentials): preserve stored info when patching credentials (#49919) 2026-11-03 16:15:09 -08:00
test_credential_federation_values.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_credential_migration_endpoint.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_credential_writes_survive_reload.py fix(proxy): hold DB_RECONCILE_LOCK around credential create, update and delete (#50551) 2026-11-07 16:02:44 -08:00
test_customer_budget_reset.py fix(proxy): /customer/new budgets reset on the same schedule as other budgets (#51689) 2026-11-13 19:22:14 +00:00
test_customer_member_budget_concurrency.py fix(customer-management)!: preserve permanent budgets across temporary increases (#52787) 2026-11-19 10:55:11 -08:00
test_customer_model_limits.py feat(rate-limit): name the limit that rejected a request in a rate_limited_by header on the 429 (#51228) 2026-11-11 14:39:53 -08:00
test_customer_override_expiry.py fix(proxy): drop a customer override expiry sent without an override (#51667) 2026-11-13 11:24:05 -08:00
test_customer_team_delete_budgets.py fix(proxy): delete a customer team's override budget when the team has no overall budget (#51703) 2026-11-13 13:05:19 -08:00
test_customer_unknown_fields.py feat(customers): reject unknown fields on /customer/new and /customer/update instead of dropping them (#50965) 2026-11-10 18:08:21 +00:00
test_f7_coverage_closeout.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_f7_key_coverage_push.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_fallback_management_public_names.py fix(fallback): preserve concurrent writes and serve saved configuration (#51245) 2026-11-11 15:26:23 -08:00
test_guardrail_usage_config_guardrail.py fix(guardrails): serve usage detail for a guardrail removed from config (#53315) 2026-11-23 11:54:37 -08:00
test_health_routing.py test(integration): keep the database down during readiness checks (#54931) 2026-11-28 01:03:20 +00:00
test_key_aliases.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_key_block_unblock.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_key_budget_limits.py feat(proxy): per-key and per-team model ITPM/OTPM limits in the v3 rate limiter (#54311) 2026-11-28 11:03:47 -08:00
test_key_bulk_update.py fix(proxy): keep configured key limits on key update and regenerate (#53369) 2026-12-01 10:50:30 -08:00
test_key_default_allowed_routes.py feat(proxy): give AI API service accounts safe default routes only (#54027) 2026-11-24 11:43:32 -05:00
test_key_delete.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_key_delete_revocation.py fix(proxy): evict a deleted key from every worker's auth cache (#47609) 2026-10-30 10:20:00 -07:00
test_key_generate.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_key_generation_permissions.py test: migrate SDK and proxy-booting legacy CircleCI tests to their tiers (#45758) 2026-10-11 00:17:21 -07:00
test_key_health.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_key_info.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_key_info_v2.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_key_list.py feat(ui): sort virtual keys by expiry, activity, spend and limits (#48074) 2026-10-23 15:45:17 -07:00
test_key_regenerate.py fix(proxy): keep configured key limits on key update and regenerate (#53369) 2026-12-01 10:50:30 -08:00
test_key_reset_spend.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_key_route_contracts.py test: move 76 live top-level tests to offline unit and integration coverage (#45352) 2026-10-08 10:33:35 -07:00
test_key_service_account_generate.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_key_team_change.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_key_update.py fix(proxy): keep configured key limits on key update and regenerate (#53369) 2026-12-01 10:50:30 -08:00
test_key_updates.py fix(tests): resolve the integration support package without run.py's PYTHONPATH 2026-09-15 21:10:08 -07:00
test_listing_and_health_contracts.py fix(budgets): reset 12months and other long unit spellings on their short form's schedule (#51672) 2026-11-13 11:08:55 -08:00
test_managed_file_create_ownership.py fix(proxy): org admin spend log scope and gemini file id parsing (#52943) 2026-11-19 22:08:27 +00:00
test_managed_vector_store_unified_id.py test(integration): cover vector_stores endpoint contracts (#44739) 2026-10-14 03:59:08 +00:00
test_master_key_rotation.py feat(mcp): cover stored profile credentials in key rotation and AES migration (#53671) 2026-11-28 15:07:22 -08:00
test_model_credential_name_updates.py fix(proxy): validate model credential name only when it changes (#42701) 2026-09-23 07:34:32 -07:00
test_model_deployment_lifecycle.py test: migrate SDK and proxy-booting legacy CircleCI tests to their tiers (#45758) 2026-10-11 00:17:21 -07:00
test_model_health_check.py test(extraction): audit #47473 (#48898) 2026-10-28 17:12:07 -07:00
test_model_hub_custom_metadata.py feat(model hub): show admin-defined custom tags and metadata from model_info (#46064) 2026-10-20 17:45:06 -07:00
test_model_hub_wildcard_health.py feat(proxy): health check AI Hub models published through a wildcard (#52875) 2026-11-20 11:03:02 -08:00
test_model_rename_propagation.py test(integration): cover model_management endpoint contracts (#44684) 2026-10-14 03:36:47 +00:00
test_organization_budget_clear.py test(integration): regression tests for August cost tracking and budgeting bugs (#42622) 2026-09-23 04:13:03 +00:00
test_organization_lifecycle.py fix(proxy)!: drop a user from the organization's teams when they are removed from the organization (#49904) 2026-12-04 11:53:46 -08:00
test_partial_update_sequences.py test: expect 422 for budget refusals in unification, e2e and integration suites 2026-09-20 06:33:57 +00:00
test_pass_through_model_hub.py test(model-hub): compare matching pass-through rows (#53193) 2026-11-20 21:29:46 +00:00
test_policy_attachment_runtime.py test(management): isolate global policy attachment state (#52318) 2026-11-17 23:48:52 +00:00
test_policy_template_refused_temperature.py fix(policy): drop refused temperatures on policy template enrichment calls (#53311) 2026-11-21 14:01:06 -08:00
test_project_lifecycle.py fix(proxy): copy a shared budget row when a project edits its budget limits (#56075) 2026-12-04 01:36:56 +00:00
test_prompt_management.py test(integration): cover prompts_tags_caching endpoint contracts (#44686) 2026-10-14 04:10:31 +00:00
test_ptu_share_guards.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_scim_admin_group.py fix(proxy)!: stop answering with the literal string "None" as error type and param on the proxy-server, auth, spend, and key health routes (#39540) 2026-10-29 18:20:52 -07:00
test_scim_group_bulk_roster.py fix(scim): clear every group or member on a PATCH remove with no value or filter (#51784) 2026-11-24 03:21:28 +00:00
test_scim_group_delete.py fix(scim): answer every /scim/v2 error with the RFC 7644 SCIM Error schema (#51322) 2026-11-17 19:10:33 +00:00
test_scim_group_member_not_yet_provisioned.py test(integration): cover customer reported cache key, cache_control, bedrock request id, responses schema, scim and tag budget contracts (#42785) 2026-09-23 13:19:38 -07:00
test_scim_group_pathless_patch.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_scim_user_lifecycle.py fix(scim): clear every group or member on a PATCH remove with no value or filter (#51784) 2026-11-24 03:21:28 +00:00
test_scim_user_team_race.py fix(scim): stop SCIM user writes from overwriting teams a concurrent group push added (#50785) 2026-11-24 07:48:16 -08:00
test_search_tool_crud.py test(integration): expect the Exa search envelope's provider_metadata after #47423 (#47572) 2026-10-20 15:29:30 +00:00
test_skill_download_history.py feat(skills): export download history as streamed CSV (#52569) 2026-11-21 21:14:46 +00:00
test_smoke.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_sso_sign_in.py fix(proxy): accept special-use email domains in generic SSO (#54026) 2026-11-24 19:16:23 -05:00
test_tag_budget_update.py fix(proxy): stop /tag/update 500 when the body carries the tag's budget_id (#50324) 2026-11-06 08:55:44 -08:00
test_team_available.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_block.py test(proxy): wait for a team block to reach the peer proxy before expecting a new team key to be refused (#53532) 2026-11-22 06:01:38 +00:00
test_team_block_unblock.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_blocking_multi_instance.py fix(proxy): broadcast team cache invalidation on team writes (#46113) 2026-10-13 16:25:22 -04:00
test_team_budget_duration_defaults.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_team_budget_limits.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_bulk_member_add.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_bulk_member_delete.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_create_atomicity_real_io.py fix(proxy): write team creation rows in one transaction (#53763) 2026-11-28 15:07:34 -08:00
test_team_daily_activity.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_delete.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_delete_chaos.py test(integration): give chaos and timing tests a harness API and gate raw signals (#46031) 2026-10-12 05:27:33 -07:00
test_team_delete_inputs.py fix(proxy): delete large teams without per-member transaction fan-out (#42998) 2026-09-30 13:49:18 -07:00
test_team_delete_large_membership.py test(management): account for the ledger writer reserve (#53293) 2026-11-21 03:49:05 +00:00
test_team_delete_member_add_race.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_team_delete_member_cache_eviction.py fix(scim): write a group's roster in one locked transaction instead of one member at a time (#45197) 2026-10-15 10:57:00 -07:00
test_team_delete_prometheus.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_team_filter_ui.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_info.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_key_bulk_generate.py feat(proxy): add /team/key/bulk_generate to create one key per team member (#55272) 2026-12-01 12:31:01 -08:00
test_team_key_bulk_update.py test(management): expect a permitted member's bulk update of another member's key to be refused per key (#56076) 2026-12-03 20:15:18 +00:00
test_team_list.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_list_sorting.py feat(ui): sort every teams table data column (#48109) 2026-10-23 16:21:36 -07:00
test_team_list_v2.py feat(teams): show caller member spend and budget on Your Teams (#45674) 2026-10-24 17:09:55 -07:00
test_team_member_add.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_member_budget_cache.py test(integration): regression tests for August cost tracking and budgeting bugs (#42622) 2026-09-23 04:13:03 +00:00
test_team_member_delete.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_member_info_validation.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_member_lifecycle.py test(integration): stop GET /__observations from draining the upstream log (#47256) 2026-10-18 09:58:05 +00:00
test_team_member_me.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_member_reset_budget.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_member_reset_spend.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_member_routes.py revert(proxy): remove per AI tool limits for teams and members (#55670) 2026-12-03 04:28:08 +00:00
test_team_member_update.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_members_list.py test(management): isolate the seeded roster per test (#52652) 2026-11-18 21:45:50 +00:00
test_team_members_list_faults.py feat(proxy): page team members and stop loading full rosters for /team/info callers (#51885) 2026-11-17 16:30:52 -08:00
test_team_metadata_schema.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_metadata_validation.py test(integration): give chaos and timing tests a harness API and gate raw signals (#46031) 2026-10-12 05:27:33 -07:00
test_team_model.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_new.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_permissions.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_permissions_bulk_update.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_spend_by_user.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_team_update.py feat(proxy): let proxy admins open team metadata to team admins, keeping proxy settings with proxy admins (#46506) 2026-10-14 23:51:44 +00:00
test_team_update_multi_instance.py test(proxy): give multi-instance team RPM tests 45s for peer cache invalidation (#54880) 2026-12-02 15:56:00 -08:00
test_tool_policy_user.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_user_delete_revokes_keys.py fix(proxy)!: label shared-handler errors the way the route catch-alls do (#39555) 2026-10-30 06:58:05 -07:00
test_user_list_sorting.py feat(ui): sort every users table data column (#48105) 2026-10-23 16:12:51 -07:00
test_user_rate_limit_updates.py fix(proxy): evict cached user on every proxy for tpm/rpm updates and edit limits in the users UI (#44130) 2026-10-07 16:02:32 -07:00
test_user_routes.py test: move 76 live top-level tests to offline unit and integration coverage (#45352) 2026-10-08 10:33:35 -07:00
test_user_updates_wedged_coordination_redis.py fix(rust_bridge): send warnings from unscoped native threads to the proxy log (#53539) 2026-11-23 17:53:52 +09:00
test_users_bulk_delete.py test: migrate tests/proxy_behavior into integration and unit tiers (#45939) 2026-10-11 08:28:42 -07:00
test_vector_store_config_ownership.py test(integration): stop GET /__observations from draining the upstream log (#47256) 2026-10-18 09:58:05 +00:00
test_vector_store_file_list_managed_ids.py fix(managed_files): keep the upload the managed id encodes when two target models share a deployment (#49420) 2026-11-03 00:58:41 +00:00