Documentation
¶
Overview ¶
Package keychain reads and deletes the legacy items of mai in the system keychain: the macOS Keychain, the Windows Credential Manager, or the Linux Secret Service.
mai 3.0 and 3.1 kept the owner key and the agent keys in the keychain. The CLI now keeps them in its key file. This package is only for the move of the legacy items to the key file and for the removal of the legacy items. It never writes an item.
The service is "dev.mai". The accounts are "owner@<instance>" and "agent:<name>@<instance>".
Index ¶
Constants ¶
const Service = "dev.mai"
Service is the keychain service of each legacy item of mai.
Variables ¶
var ErrNotFound = errors.New("keychain: item not found")
ErrNotFound means that the item does not exist.
ErrUnavailable means that this system has no keychain that the CLI can use, for example a Linux host with no Secret Service. Such a keychain holds no item of mai.
Functions ¶
This section is empty.
Types ¶
type Memory ¶
type Memory struct {
Err error
// contains filtered or unexported fields
}
Memory is a Store in memory, for tests. When Err is not nil, each call gives Err.
type Store ¶
type Store interface {
// Get reads the secret of the item of account.
Get(account string) (string, error)
// Has tells if the item of account exists. When it can, it reads no secret and shows no
// prompt.
Has(account string) (bool, error)
// Delete removes the item of account. It gives ErrNotFound when the item does not exist.
Delete(account string) error
}
Store gives access to the legacy items of Service. An implementation never prints or logs a secret.