Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Remove Batch from API options, set to true by default #1208

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions api/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
// SigningOptions is a shared between publish API GPG options structure
type SigningOptions struct {
Skip bool
Batch bool
GpgKey string
Keyring string
SecretKeyring string
Expand All @@ -33,7 +32,9 @@ func getSigner(options *SigningOptions) (pgp.Signer, error) {
signer.SetKey(options.GpgKey)
signer.SetKeyRing(options.Keyring, options.SecretKeyring)
signer.SetPassphrase(options.Passphrase, options.PassphraseFile)
signer.SetBatch(options.Batch)

// If Batch is false, GPG will ask for passphrase on stdin, which would block the api process
signer.SetBatch(true)

err := signer.Init()
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion pgp/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ type GoSigner struct {
signerConfig *packet.Config
}

// SetBatch controls whether we allowed to interact with user
// SetBatch controls whether we allowed to interact with user, for example
// for getting the passphrase from stdin.
func (g *GoSigner) SetBatch(batch bool) {
g.batch = batch
}
Expand Down
Loading