| 180 | } |
| 181 | |
| 182 | func (ks *KeychainStore) linuxSet(account string, data []byte) error { |
| 183 | cmd := exec.Command("secret-tool", "store", // #nosec G204 |
| 184 | "--label", fmt.Sprintf("ChatCLI: %s", account), |
| 185 | "service", keychainServiceName, "account", account) |
| 186 | cmd.Stdin = strings.NewReader(string(data)) |
| 187 | if err := cmd.Run(); err != nil { |
| 188 | return fmt.Errorf("secret-tool store failed: %w", err) |
| 189 | } |
| 190 | return nil |
| 191 | } |
| 192 | |
| 193 | func (ks *KeychainStore) linuxDelete(account string) error { |
| 194 | cmd := exec.Command("secret-tool", "clear", // #nosec G204 |