mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-04-21 19:48:12 +00:00
Fix: Remove Batch from API options, set to true by default, add comments
Fixes: #1106
This commit is contained in:
@@ -16,7 +16,6 @@ import (
|
|||||||
// SigningOptions is a shared between publish API GPG options structure
|
// SigningOptions is a shared between publish API GPG options structure
|
||||||
type SigningOptions struct {
|
type SigningOptions struct {
|
||||||
Skip bool
|
Skip bool
|
||||||
Batch bool
|
|
||||||
GpgKey string
|
GpgKey string
|
||||||
Keyring string
|
Keyring string
|
||||||
SecretKeyring string
|
SecretKeyring string
|
||||||
@@ -33,7 +32,9 @@ func getSigner(options *SigningOptions) (pgp.Signer, error) {
|
|||||||
signer.SetKey(options.GpgKey)
|
signer.SetKey(options.GpgKey)
|
||||||
signer.SetKeyRing(options.Keyring, options.SecretKeyring)
|
signer.SetKeyRing(options.Keyring, options.SecretKeyring)
|
||||||
signer.SetPassphrase(options.Passphrase, options.PassphraseFile)
|
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()
|
err := signer.Init()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ type GoSigner struct {
|
|||||||
signerConfig *packet.Config
|
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) {
|
func (g *GoSigner) SetBatch(batch bool) {
|
||||||
g.batch = batch
|
g.batch = batch
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user