Documentation
¶
Overview ¶
Package keyring provides a small, dependency-free secret store backed by the operating system's native credential tooling: the `security` keychain CLI on macOS and `secret-tool` (libsecret) on Linux. It stores a single secret string per (service, account). Windows and other platforms report unsupported.
It shells out to the OS tools rather than taking a third-party dependency. On both macOS and Linux the secret is passed over stdin, never the argument vector, so it is not exposed via the process list. On macOS the write goes through `security -i` (interactive mode), whose command parser is line-based with a fixed 4096-byte line buffer, so Set rejects secrets containing newlines or exceeding that budget rather than silently corrupting them; Linux's secret-tool has no such restriction.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupported = errors.New("keyring: no OS keyring backend on this platform")
ErrUnsupported is returned when no OS keyring backend is available for the current platform.
Functions ¶
This section is empty.
Types ¶
type Keyring ¶
type Keyring struct {
// contains filtered or unexported fields
}
Keyring is an OS-native secret store.
func (*Keyring) Available ¶
Available reports whether this platform has a supported keyring backend. The backing tool (`secret-tool` on Linux) must also be installed; a missing tool surfaces as an error from Get/Set/Delete.
func (*Keyring) Delete ¶
Delete removes the entry under (service, account), reporting whether one existed.