mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +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
9fff5f3da8
commit
707d654a85
3 changed files with 12 additions and 8 deletions
|
@ -7,11 +7,15 @@ Use JWT's to auth admins / projects into the proxy.
|
||||||
|
|
||||||
:::info
|
:::info
|
||||||
|
|
||||||
This is a new feature, and subject to changes based on feedback.
|
✨ JWT-based Auth is on LiteLLM Enterprise starting at $250/mo
|
||||||
|
|
||||||
|
[Enterprise Pricing](https://www.litellm.ai/#pricing)
|
||||||
|
|
||||||
|
[Contact us here to get a free trial](https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat)
|
||||||
|
|
||||||
*UPDATE*: This will be moving to the [enterprise tier](./enterprise.md), once it's out of beta (~by end of April).
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Step 1. Setup Proxy
|
### Step 1. Setup Proxy
|
||||||
|
|
|
@ -218,6 +218,12 @@ async def user_api_key_auth(
|
||||||
return await handle_oauth2_proxy_request(request=request)
|
return await handle_oauth2_proxy_request(request=request)
|
||||||
|
|
||||||
if general_settings.get("enable_jwt_auth", False) is True:
|
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)
|
is_jwt = jwt_handler.is_jwt(token=api_key)
|
||||||
verbose_proxy_logger.debug("is_jwt: %s", is_jwt)
|
verbose_proxy_logger.debug("is_jwt: %s", is_jwt)
|
||||||
if is_jwt:
|
if is_jwt:
|
||||||
|
|
|
@ -6,9 +6,3 @@ model_list:
|
||||||
api_base: https://exampleopenaiendpoint-production.up.railway.app
|
api_base: https://exampleopenaiendpoint-production.up.railway.app
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
litellm_settings:
|
|
||||||
success_callback: ["gcs_bucket"]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue