mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-13 23:11:40 +00:00
style(proxy): drop added comments and docstrings per repo convention
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
8390e6d966
commit
2c1b566e12
2 changed files with 0 additions and 23 deletions
|
|
@ -6443,10 +6443,6 @@ async def _get_team_access_group_ids(
|
|||
user_api_key_cache: Optional["UserApiKeyCache"],
|
||||
proxy_logging_obj: Optional["ProxyLogging"],
|
||||
) -> tuple[str, ...]:
|
||||
"""
|
||||
Access group ids assigned to the caller's team, using the already resolved
|
||||
team object when available and otherwise looking the team up (cache backed).
|
||||
"""
|
||||
from litellm.proxy.auth.auth_checks import get_team_object
|
||||
|
||||
if team_object is not None:
|
||||
|
|
@ -6480,14 +6476,6 @@ async def _get_models_from_unified_access_groups(
|
|||
user_api_key_cache: Optional["UserApiKeyCache"],
|
||||
proxy_logging_obj: Optional["ProxyLogging"],
|
||||
) -> tuple[str, ...]:
|
||||
"""
|
||||
Model names granted through unified access groups (LiteLLM_AccessGroupTable)
|
||||
assigned to the caller's team or key.
|
||||
|
||||
Mirrors the auth-time resolution in can_team_access_model and
|
||||
_key_access_group_grants_model, so a model the caller can successfully call
|
||||
is not missing from the listing.
|
||||
"""
|
||||
from litellm.proxy.auth.auth_checks import (
|
||||
_get_models_from_access_groups,
|
||||
get_authorized_resources_from_key_access_groups,
|
||||
|
|
|
|||
|
|
@ -418,7 +418,6 @@ def _access_group_key(team_id="team-1", team_models=None, key_access_group_ids=N
|
|||
|
||||
|
||||
def _patch_team_access_groups(monkeypatch, access_group_ids, group_models):
|
||||
"""Stub the unified access group DB boundary used by the listing."""
|
||||
team_lookups = []
|
||||
resolved_for = []
|
||||
|
||||
|
|
@ -446,12 +445,6 @@ def _patch_team_access_groups(monkeypatch, access_group_ids, group_models):
|
|||
async def test_get_available_models_for_user_includes_team_access_group_models(
|
||||
monkeypatch,
|
||||
):
|
||||
"""
|
||||
Regression: a team restricted to `model-a` that is assigned an access group
|
||||
granting `model-b` must see `model-b` in /v1/models. Before the fix the
|
||||
listing only consulted team.models, so `model-b` was missing even though the
|
||||
team key could call it.
|
||||
"""
|
||||
_team_lookups, resolved_for = _patch_team_access_groups(
|
||||
monkeypatch, access_group_ids=["ag-1"], group_models=["model-b"]
|
||||
)
|
||||
|
|
@ -480,7 +473,6 @@ async def test_get_available_models_for_user_includes_team_access_group_models(
|
|||
async def test_get_available_models_for_user_access_group_models_are_deduped(
|
||||
monkeypatch,
|
||||
):
|
||||
"""A model granted both directly and via an access group is listed once."""
|
||||
_patch_team_access_groups(
|
||||
monkeypatch, access_group_ids=["ag-1"], group_models=["model-a", "model-b"]
|
||||
)
|
||||
|
|
@ -502,7 +494,6 @@ async def test_get_available_models_for_user_access_group_models_are_deduped(
|
|||
async def test_get_available_models_for_user_includes_key_access_group_models(
|
||||
monkeypatch,
|
||||
):
|
||||
"""Models from an access group that authorizes the key are also listed."""
|
||||
_patch_team_access_groups(
|
||||
monkeypatch, access_group_ids=[], group_models=[]
|
||||
)
|
||||
|
|
@ -533,7 +524,6 @@ async def test_get_available_models_for_user_includes_key_access_group_models(
|
|||
async def test_get_available_models_for_user_without_access_groups_is_unchanged(
|
||||
monkeypatch,
|
||||
):
|
||||
"""A team with no access groups still lists exactly its own models."""
|
||||
_patch_team_access_groups(
|
||||
monkeypatch, access_group_ids=[], group_models=["should-not-appear"]
|
||||
)
|
||||
|
|
@ -555,7 +545,6 @@ async def test_get_available_models_for_user_without_access_groups_is_unchanged(
|
|||
async def test_get_available_models_for_user_only_model_access_groups_skips_expansion(
|
||||
monkeypatch,
|
||||
):
|
||||
"""only_model_access_groups returns router access group names, not access group members."""
|
||||
_patch_team_access_groups(
|
||||
monkeypatch, access_group_ids=["ag-1"], group_models=["model-b"]
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue