mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-28 06:23:07 +00:00
fix(auth): let PROXY_ADMIN_VIEW_ONLY call the Usage Ask AI route
POST /usage/ai/chat is written for admins and admin viewers alike (_user_has_admin_view), but the viewer route gate only passes POSTs on the explicit allowlist, and this path was never added. Viewers got 'user not allowed to access this route'. The route only reads the daily activity aggregates that /user/daily/activity already serves them.
This commit is contained in:
parent
4496fe0ebc
commit
493c28a45c
2 changed files with 3 additions and 0 deletions
|
|
@ -957,6 +957,8 @@ class LiteLLMRoutes(enum.Enum):
|
|||
"/user/available_users",
|
||||
"/user/available_roles",
|
||||
"/user/daily/activity",
|
||||
# Usage > Ask AI: a POST that only reads daily activity aggregates.
|
||||
"/usage/ai/chat",
|
||||
"/user/daily/activity/aggregated",
|
||||
"/user/daily/activity/aggregated/keys",
|
||||
"/user/daily/activity/aggregated/search",
|
||||
|
|
|
|||
|
|
@ -350,6 +350,7 @@ def test_proxy_admin_viewer_blocked_management_writes(blocked_route):
|
|||
"/model/info",
|
||||
"/jwt/key/mapping/list",
|
||||
"/jwt/key/mapping/info",
|
||||
"/usage/ai/chat",
|
||||
],
|
||||
)
|
||||
def test_proxy_admin_viewer_allowed_management_reads(allowed_read_route):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue