mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-13 23:11:40 +00:00
docs(proxy): sync auth_v2 README with the plain-predicate data plane
This commit is contained in:
parent
940791576d
commit
119732227d
1 changed files with 17 additions and 13 deletions
|
|
@ -1,7 +1,8 @@
|
|||
# auth_v2
|
||||
|
||||
A clean-slate authentication and authorization path for the proxy, built on
|
||||
industry-standard libraries (authlib for JWT/OAuth2, casbin for RBAC/ABAC). It
|
||||
industry-standard libraries (authlib for JWT/OAuth2, casbin for control-plane
|
||||
RBAC). It
|
||||
runs in parallel with the existing auth behind a flag; when on, the existing
|
||||
auth is bypassed entirely.
|
||||
|
||||
|
|
@ -26,21 +27,24 @@ Authentication is a chain dispatched by credential shape:
|
|||
- JWT (3-part bearer) -> authlib: JWKS fetch/cache, signature + exp/iss/aud
|
||||
- opaque token -> authlib RFC 7662 introspection (when configured)
|
||||
|
||||
Authorization is a single casbin engine governing both planes:
|
||||
Authorization splits by plane:
|
||||
|
||||
- control plane (management routes): RBAC policy rows over resources
|
||||
`model`, `team`, `key`, `user`, `organization`, `policy`, with actions
|
||||
`read` / `write` / `delete` / `manage`. Supports per-resource ids, resource
|
||||
groups (casbin `g2`, mapping to access groups), and roles that are either
|
||||
global or scoped to a domain (casbin `g3`, e.g. "admin within team:eng").
|
||||
- control plane (management routes): a casbin engine with RBAC policy rows over
|
||||
resources `model`, `team`, `key`, `user`, `organization`, `policy`, with
|
||||
actions `read` / `write` / `delete` / `manage`. Supports per-resource ids,
|
||||
resource groups (casbin `g2`, mapping to access groups), and roles that are
|
||||
either global or scoped to a domain (casbin `g3`, e.g. "admin within
|
||||
team:eng").
|
||||
- data plane (inference: chat/completions, completions, embeddings, responses):
|
||||
casbin ABAC over the principal's allowed-model attribute, read from the
|
||||
already-loaded key. Empty list / `*` / `all-proxy-models` are unrestricted,
|
||||
matching existing key semantics.
|
||||
a plain membership/pattern predicate over the principal's allowed-model list,
|
||||
read from the already-loaded key. It is not a policy engine: on the hot path a
|
||||
casbin evaluation of a list check is pure overhead. Exact names and wildcard
|
||||
patterns (`bedrock/*`, `openai/*`, v1 semantics) match; empty list / `*` /
|
||||
`all-proxy-models` are unrestricted, matching existing key semantics.
|
||||
|
||||
Policies live in `LiteLLM_CasbinRule`, loaded on cold routes with a short TTL
|
||||
cache; the inference path reads no policy store. A bootstrap policy keeps
|
||||
`proxy_admin` fully authorized.
|
||||
Control-plane policies live in `LiteLLM_CasbinRule`, loaded on cold routes with a
|
||||
short TTL cache; the inference path reads no policy store. A bootstrap policy
|
||||
keeps `proxy_admin` fully authorized.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue