Add Key info endpoint object permission data#20407
Merged
Sameerlite merged 2 commits intomainfrom Feb 4, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile OverviewGreptile SummaryEnhanced the Key Changes:
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| litellm/proxy/management_endpoints/key_management_endpoints.py | Added object_permission data attachment to /key/info endpoint response by calling existing helper function |
| tests/test_litellm/proxy/management_endpoints/test_key_management_endpoints.py | Added comprehensive test verifying object_permission is correctly returned in /key/info response |
Sequence Diagram
sequenceDiagram
participant Client
participant InfoKeyFn as info_key_fn
participant Prisma as prisma_client
participant AttachHelper as attach_object_permission_to_dict
Client->>InfoKeyFn: GET /key/info with key param
InfoKeyFn->>Prisma: find_unique(token, include litellm_budget_table)
Prisma-->>InfoKeyFn: key_info with object_permission_id
InfoKeyFn->>InfoKeyFn: Convert to dict and remove token
InfoKeyFn->>AttachHelper: Pass key_info dict and prisma_client
AttachHelper->>AttachHelper: Check if object_permission_id exists
AttachHelper->>Prisma: find_unique(object_permission_id)
Prisma-->>AttachHelper: object_permission record
AttachHelper->>AttachHelper: Convert to dict and attach
AttachHelper-->>InfoKeyFn: key_info with object_permission field
InfoKeyFn-->>Client: Response with key info including object_permission
michelligabriele
added a commit
to michelligabriele/litellm
that referenced
this pull request
Feb 6, 2026
…tibility Keycloak (and similar OIDC providers) include role claims in the JWT access token but not in the UserInfo endpoint response. Previously, roles were only extracted from UserInfo, causing all SSO users to default to internal_user_view_only regardless of their actual role. Changes: - Extract user roles from JWT access token in process_sso_jwt_access_token() when UserInfo doesn't provide them (tries role_mappings first, then GENERIC_USER_ROLE_ATTRIBUTE) - Handle list-type role values in get_litellm_user_role() since Keycloak returns roles as arrays (e.g. ["proxy_admin"] instead of "proxy_admin") - Add 9 new unit tests covering role extraction and list handling - Update 3 existing tests for new JWT decode behavior Closes BerriAI#20407
6 tasks
ishaan-jaff
pushed a commit
that referenced
this pull request
Feb 7, 2026
…tibility (#20591) Keycloak (and similar OIDC providers) include role claims in the JWT access token but not in the UserInfo endpoint response. Previously, roles were only extracted from UserInfo, causing all SSO users to default to internal_user_view_only regardless of their actual role. Changes: - Extract user roles from JWT access token in process_sso_jwt_access_token() when UserInfo doesn't provide them (tries role_mappings first, then GENERIC_USER_ROLE_ATTRIBUTE) - Handle list-type role values in get_litellm_user_role() since Keycloak returns roles as arrays (e.g. ["proxy_admin"] instead of "proxy_admin") - Add 9 new unit tests covering role extraction and list handling - Update 3 existing tests for new JWT decode behavior Closes #20407
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relevant issues
Fixed #20323
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unitCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test
Changes