From e30410f7001eaabebcce9613d43e7e5eb1f44170 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Mon, 24 Jun 2024 17:45:13 -0700 Subject: [PATCH] feat - allow user to define public routes --- litellm/proxy/auth/user_api_key_auth.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/auth/user_api_key_auth.py b/litellm/proxy/auth/user_api_key_auth.py index 3d14f53000f..f6e3a0dfeb4 100644 --- a/litellm/proxy/auth/user_api_key_auth.py +++ b/litellm/proxy/auth/user_api_key_auth.py @@ -137,7 +137,9 @@ async def user_api_key_auth( """ 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 return UserAPIKeyAuth(user_role=LitellmUserRoles.INTERNAL_USER_VIEW_ONLY)