Skip to content

fix: allow credential pipes into any Maskey --stdin command - #67

Merged
liby merged 1 commit into
mainfrom
fix/maskey-stdin-commands
Nov 23, 2026
Merged

liby merged 1 commit into
mainfrom
fix/maskey-stdin-commands

Conversation

@liby

@liby liby commented Nov 23, 2026

Copy link
Copy Markdown
Member

A credential variable piped into mk store add --stdin was refused as printing the credential, although the command reads it from standard input the same way mk set --stdin does. The guard listed Maskey's standard-input clients by subcommand and knew only mk set, so each command Maskey gives the flag would need its own entry.

Maskey gives --stdin one meaning on every command that takes it, so the flag now marks the client on any mk command except mk run. mk run passes its standard input to the command it runs, and when the launcher is not parsed, as with an option outside its table, that command's own --stdin word would otherwise count. A parsed mk run is unchanged: its inner command is checked as its own program.

The guard does not check that the command accepts the flag, so printenv TOKEN | mk list --stdin now passes where it was refused. Maskey exits with unknown flag there without reading its standard input, and checking each command would bring the per-subcommand list back.

Each of the three conditions fails its own fixture row when removed: returning to set only fails maskey-subcommand-stdin, dropping the flag condition fails maskey-without-stdin, and dropping the mk run exclusion fails maskey-run-unparsed-stdin-word. Of the 1,645 recorded calls that the previous build blocked or that mention mk, none changed its verdict against v0.8.19.

The guard listed Maskey's standard-input credential clients by
subcommand and knew only `mk set --stdin`, so every command Maskey
later gave that flag, such as `mk store add --stdin`, was refused as
printing a credential variable until the guard listed it.

Maskey gives `--stdin` one meaning on every command that takes it, so
the flag now marks the client on any `mk` command. `mk run` is excluded:
it passes its standard input to the command it runs, and when the
launcher is not parsed that command's own `--stdin` word would otherwise
count. A command that does not accept the flag exits with a usage error
without reading its standard input.
@liby
liby merged commit 6912882 into main Nov 23, 2026
5 checks passed
@liby
liby deleted the fix/maskey-stdin-commands branch November 23, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant