From 1a6d7ff1d36682cf6792f2a3e6bf1e6da96e9410 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Wed, 29 Jul 2026 11:29:38 -0700 Subject: [PATCH] test(proxy): lock team wildcard deployment resolution for provider-scoped credentials --- .../test_files_endpoint.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py b/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py index 98eab88d15d..00dc6f8f556 100644 --- a/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py +++ b/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py @@ -2778,3 +2778,37 @@ def test_provider_scoped_credentials_never_use_other_teams_deployment(): assert credentials is not None assert credentials["vertex_project"] == "shared-project" + + +def test_provider_scoped_credentials_resolve_team_wildcard_deployment(): + from litellm.proxy.openai_files_endpoints.common_utils import ( + resolve_provider_scoped_credentials, + ) + + router = Router( + model_list=[ + { + "model_name": "team-vertex-wildcard", + "litellm_params": { + "model": "vertex_ai/*", + "vertex_project": "team-wildcard-project", + }, + "model_info": { + "id": "team-wildcard-dep", + "team_id": "team-caller", + "team_public_model_name": "vertex_ai/*", + }, + } + ] + ) + + credentials = resolve_provider_scoped_credentials( + llm_router=router, + custom_llm_provider="vertex_ai", + user_api_key_dict=UserAPIKeyAuth( + api_key="sk-test", team_id="team-caller", team_models=["vertex_ai/*"] + ), + ) + + assert credentials is not None + assert credentials["vertex_project"] == "team-wildcard-project"