redact ASYNC_DB_URL similarly to DB_URL when overridden in config

This commit is contained in:
Masen Furer 2024-12-06 12:55:42 -08:00
parent 5883818051
commit 86b49e4149
No known key found for this signature in database
GPG Key ID: B0008AD22B3B3A95

View File

@ -571,6 +571,10 @@ class EnvironmentVariables:
environment = EnvironmentVariables()
# These vars are not logged because they may contain sensitive information.
_sensitive_env_vars = {"DB_URL", "ASYNC_DB_URL"}
class Config(Base):
"""The config defines runtime settings for the app.
@ -754,7 +758,7 @@ class Config(Base):
# If the env var is set, override the config value.
if env_var is not None:
if key.upper() != "DB_URL":
if key.upper() not in _sensitive_env_vars:
console.info(
f"Overriding config value {key} with env var {key.upper()}={env_var}",
dedupe=True,