INNER CODE UNIT · Python
_mask_env_value
CaddyGlow/ccproxy-api · ccproxy/cli/main.py:393
def _mask_env_value(key: str, value: str) -> str:
"""Mask sensitive values based on common substrings in the key."""
lowered = key.lower()
sensitive_markers = [
"token",
"secret",
"password",
"passwd",
"key",
"api_key",
"bearer",
"auth",
"credential",
]
if any(m in lowered for m in sensitive_markers):
if not value:
return value
# keep only last 4 chars for minimal debugging