mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-22 00:31:44 +00:00
Closes the hierarchy-budget gap: team, organization, and global caps live in v1's common_checks (not the pre-call hooks), which auth_v2 does not run, so they were unenforced under v2. enforce_hierarchy_budgets calls the exact same functions v1 uses - _team_max_budget_check, _organization_max_budget_check, and get_global_proxy_spend + _global_proxy_budget_check - so there is one budget implementation with two callers (true single authority), with the correct spend-counter conventions and no edit to v1's path. Wired into the inference branch for all login types; a breach surfaces as the same 429 ProxyException v1 raises. Verified in-process: a team over budget is blocked (BudgetExceededError), under budget is allowed, and a teamless identity is a no-op. Real-counter accuracy across pods remains a live check (see INTEGRATION.md). |
||
|---|---|---|
| .. | ||
| v2 | ||
| test_admin_viewer_handler_access.py | ||
| test_auth_checks.py | ||
| test_auth_exception_handler.py | ||
| test_auth_hot_path_network_requests.py | ||
| test_auth_utils.py | ||
| test_banned_params_extra_body.py | ||
| test_cli_auth.py | ||
| test_custom_auth_end_user_budget.py | ||
| test_handle_jwt.py | ||
| test_info_routes.py | ||
| test_litellm_license.py | ||
| test_login_utils.py | ||
| test_mcp_ip_filtering.py | ||
| test_model_checks.py | ||
| test_model_checks_fallbacks.py | ||
| test_multi_budget_windows.py | ||
| test_oauth2_proxy_hook.py | ||
| test_object_permission_loading.py | ||
| test_onboarding.py | ||
| test_organization_budget_enforcement.py | ||
| test_password_hashing.py | ||
| test_route_checks.py | ||
| test_router_override_fallback_auth.py | ||
| test_team_member_budget.py | ||
| test_unmapped_model_budget_enforcement.py | ||
| test_user_api_key_auth.py | ||