mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix re-add virtual key auth checks on vertex ai pass thru endpoints (#5827)
This commit is contained in:
parent
e4f309d0e7
commit
16b0d38c11
3 changed files with 49 additions and 3 deletions
|
@ -354,9 +354,26 @@ def is_pass_through_provider_route(route: str) -> bool:
|
|||
def should_run_auth_on_pass_through_provider_route(route: str) -> bool:
|
||||
"""
|
||||
Use this to decide if the rest of the LiteLLM Virtual Key auth checks should run on /vertex-ai/{endpoint} routes
|
||||
Use this to decide if the rest of the LiteLLM Virtual Key auth checks should run on provider pass through routes
|
||||
ex /vertex-ai/{endpoint} routes
|
||||
Run virtual key auth if the following is try:
|
||||
- User is premium_user
|
||||
- User has enabled litellm_setting.use_client_credentials_pass_through_routes
|
||||
"""
|
||||
# by default we do not run virtual key auth checks on /vertex-ai/{endpoint} routes
|
||||
return False
|
||||
from litellm.proxy.proxy_server import general_settings, premium_user
|
||||
|
||||
if premium_user is not True:
|
||||
return False
|
||||
|
||||
# premium use has opted into using client credentials
|
||||
if (
|
||||
general_settings.get("use_client_credentials_pass_through_routes", False)
|
||||
is True
|
||||
):
|
||||
return False
|
||||
|
||||
# only enabled for LiteLLM Enterprise
|
||||
return True
|
||||
|
||||
|
||||
def _has_user_setup_sso():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue