Documentation
¶
Overview ¶
Package secrets abstracts credential storage. The system implementation uses the OS keyring via zalando/go-keyring (Secret Service over D-Bus on Linux, Keychain on macOS); an in-memory implementation is provided for tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("secret not found")
ErrNotFound is returned when a key is absent.
Functions ¶
func PasswordKey ¶
PasswordKey is the keyring key holding a context's login password.
Types ¶
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory is an in-memory Store for tests.
type Store ¶
type Store interface {
Get(key string) (string, error)
Set(key, value string) error
Delete(key string) error
}
Store is the minimal credential store interface used by the rest of mmcli.
type SystemStore ¶
type SystemStore struct{}
SystemStore talks to the OS keyring (Secret Service on Linux, Keychain on macOS).
func (SystemStore) Delete ¶
func (SystemStore) Delete(key string) error
Delete removes key; absent keys are not an error.
func (SystemStore) Get ¶
func (SystemStore) Get(key string) (string, error)
Get returns the value for key, or ErrNotFound.
func (SystemStore) Set ¶
func (SystemStore) Set(key, value string) error
Set stores value under key.