summaryrefslogtreecommitdiff
path: root/go/internal/gitlabnet/lfsauthenticate
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2019-08-05 05:03:16 +0000
committerAsh McKenzie <amckenzie@gitlab.com>2019-08-05 05:03:16 +0000
commitc577eb9ed8bd0336870f7a83302f70821d510169 (patch)
treeed7f7281633d97933e4465a2ac0f86d62c9a216e /go/internal/gitlabnet/lfsauthenticate
parented0460374a5ca13d9ea17c6a9c21151319b7fd53 (diff)
parent3b6f9f7583755e041e76142d7caf7716937907fa (diff)
downloadgitlab-shell-c577eb9ed8bd0336870f7a83302f70821d510169.tar.gz
Merge branch '181-migrate-gitlab-shell-checks-fallback' into 'master'
Support falling back to ruby version of checkers See merge request gitlab-org/gitlab-shell!318
Diffstat (limited to 'go/internal/gitlabnet/lfsauthenticate')
-rw-r--r--go/internal/gitlabnet/lfsauthenticate/client.go4
-rw-r--r--go/internal/gitlabnet/lfsauthenticate/client_test.go10
2 files changed, 7 insertions, 7 deletions
diff --git a/go/internal/gitlabnet/lfsauthenticate/client.go b/go/internal/gitlabnet/lfsauthenticate/client.go
index 2a7cb03..51cb7a4 100644
--- a/go/internal/gitlabnet/lfsauthenticate/client.go
+++ b/go/internal/gitlabnet/lfsauthenticate/client.go
@@ -13,7 +13,7 @@ import (
type Client struct {
config *config.Config
client *gitlabnet.GitlabClient
- args *commandargs.CommandArgs
+ args *commandargs.Shell
}
type Request struct {
@@ -30,7 +30,7 @@ type Response struct {
ExpiresIn int `json:"expires_in"`
}
-func NewClient(config *config.Config, args *commandargs.CommandArgs) (*Client, error) {
+func NewClient(config *config.Config, args *commandargs.Shell) (*Client, error) {
client, err := gitlabnet.GetClient(config)
if err != nil {
return nil, fmt.Errorf("Error creating http client: %v", err)
diff --git a/go/internal/gitlabnet/lfsauthenticate/client_test.go b/go/internal/gitlabnet/lfsauthenticate/client_test.go
index 7fd7aca..07484a7 100644
--- a/go/internal/gitlabnet/lfsauthenticate/client_test.go
+++ b/go/internal/gitlabnet/lfsauthenticate/client_test.go
@@ -59,22 +59,22 @@ func TestFailedRequests(t *testing.T) {
testCases := []struct {
desc string
- args *commandargs.CommandArgs
+ args *commandargs.Shell
expectedOutput string
}{
{
desc: "With bad response",
- args: &commandargs.CommandArgs{GitlabKeyId: "-1", CommandType: commandargs.UploadPack},
+ args: &commandargs.Shell{GitlabKeyId: "-1", CommandType: commandargs.UploadPack},
expectedOutput: "Parsing failed",
},
{
desc: "With API returns an error",
- args: &commandargs.CommandArgs{GitlabKeyId: "forbidden", CommandType: commandargs.UploadPack},
+ args: &commandargs.Shell{GitlabKeyId: "forbidden", CommandType: commandargs.UploadPack},
expectedOutput: "Internal API error (403)",
},
{
desc: "With API fails",
- args: &commandargs.CommandArgs{GitlabKeyId: "broken", CommandType: commandargs.UploadPack},
+ args: &commandargs.Shell{GitlabKeyId: "broken", CommandType: commandargs.UploadPack},
expectedOutput: "Internal API error (500)",
},
}
@@ -99,7 +99,7 @@ func TestSuccessfulRequests(t *testing.T) {
url, cleanup := testserver.StartHttpServer(t, requests)
defer cleanup()
- args := &commandargs.CommandArgs{GitlabKeyId: keyId, CommandType: commandargs.LfsAuthenticate}
+ args := &commandargs.Shell{GitlabKeyId: keyId, CommandType: commandargs.LfsAuthenticate}
client, err := NewClient(&config.Config{GitlabUrl: url}, args)
require.NoError(t, err)