Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("password not found in keyring") // example a headless Linux/CI host with no D-Bus session bus). Callers // should treat secure storage as absent and fall back to the config file. ErrUnavailable = errors.New("keyring unavailable") // ErrAccessDenied is a specific ErrUnavailable: the session bus exists but // the sandbox or D-Bus policy refused the connection — most commonly a // strict snap whose password-manager-service interface is not connected. // Unlike a missing provider, this is something the user can fix, so callers // may surface a hint. It wraps ErrUnavailable so the file-storage fallback // still triggers. ErrAccessDenied = fmt.Errorf("%w: access to the secret service was denied", ErrUnavailable) )
Functions ¶
func Available ¶
func Available() bool
Available reports whether the OS keyring backend is usable.
On Unix the backend talks to the Secret Service over D-Bus. When no session bus is advertised, the underlying library shells out to "dbus-launch" to start one; on headless/CI machines that binary is absent and the call fails with a confusing `exec: "dbus-launch": executable file not found in $PATH`. We detect that situation up front so we never attempt the operation — and so the load path doesn't pay a doomed 3s timeout on every command.
macOS (Keychain) and Windows (Credential Manager) have no such dependency and are always considered available.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.