mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
[BETA] Support OIDC role
based access to proxy (#8260)
* feat(proxy/_types.py): add new jwt field params allows users + services to auth into proxy * feat(handle_jwt.py): allow team role proxy access allows proxy admin to set allowed team roles * fix(proxy/_types.py): add 'routes' to role based permissions allow proxy admin to restrict what routes a team can access easily * feat(handle_jwt.py): support more flexible role based route access v2 on role based 'allowed_routes' * test(test_jwt.py): add unit test for rbac for proxy routes * feat(handle_jwt.py): ensure cost tracking always works for any jwt request with `enforce_rbac=True` * docs(token_auth.md): add documentation on controlling model access via OIDC Roles * test: increase time delay before retrying * test: handle model overloaded for test
This commit is contained in:
parent
1d030ebed7
commit
015b822099
10 changed files with 413 additions and 143 deletions
|
@ -2093,6 +2093,14 @@ class ProxyConfig:
|
|||
health_check_interval = general_settings.get("health_check_interval", 300)
|
||||
health_check_details = general_settings.get("health_check_details", True)
|
||||
|
||||
### RBAC ###
|
||||
rbac_role_permissions = general_settings.get("role_permissions", None)
|
||||
if rbac_role_permissions is not None:
|
||||
general_settings["role_permissions"] = [ # validate role permissions
|
||||
RoleBasedPermissions(**role_permission)
|
||||
for role_permission in rbac_role_permissions
|
||||
]
|
||||
|
||||
## check if user has set a premium feature in general_settings
|
||||
if (
|
||||
general_settings.get("enforced_params") is not None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue