Documentation
¶
Overview ¶
Package credstore keeps passwords in the OS credential store, or in a file when no OS store is available.
Index ¶
Constants ¶
View Source
const EnvStore = "OPENARCH_CREDENTIAL_STORE"
EnvStore forces a backend: keychain or file.
View Source
const Service = "openarch"
Service is the label of the entries in the OS store.
Variables ¶
View Source
var ErrNotFound = errors.New("no stored password")
ErrNotFound means the store has no password for the URL and user.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
Path string
// contains filtered or unexported fields
}
File keeps passwords in a JSON file with mode 0600.
type Keychain ¶
type Keychain struct{}
Keychain uses the OS store: Keychain on macOS, Credential Manager on Windows, Secret Service over D-Bus on Linux.
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory is a store for tests.
type Store ¶
type Store interface {
Get(url, user string) (string, error)
Set(url, user, secret string) error
Delete(url, user string) error
// Name is "keychain", "file" or "memory".
Name() string
}
Store keeps one password per URL and user.
Click to show internal directories.
Click to hide internal directories.