fix(configcmd): redact secret fields inside list values

"config show" prints a list as one value, and redaction only looked at
the leaf's own key, so the password of every entry of a list (yamocir's
bootstrap.admins) was printed in clear. The same rule now applies inside
lists and maps of a leaf: a field is secret by its default name or by a
Spec.SecretKeys key without the list index ("admins.password").
References (env:, file:, secret://) stay visible as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
terminarandClaude Opus 5.5 committed 2026-11-24 09:47:44 +01:00
1 parent 8513b6db4c
commit 9395fadbf7
4 files changed
+89 -4

No files matched your search

+2 -1
View File
@@ -377,7 +377,8 @@ the file every value comes from (`Effective.Show`; secrets -- keys
`secrets`, `secret`, `token`, `password`, plus the program's own
`Spec.SecretKeys` such as `database.url` (a key covers everything below
it) -- are redacted unless `--show-secrets`, references like `env:X`
stay visible), and
stay visible; inside a list the same rule applies to every entry's
fields, a Spec key naming them without the index: `admins.password`), and
`configcmd.Doctor(report, spec, explicit)` is the config part of a
`doctor` command (paths, layers, "config file found", unknown options).