Documentation
¶
Overview ¶
Package credentials keeps the API key the CLI signs requests with. Keys live in the operating system's keychain, and when no keychain is available (a headless Linux machine without a Secret Service, for example) in a file under the user's config directory that only the user can read.
Index ¶
Constants ¶
const Service = "dekka-cli"
Service is the keychain service name the CLI stores keys under. Each key is stored against the API URL it was verified with, so a key for one API is never sent to another.
Variables ¶
var ErrNotFound = errors.New("no key stored")
ErrNotFound means no key is stored for the API URL.
Functions ¶
This section is empty.
Types ¶
type Saved ¶
Saved says where Set put a key. KeychainErr is why the keychain refused it when the file was used instead.
type Store ¶
type Store struct {
Dir string
}
Store reads and writes keys. Dir is where the fallback file lives; it defaults to <user config dir>/dekka.
func (Store) Delete ¶
Delete removes the key for apiURL from the keychain and the file, and reports whether there was one to remove. A machine without a keychain has nothing stored there, so a keychain error only matters for the file.