Skip to content

Commit 659695f

Browse files
committed
Add back support for passphrase protected ssh keys
Signed-off-by: Christian Ihle <[email protected]>
1 parent 767e771 commit 659695f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

git/options.go

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ func NewAuthOptions(u url.URL, data map[string][]byte) (*AuthOptions, error) {
9191
opts.Identity = data["identity"]
9292
opts.KnownHosts = data["known_hosts"]
9393
opts.Username = u.User.Username()
94+
opts.Password = string(data["password"])
9495
// We fallback to using "git" as the username when cloning Git
9596
// repositories through SSH since that's the conventional username used
9697
// by Git providers.

git/options_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func TestAuthOptionsFromData(t *testing.T) {
235235

236236
wantFunc: func(g *WithT, opts *AuthOptions) {
237237
g.Expect(opts.Username).To(Equal(DefaultPublicKeyAuthUser)) // Not the specified username
238-
g.Expect(opts.Password).To(Equal(""))
238+
g.Expect(opts.Password).To(Equal("secret")) // For passphrase protected ssh key
239239
g.Expect(opts.BearerToken).To(Equal(""))
240240
g.Expect(opts.Identity).To(BeEquivalentTo(privateKeyFixture))
241241
g.Expect(opts.KnownHosts).To(BeEquivalentTo(knownHostsFixture))

0 commit comments

Comments
 (0)