litellm/tests/integration/authorization
yucheng-berri f94ac70078
fix(auth): retry a team read that loses its database connection and answer 503 when the database is down (#53260)
* fix(auth): retry a team read that loses its database connection and answer 503 when the database is down

A JWT whose team comes from team_id_jwt_field was answered 401 "Authentication Error,
database query failed: ..." when the uncached team read hit a dropped connection or a
stopped database. The Rust repositories raise NativeDatabaseFailure, which the auth error
mapper did not recognize as an outage, and the team read never retried.

The team read now retries once, inside its existing lookup deadline, when the native
failure says the connection was lost. A native failure that marks the database unavailable
and survives the retry now answers 503 no_db_connection, the same answer Prisma outages
already get. A provably missing team still answers 404.

Resolves LIT-10847

* test(auth): expect the generic 401 main now returns for an unknown JWT team
2026-11-21 12:18:19 -08:00
..
__init__.py
_guardrail_opt_out.py test(integration): stop GET /__observations from draining the upstream log (#47256) 2026-10-18 09:58:05 +00:00
_hidden_alias_budget.py fix(anthropic_endpoints)!: return Anthropic error envelopes on /v1/messages auth failures (#48466) 2026-11-03 01:53:29 +00:00
_responses_compact.py fix(proxy): check previous_response_id ownership on /v1/responses/compact (#46408) 2026-10-14 17:57:34 +00:00
test_access_group_budget.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_access_group_model_listing.py test(integration): stop GET /__observations from draining the upstream log (#47256) 2026-10-18 09:58:05 +00:00
test_access_group_rules.py feat(auth): grant access groups through principal attribute rules (#50455) 2026-11-09 13:59:40 -08:00
test_agent_access.py fix(agents): show non-admin callers the proxy URL in agent cards (#49483) 2026-10-31 16:17:11 -07:00
test_agent_denial_logging.py fix(a2a): log authenticated pre-dispatch agent rejections (#49492) 2026-10-31 15:53:01 -07:00
test_agent_least_privilege.py fix(a2a): answer proxy refusals on /a2a POST routes as JSON-RPC errors (#49476) 2026-10-31 12:54:10 -07:00
test_alias_chain_budget_waiver.py fix(anthropic_endpoints)!: return Anthropic error envelopes on /v1/messages auth failures (#48466) 2026-11-03 01:53:29 +00:00
test_audio_model_access.py test(authorization): expect the sse stream_format the proxy now sends for speech billing (#52392) 2026-11-18 00:17:48 +00:00
test_audit_any_sweep_auth.py test(integration): look up owned cache keys and clean up sweep models (#47255) 2026-10-18 10:27:53 +00:00
test_auth_object_prefetch.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_bedrock_passthrough_model_access.py
test_claude_code_gateway_oauth.py fix(anthropic_endpoints)!: return Anthropic error envelopes on /v1/messages auth failures (#48466) 2026-11-03 01:53:29 +00:00
test_cli_sso_login_ui_disabled.py test(auth): expect the CLI sign-in redirect (#53294) 2026-11-21 03:48:55 +00:00
test_customer_info_admin_gate.py fix(proxy): require proxy admin role on GET /customer/info (#52451) 2026-11-18 05:25:41 +00:00
test_customer_model_allowlist.py
test_customer_org_alias_first_request_burst.py fix(db): fail rust pool acquires at once on a refusing postgres, with #52532 integration follow-ups (#52617) 2026-11-19 07:23:54 +09:00
test_customer_org_alias_key_scope.py fix(proxy): refuse a key pinned to another customer org before registering an unknown org alias (#51674) 2026-11-13 11:03:43 -08:00
test_end_user_block.py test(integration): stop GET /__observations from draining the upstream log (#47256) 2026-10-18 09:58:05 +00:00
test_guardrail_submissions.py fix(proxy)!: label shared-handler errors the way the route catch-alls do (#39555) 2026-10-30 06:58:05 -07:00
test_hidden_alias_budget_bypass.py fix(anthropic_endpoints)!: return Anthropic error envelopes on /v1/messages auth failures (#48466) 2026-11-03 01:53:29 +00:00
test_hidden_alias_budget_bypass_chaos.py test(integration): stop GET /__observations from draining the upstream log (#47256) 2026-10-18 09:58:05 +00:00
test_jwt_auth_config_audience_and_jwks.py fix(proxy): accept audience and public_key_url in litellm_jwtauth (#53288) 2026-11-21 10:51:37 -08:00
test_jwt_auto_register_map_existing_key.py test(auth): hold the JWT mapping insert the Rust repository now sends (#53144) 2026-11-20 10:43:15 -08:00
test_jwt_default_team_provisioning.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_jwt_key_mapping_lifecycle.py fix(proxy): evict issuer-scoped JWT mapping misses on global mapping writes (#52350) 2026-11-17 14:38:53 -08:00
test_jwt_mapped_key_email_backfill.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_jwt_team_read_database_failure.py fix(auth): retry a team read that loses its database connection and answer 503 when the database is down (#53260) 2026-11-21 12:18:19 -08:00
test_key_alias_model_access.py
test_key_bound_to_unknown_user.py
test_key_budget_owner_updates.py fix(proxy)!: gate key budget_duration and budget_id updates like max_budget (#47681) 2026-10-26 16:45:35 -07:00
test_key_guardrail_opt_out.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_key_guardrail_opt_out_chaos.py test(integration): stop GET /__observations from draining the upstream log (#47256) 2026-10-18 09:58:05 +00:00
test_key_guardrail_opt_out_runtime.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_lakera_v2_on_flagged.py test(guardrails): give each Lakera outage burst call its own prompt (#52730) 2026-11-18 17:43:31 -08:00
test_legacy_empty_models_boot_warning.py feat(proxy): log keys and teams still on the deprecated empty models defaults at boot (#50720) 2026-11-10 04:05:25 +00:00
test_litellm_http_client_sso_real_io.py ci(unit): cut unit check time with cheaper per-test resets and fewer non-unit tests (#51864) 2026-11-14 15:41:30 -08:00
test_master_key_boot_check_real_io.py ci(unit): cut unit check time with cheaper per-test resets and fewer non-unit tests (#51864) 2026-11-14 15:41:30 -08:00
test_memory_ownership.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_model_access_allow_lists.py
test_object_permission_lookup.py
test_passthrough_route_denylist.py
test_rag_query_vector_store_allowlist.py test(integration): stop GET /__observations from draining the upstream log (#47256) 2026-10-18 09:58:05 +00:00
test_rag_team_provider_credentials.py fix(proxy): resolve a team wildcard deployment for a wildcard key on files, batches and RAG routes (#49744) 2026-11-18 10:55:44 +00:00
test_realtime_client_secret_access.py test(integration): cover realtime endpoint contracts (#44689) 2026-10-14 03:49:34 +00:00
test_reject_before_body.py fix(proxy): let an exhausted key keep listing models and counting tokens (#51675) 2026-11-16 03:28:26 +08:00
test_responses_compact_id_ownership.py test(integration): assert response ids stay scoped to their minting key (#50703) 2026-11-10 00:30:01 +00:00
test_responses_compact_id_ownership_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_responses_id_ownership.py fix(responses)!: authorize and decode comparison response IDs (#49402) 2026-11-03 03:40:46 +00:00
test_responses_lifecycle_during_call_guardrail.py fix(types): define the responses compact call types for during_call guardrails and deployment hooks (#50274) 2026-11-05 16:09:49 -08:00
test_search_tool_allowlist.py test(integration): expect the Exa search envelope's provider_metadata after #47423 (#47572) 2026-10-20 15:29:30 +00:00
test_search_tool_deny_by_default.py
test_sso_blank_identity.py test(sso): reuse the provider identity across dashboard and CLI sign-in (#52062) 2026-11-16 18:28:50 +00:00
test_team_admin_gate.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_team_member_permissions.py test(integration): stop GET /__observations from draining the upstream log (#47256) 2026-10-18 09:58:05 +00:00
test_team_scoped_models.py test(integration): assert team model visibility follows caller scope (#50772) 2026-11-10 00:33:57 +00:00
test_tool_search_replay_allowlist.py fix(responses bridge): round-trip tool_search_call and tool_search_output items between turns (#46444) 2026-10-14 21:40:14 -07:00
test_tool_search_replay_guardrails.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_unknown_key_generic_401.py fix(anthropic_endpoints)!: return Anthropic error envelopes on /v1/messages auth failures (#48466) 2026-11-03 01:53:29 +00:00
test_user_api_key_auth_request_flow_real_io.py ci(unit): cut unit check time with cheaper per-test resets and fewer non-unit tests (#51864) 2026-11-14 15:41:30 -08:00
test_user_self_update_guard.py fix(proxy)!: label shared-handler errors the way the route catch-alls do (#39555) 2026-10-30 06:58:05 -07:00
test_warmed_policy.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_websocket_rejection_logging.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_wildcard_model_access.py test(integration): stop GET /__observations from draining the upstream log (#47256) 2026-10-18 09:58:05 +00:00
test_workflow_ownership.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