feat(configcmd): Spec.SecretKeys redacts a program's own secret options

"config show" redacted only keys whose last segment is secrets, secret,
token or password. A program's own secrets (database.url,
oidc.client_secret, smtp.url, ...) were printed, so programs disabled
show. Spec.SecretKeys names them as dotted keys (a key covers everything
below it); Effective carries them to Values and Show. First consumer:
yaemp and yaemp-mcp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
terminarandClaude Opus 5.5 committed 2026-11-21 17:32:16 +01:00
1 parent 31dbc347e8
commit 8513b6db4c
5 files changed
+67 -4

No files matched your search

+4 -2
View File
@@ -374,8 +374,10 @@ report options the program ignores. Taken over from
`config show [--json] [--show-secrets]` prints the configuration with
the file every value comes from (`Effective.Show`; secrets -- keys
`secrets`, `secret`, `token`, `password` -- are redacted unless
`--show-secrets`, references like `env:X` stay visible), and
`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
`configcmd.Doctor(report, spec, explicit)` is the config part of a
`doctor` command (paths, layers, "config file found", unknown options).