feat - allow user to define public routes

This commit is contained in:
Ishaan Jaff 2024-06-24 17:45:13 -07:00
parent 123477b55a
commit 2f90759db5

View file

@ -137,7 +137,9 @@ async def user_api_key_auth(
""" """
route: str = request.url.path route: str = request.url.path
if route in LiteLLMRoutes.public_routes.value: if route in LiteLLMRoutes.public_routes.value or route in general_settings.get(
"public_routes", []
):
# check if public endpoint # check if public endpoint
return UserAPIKeyAuth(user_role=LitellmUserRoles.INTERNAL_USER_VIEW_ONLY) return UserAPIKeyAuth(user_role=LitellmUserRoles.INTERNAL_USER_VIEW_ONLY)