Repository navigation
fix: allow credential pipes into any Maskey --stdin command - #67
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A credential variable piped into
mk store add --stdinwas refused as printing the credential, although the command reads it from standard input the same waymk set --stdindoes. The guard listed Maskey's standard-input clients by subcommand and knew onlymk set, so each command Maskey gives the flag would need its own entry.Maskey gives
--stdinone meaning on every command that takes it, so the flag now marks the client on anymkcommand exceptmk run.mk runpasses 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--stdinword would otherwise count. A parsedmk runis 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 --stdinnow passes where it was refused. Maskey exits withunknown flagthere 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
setonly failsmaskey-subcommand-stdin, dropping the flag condition failsmaskey-without-stdin, and dropping themk runexclusion failsmaskey-run-unparsed-stdin-word. Of the 1,645 recorded calls that the previous build blocked or that mentionmk, none changed its verdict against v0.8.19.