Documentation
¶
Overview ¶
Package keychain stores secrets in the host OS keychain: macOS Keychain, the Freedesktop Secret Service on Linux, and Windows Credential Manager, with an in-memory Store for tests. It imports only the standard library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("keychain: credential not found in system keychain")
ErrNotFound is returned by Store.Get when no secret is stored for the requested service and account.
ErrUnavailable is returned when the host platform does not expose a desktop system keychain.
Functions ¶
This section is empty.
Types ¶
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory is a thread-safe in-memory Store implementation for tests and sandboxed tooling.
type Store ¶
type Store interface {
Set(service, account, secret string) error
Get(service, account string) (string, error)
Delete(service, account string) error
}
Store stores, retrieves, and removes secrets in the host OS keychain (macOS Keychain, Linux Secret Service, Windows Credential Manager) or an in-memory test store. Secrets must never be written into project files.