MCPcopy Index your code
hub / github.com/git-bug/git-bug / LoadWithId

Function LoadWithId

bridge/core/auth/credential.go:61–73  ·  view source on GitHub ↗

Load loads a credential from the repo config

(repo repository.RepoKeyring, id entity.Id)

Source from the content-addressed store, hash-verified

59
60// Load loads a credential from the repo config
61func LoadWithId(repo repository.RepoKeyring, id entity.Id) (Credential, error) {
62 key := fmt.Sprintf("%s%s", keyringKeyPrefix, id)
63
64 item, err := repo.Keyring().Get(key)
65 if err == repository.ErrKeyringKeyNotFound {
66 return nil, ErrCredentialNotExist
67 }
68 if err != nil {
69 return nil, err
70 }
71
72 return decode(item)
73}
74
75// LoadWithPrefix load a credential from the repo config with a prefix
76func LoadWithPrefix(repo repository.RepoKeyring, prefix string) (Credential, error) {

Callers 3

IdExistFunction · 0.85
TestCredentialFunction · 0.85
testCredentialSerialFunction · 0.85

Calls 3

decodeFunction · 0.85
GetMethod · 0.80
KeyringMethod · 0.65

Tested by 2

TestCredentialFunction · 0.68
testCredentialSerialFunction · 0.68