Skip to content

Commit

Permalink
don't obfuscate defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
abrichr committed Jun 25, 2023
1 parent 79c41f5 commit abac4e5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion openadapt/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,15 @@ def obfuscate(val, pct_reveal=0.1, char="*"):



_OBFUSCATE_KEY_PARTS = ("KEY", "PASSWORD", "TOKEN")
if multiprocessing.current_process().name == "MainProcess":
for key, val in dict(locals()).items():
if not key.startswith("_") and key.isupper():
parts = key.split("_")
if any([phrase in parts for phrase in ("KEY", "PASSWORD", "TOKEN")]):
if (
any([part in parts for part in _OBFUSCATE_KEY_PARTS]) and
val != _DEFAULTS[key]
):
val = obfuscate(val)
logger.info(f"{key}={val}")

Expand Down

0 comments on commit abac4e5

Please sign in to comment.