From 0c2ae7a90e6dff7efffc5069e977ea9ad911a00b Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Tue, 9 Apr 2024 07:23:13 -0700 Subject: [PATCH] fix(proxy_server.py): allow jwt public key ttl to be passed as os.environ --- litellm/proxy/_new_secret_config.yaml | 2 +- litellm/proxy/proxy_server.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/_new_secret_config.yaml b/litellm/proxy/_new_secret_config.yaml index f24b9f0ae..037d19052 100644 --- a/litellm/proxy/_new_secret_config.yaml +++ b/litellm/proxy/_new_secret_config.yaml @@ -42,4 +42,4 @@ general_settings: alerting: ["slack"] litellm_jwtauth: admin_jwt_scope: "litellm_proxy_admin" - public_key_ttl: 600 \ No newline at end of file + public_key_ttl: os.environ/LITELLM_PUBLIC_KEY_TTL \ No newline at end of file diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index f902a856d..947c93658 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -3000,6 +3000,9 @@ async def startup_event(): ## JWT AUTH ## if general_settings.get("litellm_jwtauth", None) is not None: + for k, v in general_settings["litellm_jwtauth"].items(): + if isinstance(v, str) and v.startswith("os.environ/"): + general_settings["litellm_jwtauth"][k] = litellm.get_secret(v) litellm_jwtauth = LiteLLM_JWTAuth(**general_settings["litellm_jwtauth"]) else: litellm_jwtauth = LiteLLM_JWTAuth()