MCPcopy Create free account
hub / github.com/basecamp/hey-cli / ensureInit

Method ensureInit

internal/auth/store.go:43–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41}
42
43func (s *Store) ensureInit() {
44 s.initOnce.Do(func() {
45 if s.noKeyring {
46 return
47 }
48 testKey := "hey::test"
49 err := keyring.Set(serviceName, testKey, "test")
50 if err == nil {
51 _ = keyring.Delete(serviceName, testKey)
52 s.useKeyring = true
53 return
54 }
55 fmt.Fprintf(os.Stderr, "warning: system keyring unavailable, credentials stored in plaintext at %s\n",
56 filepath.Join(s.fallbackDir, "credentials.json"))
57 })
58}
59
60func key(origin string) string {
61 return fmt.Sprintf("hey::%s", origin)

Callers 5

LoadMethod · 0.95
SaveMethod · 0.95
DeleteMethod · 0.95
MigrateToKeyringMethod · 0.95
UsingKeyringMethod · 0.95

Calls 1

DeleteMethod · 0.80

Tested by

no test coverage detected