diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2020-09-21 04:47:01 +0000 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2020-09-21 04:47:01 +0000 |
commit | 1a2bfecd2f0ebb8e31f9833e0522c4643797041b (patch) | |
tree | d17cf7bff45492a587027851bb6e0bcb493cff58 /internal/gitlabnet/lfsauthenticate/client.go | |
parent | f100e7e83943b3bb5db232f5bf79a616fdba88f1 (diff) | |
parent | a487572a904cc149840488eefdfe121173d8bcb5 (diff) | |
download | gitlab-shell-1a2bfecd2f0ebb8e31f9833e0522c4643797041b.tar.gz |
Merge branch 'sh-extract-context-from-env' into 'master'
Make it possible to propagate correlation ID across processes
Closes #474
See merge request gitlab-org/gitlab-shell!413
Diffstat (limited to 'internal/gitlabnet/lfsauthenticate/client.go')
-rw-r--r-- | internal/gitlabnet/lfsauthenticate/client.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/gitlabnet/lfsauthenticate/client.go b/internal/gitlabnet/lfsauthenticate/client.go index fffc225..834cbe1 100644 --- a/internal/gitlabnet/lfsauthenticate/client.go +++ b/internal/gitlabnet/lfsauthenticate/client.go @@ -1,6 +1,7 @@ package lfsauthenticate import ( + "context" "fmt" "net/http" "strings" @@ -40,7 +41,7 @@ func NewClient(config *config.Config, args *commandargs.Shell) (*Client, error) return &Client{config: config, client: client, args: args}, nil } -func (c *Client) Authenticate(operation, repo, userId string) (*Response, error) { +func (c *Client) Authenticate(ctx context.Context, operation, repo, userId string) (*Response, error) { request := &Request{Operation: operation, Repo: repo} if c.args.GitlabKeyId != "" { request.KeyId = c.args.GitlabKeyId @@ -48,7 +49,7 @@ func (c *Client) Authenticate(operation, repo, userId string) (*Response, error) request.UserId = strings.TrimPrefix(userId, "user-") } - response, err := c.client.Post("/lfs_authenticate", request) + response, err := c.client.Post(ctx, "/lfs_authenticate", request) if err != nil { return nil, err } |