Documentation ¶
Overview ¶
Package kfdb implements a database of sensitive values maintained by keyfish.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoSettings = errors.New("settings key not found")
ErrNoSettings is reported by UnmarshalSettings if the requested settings key is not defined on the database.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct { // Defaults are default values for certain record fields. Defaults *Defaults `json:"defaults,omitempty"` // Settings is an opaque collection of tool-specific settings. Each tool // should use its own unique key in this map. The format of the value is the // responsibility of the tool that defines it. Settings map[string]json.RawMessage `json:"settings,omitempty"` // Records are the data records contained in the database. Records []*Record `json:"records,omitempty"` }
A DB is a database of sensitive data managed by keyfish.
func (*DB) MarshalSettings ¶
MarshalSettings marshals the specified value into the settings map under key, replacing any existing value for that key.
type Defaults ¶
type Defaults struct { // Username, if set, is used as the default username for records that do not // provide one. Username string `json:"username,omitempty"` // Addr, if set, is used as the default e-mail address for records that do // not provide one. Addr string `json:"addr,omitempty"` // Hashpass, if set, contains defaults for the hashpass generator. Hashpass *Hashpass `json:"hashpass,omitempty"` }
Defaults are default values applied to records that do not define their own values for certain fields.
type Detail ¶
type Detail struct { // Label is a human-readable label for the detail. Label string `json:"label"` // Hidden, if true, indicates the value is sensitive and should not be // displayed plainly unless the user requests it. Hidden bool `json:"hidden,omitempty"` // Value is the display content of the detail. Value string `json:"value"` }
Detail is a labelled data annotation for a record.
type Hashpass ¶
type Hashpass struct { // SecretKey, if set, is used as the hashpass generator key. SecretKey string `json:"secretKey,omitempty"` // Seed is the seed used for password generation. If empty, the first // element of the Hosts for the record is used. Seed string `json:"seed,omitempty"` // Length specifies the length of the generated password in characters. // If zero, the default length is used. Length int `json:"length,omitempty"` // Punct, if non-nil, specifies whether punctuation should be included in // the generated password. Punct *bool `json:"punct,omitempty"` }
Hashpass contains settings for a HKDF password generator.
type Record ¶
type Record struct { // Label is a short identifier for this record. Label string `json:"label,omitempty"` // Title is a human-readable title for this record. Title string `json:"title,omitempty"` // Username is the user name or login associated with this record. Username string `json:"username,omitempty"` // Hosts are optional hostnames associated with this record. Hosts Strings `json:"hosts,omitempty"` // Addrs are e-mail addresses associated with this record. Addrs Strings `json:"addrs,omitempty"` // Tags are optional query tags associated with this record. Tags []string `json:"tags,omitempty"` // Notes are optional human-readable notes. Notes string `json:"notes,omitempty"` // Details are optional labelled data annotations. Details []*Detail `json:"details,omitempty"` // Hashpass, if non-nil, is a configuration for a hashed password. Hashpass *Hashpass `json:"hashpass,omitempty"` // Password, if non-empty, is a generated password. Password string `json:"password,omitempty"` // OTP, if non-nil, is used to generate one-time 2FA codes. OTP *otpauth.URL `json:"otp,omitempty"` // Archived, if true, indicates the record is archived and should not be // shown in default listings and search results. Archived bool `json:"archived,omitempty"` }
A Record records an item of interest such as a login account.
Click to show internal directories.
Click to hide internal directories.