mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-13 23:11:40 +00:00
test(router): pin unscoped exact credential lookup
This commit is contained in:
parent
413cb8076c
commit
952191bd58
2 changed files with 10 additions and 6 deletions
|
|
@ -9558,12 +9558,12 @@ class Router:
|
|||
|
||||
Args:
|
||||
model_id: Model ID or model name from model_list (e.g., "gpt-4o-litellm")
|
||||
team_id: Optional team id of the caller. When set, team-scoped
|
||||
deployments (indexed by team public model name, including team
|
||||
wildcard models like "openai/*") are also considered. Name and
|
||||
wildcard lookups never resolve a deployment owned by a
|
||||
different team, so shared model names can't leak another
|
||||
team's credentials.
|
||||
team_id: Optional team id of the caller. When set, team-scoped
|
||||
deployments (indexed by team public model name, including team
|
||||
wildcard models like "openai/*") are also considered. Exact-ID,
|
||||
name, and wildcard lookups never resolve a deployment owned by
|
||||
a different team. Callers without a team id retain legacy
|
||||
exact-ID behavior for internal credential-resolution flows.
|
||||
|
||||
Returns:
|
||||
Dictionary containing api_key, api_base, custom_llm_provider, etc.
|
||||
|
|
|
|||
|
|
@ -4801,6 +4801,10 @@ def test_get_deployment_credentials_with_provider_rejects_other_team_exact_id():
|
|||
assert owner_credentials is not None
|
||||
assert owner_credentials["api_key"] == "team-b-key"
|
||||
|
||||
unscoped_credentials = router.get_deployment_credentials_with_provider(model_id="team-b-deployment")
|
||||
assert unscoped_credentials is not None
|
||||
assert unscoped_credentials["api_key"] == "team-b-key"
|
||||
|
||||
assert (
|
||||
router.get_deployment_credentials_with_provider(
|
||||
model_id="team-b-deployment", team_id="team-a"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue