mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-15 23:31:29 +00:00
fix(proxy): define credentials hint helper ahead of proxy_server imports
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
ba171d9eb4
commit
9ff0dea139
1 changed files with 12 additions and 12 deletions
|
|
@ -552,6 +552,18 @@ def _coerce_metadata_to_dict(value: Any) -> dict[str, Any] | None:
|
|||
return None
|
||||
|
||||
|
||||
def should_hide_default_credentials_hint(general_settings: Mapping[str, object]) -> bool:
|
||||
"""
|
||||
Whether login pages hide the "admin / MASTER_KEY" hint: explicit opt-in, or a
|
||||
non-empty UI_PASSWORD, which makes that hint wrong. UI_USERNAME alone keeps it.
|
||||
"""
|
||||
return (
|
||||
os.getenv("LITELLM_HIDE_DEFAULT_CREDENTIALS_HINT", "false").lower() == "true"
|
||||
or general_settings.get("hide_default_credentials_hint", False) is True
|
||||
or bool(os.getenv("UI_PASSWORD"))
|
||||
)
|
||||
|
||||
|
||||
async def pre_db_read_auth_checks(
|
||||
request: Request,
|
||||
request_data: dict,
|
||||
|
|
@ -1446,18 +1458,6 @@ def has_user_setup_sso() -> bool:
|
|||
)
|
||||
|
||||
|
||||
def should_hide_default_credentials_hint(general_settings: Mapping[str, object]) -> bool:
|
||||
"""
|
||||
Whether login pages hide the "admin / MASTER_KEY" hint: explicit opt-in, or a
|
||||
non-empty UI_PASSWORD, which makes that hint wrong. UI_USERNAME alone keeps it.
|
||||
"""
|
||||
return (
|
||||
os.getenv("LITELLM_HIDE_DEFAULT_CREDENTIALS_HINT", "false").lower() == "true"
|
||||
or general_settings.get("hide_default_credentials_hint", False) is True
|
||||
or bool(os.getenv("UI_PASSWORD"))
|
||||
)
|
||||
|
||||
|
||||
def _is_google_ready() -> bool:
|
||||
return bool(os.getenv("GOOGLE_CLIENT_ID")) and bool(os.getenv("GOOGLE_CLIENT_SECRET"))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue