Documentation
¶
Overview ¶
Package config stores the CLI settings, the session and the delete tokens.
Files live in $XDG_CONFIG_HOME/hemmelig (usually ~/.config/hemmelig). The CLI creates the directory with mode 0700 and the files with mode 0600, because they hold credentials.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteToken ¶
DeleteToken returns the stored delete token for a secret, if any.
func Dir ¶
Dir returns the configuration directory. HEMMELIG_CONFIG_DIR overrides it, which the tests use.
func ForgetDeleteToken ¶
ForgetDeleteToken removes the stored delete token for a secret.
func SaveDeleteToken ¶
SaveDeleteToken stores the delete token for a secret.
Types ¶
type Config ¶
type Config struct {
URL string `json:"url,omitempty"`
APIKey string `json:"apiKey,omitempty"`
Session *Session `json:"session,omitempty"`
}
Config is the content of config.json.
type Session ¶
type Session struct {
URL string `json:"url"`
Cookie string `json:"cookie"`
Username string `json:"username,omitempty"`
CreatedAt time.Time `json:"createdAt"`
}
Session is a signed-in session from `hemmelig login`.