-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
feat(teams): resolve access group resources in team endpoints #25027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ryan-crabbe-berri
merged 8 commits into
litellm_ryan-march-31
from
litellm_add-access-group-to-model
Apr 4, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f626587
feat(teams): resolve access group models/MCPs/agents in team endpoints
ryan-crabbe-berri bbe708b
perf(teams): single-pass access group resolution + asyncio.gather in …
ryan-crabbe-berri f0bd334
fix: lazy import get_access_object to break cyclic import + short-cir…
ryan-crabbe-berri 38f6c94
fix(tests): correct mock targets in TestResolveAccessGroupResources
ryan-crabbe-berri ea32cb5
fix: use direct attribute access with or [] fallback in _resolve_acce…
ryan-crabbe-berri 3bdd042
fix(ui): remove model source legend from team detail view
ryan-crabbe-berri bb03a11
fix(ui): add missing access_group fields to TeamData.team_info type
ryan-crabbe-berri 93369bf
perf(teams): batch-fetch access groups in single DB query
ryan-crabbe-berri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Check notice
Code scanning / CodeQL
Cyclic import Note
Copilot Autofix
AI 14 days ago
General approach: Break the cycle by removing the import from
team_endpointstoproxy_serverwhile preserving behavior. Instead of pullingprisma_client,proxy_logging_obj, anduser_api_key_cachefromproxy_server, use dependencies or utilities that are already available in this module, or re-acquire what is needed via other, non-cyclic means.Best concrete fix here:
resolve_access_group_inherited_resourcesonly uses those three objects to callget_access_object, which is already imported fromlitellm.proxy.auth.auth_checks. Ifget_access_objectcan operate withNoneor omittedprisma_client/ cache / logging arguments, we can simply stop importing them fromproxy_serverand callget_access_objectwithout those keyword arguments. That removes the cycle without changing higher-level functionality, and keeps the function focused on resolving resources via the existing auth helper.So, in
litellm/proxy/management_endpoints/team_endpoints.py, withinresolve_access_group_inherited_resources:_user_api_key_cacheNoneguard, since that variable will no longer exist.get_access_objectcall to only passaccess_group_id=ag_id(noprisma_client,user_api_key_cache, orproxy_logging_objkeyword arguments).No new methods or imports are needed; we only rely on the already-imported
get_access_objectandverbose_proxy_logger.