MCPcopy Create free account
hub / github.com/diillson/chatcli / linuxGet

Method linuxGet

auth/keychain.go:172–180  ·  view source on GitHub ↗

Linux: uses `secret-tool` from libsecret

(account string)

Source from the content-addressed store, hash-verified

170
171// Linux: uses `secret-tool` from libsecret
172func (ks *KeychainStore) linuxGet(account string) ([]byte, error) {
173 cmd := exec.Command("secret-tool", "lookup", // #nosec G204
174 "service", keychainServiceName, "account", account)
175 out, err := cmd.Output()
176 if err != nil {
177 return nil, fmt.Errorf("secret-tool lookup failed: %w", err)
178 }
179 return out, nil
180}
181
182func (ks *KeychainStore) linuxSet(account string, data []byte) error {
183 cmd := exec.Command("secret-tool", "store", // #nosec G204

Callers 1

nativeGetMethod · 0.95

Calls 2

ErrorfMethod · 0.80
OutputMethod · 0.65

Tested by

no test coverage detected