Documentation
¶
Overview ¶
Package keyring provides a composite keyring provider that supports multiple backends. It supports macOS Keychain, Windows Credential Manager, and Linux D-Bus Secret Service, with keyctl as a fallback on Linux systems.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("key not found")
ErrNotFound is returned when a requested key is not found in the keyring
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface {
Set(service, key, value string) error
Get(service, key string) (string, error)
Delete(service, key string) error
DeleteAll(service string) error
IsAvailable() bool
Name() string
}
Provider defines the interface for keyring backends
func NewCompositeProvider ¶
func NewCompositeProvider() Provider
NewCompositeProvider creates a new composite keyring provider that combines multiple backends. It uses zalando/go-keyring as the primary provider and keyctl as a fallback on Linux.
func NewKeyctlProvider ¶
NewKeyctlProvider creates a new keyring provider using Linux keyctl. It initializes access to the user keyring for persistence across process invocations.
func NewZalandoKeyringProvider ¶
func NewZalandoKeyringProvider() Provider
NewZalandoKeyringProvider creates a new provider that wraps zalando/go-keyring. This provider supports macOS Keychain, Windows Credential Manager, and Linux D-Bus Secret Service.