mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
[Chore-Proxy] enforce jwt auth as enterprise feature (#5770)
* enforce prometheus as enterprise feature * show correct error on prometheus metric when not enrterprise user * docs promethues metrics enforced * docs enforce JWT auth * enforce JWT auth as enterprise feature * fix merge conflicts
This commit is contained in:
parent
50cc7c0353
commit
eba76377ca
3 changed files with 12 additions and 8 deletions
|
@ -218,6 +218,12 @@ async def user_api_key_auth(
|
|||
return await handle_oauth2_proxy_request(request=request)
|
||||
|
||||
if general_settings.get("enable_jwt_auth", False) is True:
|
||||
from litellm.proxy.proxy_server import premium_user
|
||||
|
||||
if premium_user is not True:
|
||||
raise ValueError(
|
||||
f"JWT Auth is an enterprise only feature. {CommonProxyErrors.not_premium_user.value}"
|
||||
)
|
||||
is_jwt = jwt_handler.is_jwt(token=api_key)
|
||||
verbose_proxy_logger.debug("is_jwt: %s", is_jwt)
|
||||
if is_jwt:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue