MCPcopy
hub / github.com/git-lfs/git-lfs / DoAPIRequestWithAuth

Method DoAPIRequestWithAuth

lfsapi/auth.go:56–61  ·  view source on GitHub ↗

DoAPIRequestWithAuth sends an HTTP request to get an HTTP response similarly to DoWithAuth, but using the LFS API endpoint for the provided remote and operation to determine the access mode.

(remote string, req *http.Request)

Source from the content-addressed store, hash-verified

54// to DoWithAuth, but using the LFS API endpoint for the provided remote and
55// operation to determine the access mode.
56func (c *Client) DoAPIRequestWithAuth(remote string, req *http.Request) (*http.Response, error) {
57 operation := getReqOperation(req)
58 apiEndpoint := c.Endpoints.Endpoint(operation, remote)
59 access := c.Endpoints.AccessFor(apiEndpoint.Url)
60 return c.DoWithAuth(remote, access, req)
61}
62
63func (c *Client) doWithAuth(remote string, count *int, access creds.Access, req *http.Request, via []*http.Request) (*http.Response, error) {
64 if *count == defaultMaxAuthAttempts {

Callers 9

TestDoAPIRequestWithAuthFunction · 0.95
LockMethod · 0.80
UnlockMethod · 0.80
SearchMethod · 0.80
SearchVerifiableMethod · 0.80
performDownloadFunction · 0.80
performUploadFunction · 0.80
BatchMethod · 0.80

Calls 4

DoWithAuthMethod · 0.95
getReqOperationFunction · 0.85
EndpointMethod · 0.65
AccessForMethod · 0.65

Tested by 2

TestDoAPIRequestWithAuthFunction · 0.76