Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add a spot for future ntlm support
  • Loading branch information
technoweenie committed Dec 20, 2016
commit 21c9759dc8f0b411a34cfd50b88ce7d3b2fe7bb1
9 changes: 8 additions & 1 deletion lfsapi/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (c *Client) DoWithAuth(remote string, req *http.Request) (*http.Response, e
return nil, err
}

res, err := c.Do(req)
res, err := c.doWithCreds(req, creds, credsURL, access)
if err != nil {
if errors.IsAuthError(err) {
newAccess := getAuthAccess(res)
Expand Down Expand Up @@ -77,6 +77,13 @@ func (c *Client) DoWithAuth(remote string, req *http.Request) (*http.Response, e
return res, err
}

func (c *Client) doWithCreds(req *http.Request, creds Creds, credsURL *url.URL, access Access) (*http.Response, error) {
if access == NTLMAccess {
return c.doWithNTLM(req, creds, credsURL)
}
return c.Do(req)
}

func getCreds(credHelper CredentialHelper, netrcFinder NetrcFinder, ef EndpointFinder, remote string, req *http.Request) (Creds, *url.URL, Access, error) {
if skipCreds(ef, req) {
return nil, nil, emptyAccess, nil
Expand Down