litellm/litellm-proxy-extras
ryan-crabbe-berri 0d5e14fcd1 feat(proxy): auth_v2 slice 1 - virtual-key authn + casbin model RBAC behind a flag
Introduces auth_v2 as a clean-slate, flag-gated auth path (general_settings
auth_version: v2). When on, the existing auth is bypassed entirely and requests
flow through a new authenticator chain plus a casbin authorization engine.

Slice 1 scope:
- Entry point fork in user_api_key_auth; v1 untouched when the flag is off
- Authenticator chain with a virtual-key node resolving identity via the
  existing key store (reuses get_key_object; no parallel identity storage)
- casbin engine: RBAC policy rows for the control plane, role bridged from the
  key's existing user_role; per-resource-id objects supported
- Governs the model-deployment management plane only (/model/new, /model/update,
  /model/delete, /model/info); every other route is loud-open and logs a warning
  so unprotected surfaces are never silent
- Policies/groupings stored in LiteLLM_CasbinRule, loaded on cold routes with a
  short snapshot cache; a bootstrap policy keeps proxy_admin fully authorized
- Decision core (enforcer, route map, principal, authorizer, policy store) holds
  no framework imports, so it is unit-testable in isolation

Tests cover the allow/deny matrix, deny-override, domain scoping, per-id
granularity, loud-open behavior, and policy loading.

Data plane (inference-time model access) and additional resources/mechanisms are
deferred to later slices. casbin governs everything eventually via ABAC matchers
over cached attributes; this slice lays the control-plane foundation.
2026-06-04 20:19:46 -07:00
..
dist adding build 2026-03-21 22:55:04 -07:00
litellm_proxy_extras feat(proxy): auth_v2 slice 1 - virtual-key authn + casbin model RBAC behind a flag 2026-06-04 20:19:46 -07:00
tests [Fix] v2 resolver: swallow non-connection DB errors; wrap resolve failures 2026-04-21 15:53:07 -07:00
build_and_publish.md build: migrate packaging, CI, and Docker from Poetry to uv (#25007) 2026-04-09 11:46:23 -07:00
LICENSE install prisma migration files - connects litellm proxy to litellm's prisma migration files (#9637) 2025-03-29 15:27:09 -07:00
migration_runbook.md [Infra] Add freshness and destructive guards to migration workflow 2026-04-21 12:00:23 -07:00
pyproject.toml chore(ci): bump versions (#28287) 2026-05-19 15:10:37 -07:00
README.md build: migrate packaging, CI, and Docker from Poetry to uv (#25007) 2026-04-09 11:46:23 -07:00

Additional files for the proxy. Reduces the size of the main litellm package.

Currently, only stores the migration.sql files for litellm-proxy.

To install, run:

uv add litellm-proxy-extras

OR

uv tool install 'litellm[proxy]' # installs litellm-proxy-extras and other proxy dependencies

To use the migrations, run:

litellm --use_prisma_migrate