fix: address review feedback on master key check

- Downgrade ValueError to critical log (no hard failure on startup)
- Change length threshold from 16 to 32 to match warning message
- Fix typo: reccomended -> recommended
- Remove unnecessary f-string prefix
This commit is contained in:
Ryan Crabbe 2026-03-25 12:26:05 -07:00
parent 5e42d4b9d8
commit db456b33d0

View file

@ -3095,13 +3095,13 @@ class ProxyConfig:
if master_key is not None and isinstance(master_key, str):
if master_key == "sk-1234":
raise ValueError(
f"LITELLM_MASTER_KEY is set to the default master-key granting proxy admin access, please change it to something stronger"
)
if len(master_key) < 16:
verbose_proxy_logger.critical(
"LITELLM_MASTER_KEY is set to the default master key granting proxy admin access, please change it to something stronger"
)
if len(master_key) < 32:
verbose_proxy_logger.warning(
"A key of at least 32 characters is reccomended for production"
)
"A key of at least 32 characters is recommended for production"
)
### USER API KEY CACHE IN-MEMORY TTL ###
user_api_key_cache_ttl = general_settings.get(