litellm/tests/unit/proxy/auth
Jesus Velarde b3a361e648 fix(proxy): serve a deployment's litellm model only through the deployments the caller is granted
A key or team restricted to an access group or a public model name got a 403 when the request named a deployment by its litellm_params.model, because every model access check keys by public name. Auth now admits such a name on the request path when the caller is granted at least one deployment it selects, and the router asks the proxy which of the deployments it resolved the caller may use, so the request is load balanced across the granted ones only.

The router core gets one host step, authorize_candidates, asked on every resolution of a request that names a deployment's litellm model for a keyed caller, and on a custom strategy's pre-routed pick. A caller left with no deployment gets the key model access denied 403 with no retry, fallback or passthrough. Dispatches in route_llm_request that skip the router refuse such a name when the caller could not have requested it in strict mode. Every other caller of the model gates keeps the strict default.
2026-11-26 03:17:39 -08:00
..
host perf(proxy): read only the needed team fields from the auth cache (#53909) 2026-11-23 12:53:14 -08:00
__init__.py
_user_table.py feat(db): rust repositories for user, end user and budget auth objects (#52170) 2026-11-18 22:32:05 +00:00
conftest.py refactor(proxy): move non-auth writers out of the auth cache (#51599) 2026-11-20 17:57:38 +09:00
test_access_group_rules.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_admin_viewer_handler_access.py
test_app_auth.py feat(proxy): add app groups with shared budgets and usage (#53232) 2026-11-21 12:50:58 -08:00
test_auth_checks.py fix(proxy): serve a deployment's litellm model only through the deployments the caller is granted 2026-11-26 03:17:39 -08:00
test_auth_checks_object_access_and_lookup.py fix(auth): report unreadable team rows as 503 and open the rust db in the spend logs parity test (#52923) 2026-11-24 19:34:37 +00:00
test_auth_exception_handler.py fix(proxy): log the prompt of a rejected responses, completions or embeddings request (#54122) 2026-11-24 17:07:48 -08:00
test_auth_hot_path_network_requests.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_auth_object_prefetch.py perf(auth): read the auth prefetch owner rows through a rust repository (#53452) 2026-11-25 08:02:02 +09:00
test_auth_utils.py feat(otel): add Mixpanel OpenTelemetry v2 preset callback (#49999) 2026-11-25 10:27:02 -08:00
test_authorization.py
test_banned_params_extra_body.py
test_candidate_model_access.py fix(proxy): serve a deployment's litellm model only through the deployments the caller is granted 2026-11-26 03:17:39 -08:00
test_cli_auth.py
test_core.py refactor(proxy): move non-auth writers out of the auth cache (#51599) 2026-11-20 17:57:38 +09:00
test_custom_auth_end_user_budget.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_customer_hierarchy_auth.py feat(proxy): opt-in response headers for app customer org and member budgets per window (#54483) 2026-11-25 13:18:53 -08:00
test_customer_member_auto_create.py fix(proxy): register new customer org aliases one at a time per worker so a burst of first requests is served (#52080) 2026-11-16 14:00:04 -08:00
test_customer_provisioning.py feat(proxy): require customer headers by gateway, team, or key (#53045) 2026-11-21 20:20:26 +00:00
test_customer_spend.py fix(proxy): enforce settled customer budgets across workers (#51568) 2026-11-13 07:33:24 -08:00
test_default_end_user_budget_simple.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_denial.py fix(auth): check a mapped JWT's end-user claim and keep the error classes of refused keys and JWTs (#52397) 2026-11-18 03:36:46 +00:00
test_fallback_budget.py refactor(router): delete router code nothing calls (#52516) 2026-11-19 06:11:10 +09:00
test_fallback_model_access.py feat(customer-portal): complete hierarchy management (#51521) 2026-11-13 17:58:34 +00:00
test_fallback_rate_limit.py feat(callbacks-parallel-request-limiter): port parallel request limiter v3 to a rust callback (#51537) 2026-11-16 22:56:38 -08:00
test_fallback_rate_limit_rust.py feat(callbacks-parallel-request-limiter): port parallel request limiter v3 to a rust callback (#51537) 2026-11-16 22:56:38 -08:00
test_impersonation.py feat(proxy)!: let every key read its own spend logs and return 403 for filters outside the caller's scope (#52449) 2026-11-19 03:14:35 +00:00
test_info_routes.py
test_jwt.py fix(proxy): accept audience and public_key_url in litellm_jwtauth (#53288) 2026-11-21 10:51:37 -08:00
test_legacy_empty_models_check.py Serialize legacy empty model boot counts (#52378) 2026-11-18 04:31:46 +00:00
test_litellm_license.py
test_login_utils.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_master_key_boot_check.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_mcp_ip_filtering.py
test_model_access_group_budgets.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_model_checks.py fix(proxy): make litellm --test pick a served model, and send the master key only to a local proxy (#53866) 2026-11-24 04:17:02 +00:00
test_model_checks_fallbacks.py
test_models_fallback_endpoint.py
test_multi_budget_windows.py feat(proxy): support budget_limits windows on internal users (#51763) 2026-11-14 07:44:35 -05:00
test_multipart_bypass_repro.py
test_network.py
test_oauth2_proxy_hook.py
test_object_permission_loading.py refactor(auth-store): shape the cached virtual key in Rust and load it through one Python path (#53325) 2026-11-21 22:06:13 +09:00
test_onboarding.py
test_organization_budget_enforcement.py
test_password_hashing.py
test_password_policy.py
test_personal_key_team_model_access.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_proxy_routes.py test(realtime): fix three unit tests left red by the GPT-Live attach routes (#53574) 2026-11-22 17:49:14 +00:00
test_rds_iam_token.py
test_resolvers_exceptions.py
test_resolvers_grants.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_resolvers_models.py
test_resolvers_seam.py
test_resolvers_store.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_route_checks.py feat(lens): add key and team tracing controls (#53191) 2026-11-23 17:59:37 +00:00
test_router_override_fallback_auth.py fix(proxy): serve a deployment's litellm model only through the deployments the caller is granted 2026-11-26 03:17:39 -08:00
test_scalar_budget_windows.py feat(db): rust repositories for user, end user and budget auth objects (#52170) 2026-11-18 22:32:05 +00:00
test_search_tool_deny_by_default.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_grants.py
test_team_member_budget.py
test_unmapped_model_budget_enforcement.py
test_user_api_key_auth.py feat(otel): add Mixpanel OpenTelemetry v2 preset callback (#49999) 2026-11-25 10:27:02 -08:00
test_user_api_key_auth_deployment_profile.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_user_api_key_auth_request_flow.py perf(proxy): read only the needed team fields from the auth cache (#53909) 2026-11-23 12:53:14 -08:00
test_vector_store_access_groups.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00