litellm/litellm/proxy/auth
Yuneng Jiang 368342cdde
refactor(auth): resolve PATCH team org-context from the route template
Replace the request.path_params read (and its defensive getattr guard) with
the route template. A real Starlette request always exposes path_params, but
common_checks runs on lightweight request doubles that don't, so reading it
directly forced a getattr workaround that only existed to tolerate those
doubles.

Instead, match the route template (/team/{team_id}) to identify the RESTful
update route and take the team id from the last path segment. This drops the
path_params dependency entirely, and because the template distinguishes the
PATCH route from its single-segment siblings (/team/new, /team/list, ...), it
also avoids a spurious team lookup those routes would otherwise trigger if we
matched the resolved path shape alone.
2026-07-11 11:24:41 -07:00
..
resolvers style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
auth_checks.py refactor(auth): resolve PATCH team org-context from the route template 2026-07-11 11:24:41 -07:00
auth_checks_organization.py refactor(auth): resolve PATCH team org-context from the route template 2026-07-11 11:24:41 -07:00
auth_exception_handler.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
auth_method.py feat(auth): resolve caller identity once into a Principal at the auth seam (#30887) 2026-06-20 18:49:41 -07:00
auth_utils.py feat(rate_limit): support per-tag rpm limiting on a single key (#31502) 2026-07-08 09:43:47 +03:00
budget_throttle.py feat(budget): throttle keys after spend limit instead of revoking access (#31300) 2026-07-07 09:41:01 -07:00
handle_jwt.py feat(jwt): fall back to DB team memberships when JWT has no team claims (#31356) 2026-07-06 17:17:10 -07:00
ip_address_utils.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
litellm_license.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
login_utils.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
model_checks.py revert: undo teamless all-team-models denial from #32022 and #29746 (#32032) 2026-07-03 18:56:07 -07:00
network.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
oauth2_check.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
oauth2_proxy_hook.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
public_key.pem fix: remove leading space from license public_key.pem (#25339) 2026-04-08 21:30:38 -07:00
rds_iam_token.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
roles.py feat(auth): resolve caller identity once into a Principal at the auth seam (#30887) 2026-06-20 18:49:41 -07:00
route_checks.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
trusted_proxy_utils.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
user_api_key_auth.py feat(budget): throttle keys after spend limit instead of revoking access (#31300) 2026-07-07 09:41:01 -07:00