From d05f8984df14771796151ba891058b3962a2f1cc Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Tue, 28 Mar 2017 10:16:12 -0600 Subject: [PATCH] lfsapi/auth_test: add a "bare ssh URI" test case --- lfsapi/auth_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lfsapi/auth_test.go b/lfsapi/auth_test.go index a902b10f..1c5bc895 100644 --- a/lfsapi/auth_test.go +++ b/lfsapi/auth_test.go @@ -492,6 +492,30 @@ func TestGetCreds(t *testing.T) { }, }, }, + "bare ssh URI": getCredsTest{ + Remote: "origin", + Method: "POST", + Href: "https://git-server.com/repo/lfs/objects/batch", + Config: map[string]string{ + "lfs.url": "https://git-server.com/repo/lfs", + "lfs.https://git-server.com/repo/lfs.access": "basic", + + "remote.origin.url": "git@git-server.com:repo.git", + }, + Expected: getCredsExpected{ + Access: BasicAccess, + Endpoint: "https://git-server.com/repo/lfs", + Authorization: basicAuth("git-server.com", "monkey"), + CredsURL: "https://git-server.com/repo/lfs", + Creds: map[string]string{ + "host": "git-server.com", + "password": "monkey", + "path": "repo/lfs", + "protocol": "https", + "username": "git-server.com", + }, + }, + }, } credHelper := &fakeCredentialFiller{}