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
View File
@@ -120,6 +120,8 @@ type Spec struct {
// ("database.url", "oidc.client_secret"): "config show" redacts them
// like the keys it always treats as secret (a last segment secrets,
// secret, token or password). A key also covers everything below it.
// Fields of list entries are named without the index
// ("admins.password" for every entry of the list admins).
SecretKeys []string
// Options are passed through to core/config; tests use them to