feat(apikey): add --pepper-stdin and warn on --pepper (mxaccessgw#194)

--pepper on the command line lands in shell history and the process list.
Add --pepper-stdin (first stdin line), warn on stderr when --pepper is used,
and reject both together. Documented in GatewayProcessDesign.md.

Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
Joseph Doherty
2026-11-09 12:27:37 -05:00
parent be0d585f8c
commit 417b9e5a19
6 changed files with 119 additions and 9 deletions
+6 -3
View File
@@ -804,9 +804,12 @@ ZB.MOM.WW.MxGateway.Server apikey revoke-key --key-id operator01
ZB.MOM.WW.MxGateway.Server apikey rotate-key --key-id operator01 --json
```
The subcommands accept `--sqlite-path`, `--pepper`, and `--json`. `--pepper`
sets the local `MxGateway:ApiKeyPepper` configuration value for the command
process; deployments should normally provide the pepper through the configured
The subcommands accept `--sqlite-path`, `--pepper`, `--pepper-stdin`, and `--json`.
`--pepper-stdin` reads the first line of standard input and `--pepper <value>` takes it
from the command line; either sets the local `MxGateway:ApiKeyPepper` configuration value
for the command process (they are mutually exclusive). `--pepper` leaves the pepper in shell
history and the process list, so the command prints a warning to stderr — prefer
`--pepper-stdin`, the `MxGateway__ApiKeyPepper` environment variable, or the configured
secret source. `create-key` and `rotate-key` print the full raw API key exactly
once. `list-keys` never prints raw secrets or `secret_hash` values.