fix(cli): redact security.recovery_passphrase_hash in show_cmd

Adjacent secret leak in show_cmd noticed during Task 3 code review.
SecurityConfig has two sensitive fields and the redaction block only
covered pin_hash. vigilar config show would print the recovery
passphrase hash verbatim whenever one was configured.

One-line fix; same redaction pattern as the surrounding secrets.
Part of issue #2.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken
2026-04-05 11:44:14 -04:00
parent c2976876ed
commit 2032fac227

View File

@@ -49,6 +49,8 @@ def show_cmd(config_path: str | None) -> None:
data["web"]["password_hash"] = "***" data["web"]["password_hash"] = "***"
if data.get("security", {}).get("pin_hash"): if data.get("security", {}).get("pin_hash"):
data["security"]["pin_hash"] = "***" data["security"]["pin_hash"] = "***"
if data.get("security", {}).get("recovery_passphrase_hash"):
data["security"]["recovery_passphrase_hash"] = "***"
if data.get("alerts", {}).get("webhook", {}).get("secret"): if data.get("alerts", {}).get("webhook", {}).get("secret"):
data["alerts"]["webhook"]["secret"] = "***" data["alerts"]["webhook"]["secret"] = "***"
click.echo(json.dumps(data, indent=2)) click.echo(json.dumps(data, indent=2))