Add SkipSSHKey field to LoginOptions

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
This commit is contained in:
Babak K. Shandiz 2024-04-06 12:35:06 +01:00
parent 3be7a02fec
commit 3a3450fec5
No known key found for this signature in database
GPG key ID: 44950AED81AD710F

View file

@ -28,19 +28,20 @@ type iconfig interface {
}
type LoginOptions struct {
IO *iostreams.IOStreams
Config iconfig
HTTPClient *http.Client
GitClient *git.Client
Hostname string
Interactive bool
Web bool
Scopes []string
Executable string
GitProtocol string
Prompter Prompt
Browser browser.Browser
SecureStorage bool
IO *iostreams.IOStreams
Config iconfig
HTTPClient *http.Client
GitClient *git.Client
Hostname string
Interactive bool
Web bool
Scopes []string
Executable string
GitProtocol string
Prompter Prompt
Browser browser.Browser
SecureStorage bool
SkipSSHKeyPrompt bool
sshContext ssh.Context
}
@ -84,7 +85,7 @@ func Login(opts *LoginOptions) error {
var keyToUpload string
keyTitle := defaultSSHKeyTitle
if opts.Interactive && gitProtocol == "ssh" {
if opts.Interactive && !opts.SkipSSHKeyPrompt && gitProtocol == "ssh" {
pubKeys, err := opts.sshContext.LocalPublicKeys()
if err != nil {
return err