mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
add helper to check route_in_additonal_public_routes
This commit is contained in:
parent
11117665e1
commit
5e1403cd0a
2 changed files with 46 additions and 2 deletions
|
@ -56,6 +56,7 @@ from litellm.proxy.auth.auth_checks import (
|
|||
get_user_object,
|
||||
log_to_opentelemetry,
|
||||
)
|
||||
from litellm.proxy.auth.auth_utils import route_in_additonal_public_routes
|
||||
from litellm.proxy.common_utils.http_parsing_utils import _read_request_body
|
||||
from litellm.proxy.utils import _to_ns
|
||||
|
||||
|
@ -137,8 +138,9 @@ async def user_api_key_auth(
|
|||
"""
|
||||
route: str = request.url.path
|
||||
|
||||
if route in LiteLLMRoutes.public_routes.value or route in general_settings.get(
|
||||
"public_routes", []
|
||||
if (
|
||||
route in LiteLLMRoutes.public_routes.value
|
||||
or route_in_additonal_public_routes(current_route=route)
|
||||
):
|
||||
# check if public endpoint
|
||||
return UserAPIKeyAuth(user_role=LitellmUserRoles.INTERNAL_USER_VIEW_ONLY)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue