Repository navigation
fix(cli): avoid blocking on non-interactive key passwords - #1891
Conversation
Signed-off-by: Konstantin Baltsat <[email protected]>
13851ec to
d32aebd
Compare
|
@Baltsat Thanks for your contribution! Could you also update the related documents in docs/content/dir? Thanks! |
Signed-off-by: Konstantin Baltsat <[email protected]>
|
Thanks — I added the related non-interactive signing documentation in
Local documentation validation passed: MkDocs build, codespell, pymarkdown, and |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
paralta
left a comment
There was a problem hiding this comment.
LGTM, thanks for contributing! please fix the pending conflict so we can merge 🚀
Resolve the signing-reference overlap by retaining both the non-interactive password contract and the newly merged KMS documentation. Add direct coverage for the production password-reader wiring. AI-Assisted: Codex User-Request: finish existing OSS pull requests through final proof | codex:oss-maintainer-campaign Signed-off-by: Konstantin Baltsat <[email protected]>
|
Resolved the conflict in I also added direct coverage for the production password-reader wiring. Final-tree proof passed: full CLI tests, focused coverage, vet, golangci-lint, CLI build, MkDocs build, codespell, pymarkdown, and |
Signed-off-by: Konstantin Baltsat <[email protected]>
|
Thanks for catching that — fixed in I restored the current Final-tree documentation proof passed with the repository's locked |
Summary
dirctl signfrom implicitly reading an unrelated or permanently open stdin stream in non-interactive environments--password-stdinsupport for intentional piped passwordsCOSIGN_PASSWORDprecedence, including an explicitly empty valueRoot cause
When
COSIGN_PASSWORDwas unset and no terminal was available, the password reader unconditionally calledio.ReadAll(os.Stdin). A headless parent may keep stdin open without providing data, so signing could block indefinitely instead of advancing or returning an error.The new precedence is:
COSIGN_PASSWORD, including an explicitly empty value--password-stdinFixes #1883
Compatibility
Scripts that intentionally pipe a private-key password must now opt in with
--password-stdin, for example:This distinguishes intentional password input from an unrelated open stdin stream.
Validation
Passed in the worker’s clean-applied source harness:
go test ./cli/cmd/sign -count=1 -v— 7 tests passedgo test ./cli/cmd/sign -count=100go test -race ./cli/cmd/sign -count=1go vet ./cli/cmd/signgofmtandgit diff --checkThe current binary separately reproduced the open-stdin hang and the
unsupported pem type: PRIVATE KEYerror before the change.The worker VM did not provide Go 1.26.5, Taskfile, GolangCI-Lint, or Docker, so repository-wide unit, lint, build, and E2E checks remain for upstream CI. An inline PEM that fails the initial parser may still be reinterpreted as a key reference before the final error is wrapped; the exact issue reproduction uses a key file and is covered.