diff --git a/litellm/proxy/_lazy_openapi_snapshot.json b/litellm/proxy/_lazy_openapi_snapshot.json index 4d5cdcc8003..b6922719924 100644 --- a/litellm/proxy/_lazy_openapi_snapshot.json +++ b/litellm/proxy/_lazy_openapi_snapshot.json @@ -19946,6 +19946,22 @@ ], "title": "Resource" } + }, + { + "in": "query", + "name": "team", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Team" + } } ], "responses": { @@ -20636,6 +20652,22 @@ ], "title": "Resource" } + }, + { + "in": "query", + "name": "team", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Team" + } } ], "responses": { diff --git a/litellm/proxy/client/cli/commands/auth.py b/litellm/proxy/client/cli/commands/auth.py index 26214f7ce5e..4d2df54dbc6 100644 --- a/litellm/proxy/client/cli/commands/auth.py +++ b/litellm/proxy/client/cli/commands/auth.py @@ -621,8 +621,7 @@ def match_requested_team(teams: Sequence[CliTeam], requested_team: str | None) - ( team_id for team in teams - if (team_id := team.get("team_id")) is not None - and requested_team in (team_id, team.get("team_alias")) + if (team_id := team.get("team_id")) is not None and requested_team in (team_id, team.get("team_alias")) ), None, ) diff --git a/tests/test_litellm/proxy/auth/test_cli_auth.py b/tests/test_litellm/proxy/auth/test_cli_auth.py index 5cde5522376..ade4c48f554 100644 --- a/tests/test_litellm/proxy/auth/test_cli_auth.py +++ b/tests/test_litellm/proxy/auth/test_cli_auth.py @@ -276,6 +276,7 @@ async def test_poll_for_authentication_team_selection_success( {"team_id": "1", "team_alias": None}, {"team_id": "2", "team_alias": None}, ], + requested_team=None, ) click_mock.assert_not_called() @@ -310,6 +311,7 @@ async def test_poll_for_authentication_team_selection_cancelled( key_id="key-123", poll_secret="poll-secret", teams=[{"team_id": "team-1", "team_alias": None}], + requested_team=None, ) click_mock.assert_called_once() assert "Team selection cancelled" in click_mock.call_args[0][0] diff --git a/ui/litellm-dashboard/src/lib/http/schema.d.ts b/ui/litellm-dashboard/src/lib/http/schema.d.ts index adbdb2f46d9..bd18e399fcf 100644 --- a/ui/litellm-dashboard/src/lib/http/schema.d.ts +++ b/ui/litellm-dashboard/src/lib/http/schema.d.ts @@ -41572,6 +41572,7 @@ export interface operations { response_type?: string | null; scope?: string | null; resource?: string | null; + team?: string | null; }; header?: never; path?: never; @@ -68967,6 +68968,7 @@ export interface operations { response_type?: string | null; scope?: string | null; resource?: string | null; + team?: string | null; }; header?: never; path: {