litellm/tests/proxy_behavior/management
milan-berri d84499e0f2
fix(team): reserve team budget raises for proxy admins on /team/update (#30030)
The caller's PERSONAL max_budget was the wrong yardstick for /team/update: a
team's spend ceiling has nothing to do with the admin's own key budget. That
comparison was an unintended side effect of reusing _check_user_team_limits()
(which exists for the /team/new path) and broke the UI, which re-sends the
unchanged budget on every save.

New behavior on /team/update for standalone teams:
- A team admin (already authorized via _verify_team_access) may freely KEEP or
  LOWER the team budget, and change models/tpm/rpm, without being gated by their
  personal limits.
- GROWING a team's spend ceiling is a budget-authority action reserved for proxy
  admins -> 403 for team admins. "Growing" covers both raising max_budget above
  the team's current finite value and removing the cap entirely (max_budget=null,
  detected via model_fields_set so an explicit null is distinguished from an
  omitted field). For a team that currently has no cap, setting a finite value is
  a restriction and is allowed.
- Org-scoped teams remain governed by _check_org_team_limits() (capped by the
  org budget).

Also reverts the #29525 existing_team_max_budget workaround in
_check_user_team_limits() back to the create-only form; /team/new still enforces
the creator's personal caps.

docs(access_control): resolve the contradiction in the team-admin section —
team admins can keep/lower the budget and manage rate limits/models, but cannot
raise the team budget (proxy-admin only).

tests: unit + behavior coverage for raise-blocked, cap-removal-blocked (team
admin), raise/removal allowed (proxy admin), uncapped-team restriction allowed,
keep/lower/resend allowed, and unchanged create-path guards.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 09:19:15 -07:00
..
__init__.py
actors.py
conftest.py test(proxy): phase-4 payload behavior pinning for tier-2/3 key + team management endpoints (#28681) 2026-05-23 12:16:29 -07:00
test_f7_coverage_closeout.py test(proxy): phase-4 payload behavior pinning for tier-2/3 key + team management endpoints (#28681) 2026-05-23 12:16:29 -07:00
test_f7_key_coverage_push.py test(proxy): phase-4 payload behavior pinning for tier-2/3 key + team management endpoints (#28681) 2026-05-23 12:16:29 -07:00
test_key_aliases.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_key_block_unblock.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_key_budget_limits.py test(proxy): phase-4 payload behavior pinning for tier-2/3 key + team management endpoints (#28681) 2026-05-23 12:16:29 -07:00
test_key_bulk_update.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_key_delete.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_key_generate.py
test_key_health.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_key_info_v2.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_key_info.py
test_key_list.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_key_regenerate.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_key_reset_spend.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_key_service_account_generate.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_key_team_change.py test(proxy): phase-4 payload behavior pinning for tier-2/3 key + team management endpoints (#28681) 2026-05-23 12:16:29 -07:00
test_key_update.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_no_management_imports.py
test_route_coverage.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_scratch_teardown.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_smoke.py
test_team_available.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_team_block_unblock.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_team_budget_limits.py fix(team): reserve team budget raises for proxy admins on /team/update (#30030) 2026-06-09 09:19:15 -07:00
test_team_bulk_member_add.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_team_daily_activity.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_team_delete.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_team_filter_ui.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_team_info.py test(proxy): phase-4 payload behavior pinning for tier-2/3 key + team management endpoints (#28681) 2026-05-23 12:16:29 -07:00
test_team_key_bulk_update.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_team_list_v2.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_team_list.py
test_team_member_add.py
test_team_member_delete.py
test_team_member_info_validation.py test(proxy): phase-4 payload behavior pinning for tier-2/3 key + team management endpoints (#28681) 2026-05-23 12:16:29 -07:00
test_team_member_me.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_team_member_update.py
test_team_model.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_team_new.py
test_team_permissions_bulk_update.py test(proxy): phase-4 payload behavior pinning for tier-2/3 key + team management endpoints (#28681) 2026-05-23 12:16:29 -07:00
test_team_permissions.py test(proxy): behavior-pinning matrix for tier-2/3 key + team management endpoints (#28620) 2026-05-22 11:24:41 -07:00
test_team_update.py test(proxy): phase-4 payload behavior pinning for tier-2/3 key + team management endpoints (#28681) 2026-05-23 12:16:29 -07:00
test_world_seed.py