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

Method IsApproved

lfsapi/auth_test.go:334–343  ·  view source on GitHub ↗
(creds creds.Creds)

Source from the content-addressed store, hash-verified

332}
333
334func (m *mockCredentialHelper) IsApproved(creds creds.Creds) bool {
335 if found, ok := m.Approved[credsToKey(creds)]; ok {
336 if len(found["password"]) == 1 && len(creds["password"]) == 1 {
337 return found["password"][0] == creds["password"][0]
338 } else {
339 return len(found["password"]) == 0 && len(creds["password"]) == 0
340 }
341 }
342 return false
343}
344
345func credsToKey(creds creds.Creds) string {
346 var kvs []string

Callers 3

TestDoWithAuthApproveFunction · 0.80
TestDoWithAuthRejectFunction · 0.80
TestDoAPIRequestWithAuthFunction · 0.80

Calls 1

credsToKeyFunction · 0.85

Tested by

no test coverage detected