Add support for ssh passphrases.
This commit is contained in:
@@ -324,7 +324,7 @@ func (g *gitVCS) commit(ctx context.Context, version Version) (*object.Commit, e
|
||||
|
||||
func (g *gitVCS) authMethod() (transport.AuthMethod, error) {
|
||||
if g.auth.Key != "" {
|
||||
return ssh.NewPublicKeysFromFile("git", g.auth.Key, "")
|
||||
return ssh.NewPublicKeysFromFile("git", g.auth.Key, g.auth.Password)
|
||||
} else if g.auth.Username != "" {
|
||||
return &http.BasicAuth{Username: g.auth.Username, Password: g.auth.Password}, nil
|
||||
}
|
||||
|
||||
@@ -61,4 +61,4 @@ func NoAuth() Auth { return Auth{} }
|
||||
func Password(username, password string) Auth { return Auth{Username: username, Password: password} }
|
||||
|
||||
// Key returns an Auth implementation that uses key file authentication mechanism.
|
||||
func Key(key string) Auth { return Auth{Key: key} }
|
||||
func Key(key, password string) Auth { return Auth{Key: key, Password: password} }
|
||||
|
||||
Reference in New Issue
Block a user