Documentation
¶
Overview ¶
Package keychain keeps small secrets in the operating system's credential store: the Windows Credential Manager, the macOS Keychain, or the Secret Service (GNOME Keyring, KWallet) on Linux. When there is no usable store (a container, a server with no desktop session) every function returns ErrUnavailable and the caller falls back to a file with owner-only permissions. SESHAT_KEYCHAIN=off turns the store off. See internal/keychain.
Index ¶
Constants ¶
const EnvDisable = keychain.EnvDisable
EnvDisable turns the operating system store off (value "off", "0" or "false").
const Service = keychain.Service
Service is the name every item is stored under.
Variables ¶
var ( // ErrNotFound means the store works and holds no item of that name. ErrNotFound = keychain.ErrNotFound ErrUnavailable = keychain.ErrUnavailable )
Functions ¶
func Enabled ¶
func Enabled() bool
Enabled reports whether this process may use the operating system store.
func Get ¶
Get returns the secret stored under account, ErrNotFound when there is none, ErrUnavailable when there is no usable store.
func UseForTesting ¶
func UseForTesting() (restore func())
UseForTesting installs an in-memory store and turns the package on, and returns the function that restores the previous state, so that tests of the packages that call this one never touch the real store.
Types ¶
This section is empty.