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

Function defaultKeyring

repository/keyring.go:26–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24}
25
26func defaultKeyring() (Keyring, error) {
27 ucd, err := os.UserConfigDir()
28 if err != nil {
29 return nil, err
30 }
31
32 return keyring.Open(keyring.Config{
33 // only use the file backend until https://github.com/99designs/keyring/issues/74 is resolved
34 AllowedBackends: []keyring.BackendType{
35 keyring.FileBackend,
36 },
37
38 ServiceName: "git-bug",
39
40 // Fallback encrypted file
41 FileDir: filepath.Join(ucd, "git-bug", "keyring"),
42 // As we write the file in the user's config directory, this file should already be protected by the OS against
43 // other user's access. We actually don't terribly need to protect it further and a password prompt across all
44 // UI's would be a pain. Therefore we use here a constant password so the file will be unreadable by generic file
45 // scanners if the user's machine get compromised.
46 FilePasswordFunc: func(string) (string, error) {
47 return "git-bug", nil
48 },
49 })
50}
51
52// replaceKeyring allow to replace the Keyring of the underlying repo
53type replaceKeyring struct {

Callers 3

OpenGoGitRepoFunction · 0.85
InitGoGitRepoFunction · 0.85
InitBareGoGitRepoFunction · 0.85

Calls 1

OpenMethod · 0.45

Tested by

no test coverage detected