Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTokenKey ¶ added in v0.7.1
IsTokenKey reports whether a keyring key is an olk token entry.
Types ¶
type KeyringStore ¶
type KeyringStore struct {
// contains filtered or unexported fields
}
KeyringStore implements Store using the keyring library for cross-platform credential storage (macOS Keychain, Linux Secret Service, Windows WinCred).
func NewKeyringStore ¶
func NewKeyringStore() (*KeyringStore, error)
NewKeyringStore creates a new KeyringStore backed by the OS credential manager.
func (*KeyringStore) Delete ¶
func (s *KeyringStore) Delete(key string) error
Delete removes the entry for the given key.
func (*KeyringStore) Get ¶
func (s *KeyringStore) Get(key string) (string, error)
Get retrieves the value stored under the given key.
func (*KeyringStore) Keys ¶
func (s *KeyringStore) Keys() ([]string, error)
Keys returns all keys currently stored in the keyring.
func (*KeyringStore) Set ¶
func (s *KeyringStore) Set(key, value string) error
Set stores a value under the given key. The item carries a label and a description because macOS shows the label in its access prompt: without one the dialog reads `olk wants to access key "" in your keychain`, which gives the person no way to tell which account or purpose is being asked about.
On macOS the name in that prompt is the item's access-control entry, which the keychain creates from the label when the item is first added and never changes on update, so the name only reaches items created after this label existed. Recreating an older item is not an option: the keychain lets only the application that created an item delete it, and a rebuilt or re-signed binary is a different application (error -25244). Signing out and back in recreates the item with the name.