Documentation
¶
Overview ¶
Package config handles user inputs/UI elements.
Package config handles user inputs/UI elements.
Package config handles user inputs/UI elements.
Index ¶
- Constants
- Variables
- func CanColor() (bool, error)
- func Environ() []string
- func ExpandParsed(inputs map[string]string) (map[string]string, error)
- func GetReKey(args []string) ([]string, error)
- func IsUnset(k, v string) (bool, error)
- func ListEnvironmentVariables() []string
- func NewEnvFiles() ([]string, error)
- func Wrap(indent uint, in string) string
- type AskPassword
- type ColorWindow
- type CompletionProfile
- type EnvironmentBool
- type EnvironmentCommand
- type EnvironmentFormatter
- type EnvironmentInt
- type EnvironmentString
- type JSONOutputMode
- type Key
- type KeyModeType
- type SystemPlatform
Constants ¶
const ( // MacOSPlatform is the macos indicator for platform MacOSPlatform = "macos" // LinuxWaylandPlatform for linux+wayland LinuxWaylandPlatform = "linux-wayland" // LinuxXPlatform for linux+X LinuxXPlatform = "linux-x" // WindowsLinuxPlatform for WSL subsystems WindowsLinuxPlatform = "wsl" // ReKeyStoreFlag is the flag used for rekey to set the store ReKeyStoreFlag = "store" // ReKeyKeyFileFlag is the flag used for rekey to set the keyfile ReKeyKeyFileFlag = "keyfile" // ReKeyKeyFlag is the flag used for rekey to set the key ReKeyKeyFlag = "key" // ReKeyKeyModeFlag is the flag used for rekey to set the key mode ReKeyKeyModeFlag = "keymode" // YesValue are yes (on) values YesValue = yes )
Variables ¶
var ( // Platforms represent the platforms that lockbox understands to run on Platforms = []string{MacOSPlatform, WindowsLinuxPlatform, LinuxXPlatform, LinuxWaylandPlatform} // TOTPDefaultColorWindow is the default coloring rules for totp TOTPDefaultColorWindow = []ColorWindow{{Start: 0, End: 5}, {Start: 30, End: 35}} // TOTPDefaultBetween is the default color window as a string TOTPDefaultBetween = toString(TOTPDefaultColorWindow) // EnvClipMax gets the maximum clipboard time EnvClipMax = EnvironmentInt{ // contains filtered or unexported fields } // EnvHashLength handles the hashing output length EnvHashLength = EnvironmentInt{ // contains filtered or unexported fields } // EnvClipOSC52 indicates if OSC52 clipboard mode is enabled EnvClipOSC52 = EnvironmentBool{ // contains filtered or unexported fields } // EnvNoTOTP indicates if TOTP is disabled EnvNoTOTP = EnvironmentBool{ // contains filtered or unexported fields } // EnvReadOnly indicates if in read-only mode EnvReadOnly = EnvironmentBool{ // contains filtered or unexported fields } // EnvNoClip indicates clipboard functionality is off EnvNoClip = EnvironmentBool{ // contains filtered or unexported fields } // EnvDefaultCompletion disable completion detection EnvDefaultCompletion = EnvironmentBool{ // contains filtered or unexported fields } // EnvDefaultCompletionKey is the key for default completion handling EnvDefaultCompletionKey = EnvDefaultCompletion.key() // EnvNoColor indicates if color outputs are disabled EnvNoColor = EnvironmentBool{ // contains filtered or unexported fields } // EnvInteractive indicates if operating in interactive mode EnvInteractive = EnvironmentBool{ // contains filtered or unexported fields } // EnvMaxTOTP is the max TOTP time to run (default) EnvMaxTOTP = EnvironmentInt{ // contains filtered or unexported fields } // EnvTOTPToken is the leaf token to use to store TOTP tokens EnvTOTPToken = EnvironmentString{ // contains filtered or unexported fields } // EnvPlatform is the platform that the application is running on EnvPlatform = EnvironmentString{ // contains filtered or unexported fields } // EnvStore is the location of the keepass file/store EnvStore = EnvironmentString{ // contains filtered or unexported fields } // EnvHookDir is the directory of hooks to execute EnvHookDir = EnvironmentString{ // contains filtered or unexported fields } // EnvClipCopy allows overriding the clipboard copy command EnvClipCopy = EnvironmentCommand{ // contains filtered or unexported fields } // EnvClipPaste allows overriding the clipboard paste command EnvClipPaste = EnvironmentCommand{ // contains filtered or unexported fields } // EnvTOTPColorBetween handles terminal coloring for TOTP windows (seconds) EnvTOTPColorBetween = EnvironmentString{ // contains filtered or unexported fields } // EnvKeyFile is an keyfile for the database EnvKeyFile = EnvironmentString{ // contains filtered or unexported fields } // EnvModTime is modtime override ability for entries EnvModTime = EnvironmentString{ // contains filtered or unexported fields } // EnvJSONDataOutput controls how JSON is output in the 'data' field EnvJSONDataOutput = EnvironmentString{ // contains filtered or unexported fields } // EnvFormatTOTP supports formatting the TOTP tokens for generation of tokens EnvFormatTOTP = EnvironmentFormatter{ // contains filtered or unexported fields } // EnvConfig is the location of the config file to read environment variables from EnvConfig = EnvironmentString{ // contains filtered or unexported fields } )
Functions ¶
func ExpandParsed ¶
ExpandParsed handles cycles of parsing configuration env inputs to resolve ALL variables
func IsUnset ¶
IsUnset will indicate if a variable is an unset (and unset it) or return that it isn't
func ListEnvironmentVariables ¶
func ListEnvironmentVariables() []string
ListEnvironmentVariables will print information about env variables
func NewEnvFiles ¶
NewEnvFiles will get the list of candidate environment files it will also set the environment to empty for the caller
Types ¶
type AskPassword ¶
AskPassword is a function to prompt for passwords (when required)
type ColorWindow ¶
ColorWindow for handling terminal colors based on timing
func ParseColorWindow ¶
func ParseColorWindow(windowString string) ([]ColorWindow, error)
ParseColorWindow will handle parsing a window of colors for TOTP operations
type CompletionProfile ¶
type CompletionProfile struct { Clip bool TOTP bool List bool Write bool Name string Env []string Default bool }
CompletionProfile are shell completion definitions with backing environment information
func LoadCompletionProfiles ¶
func LoadCompletionProfiles() []CompletionProfile
LoadCompletionProfiles will generate known completion profile with backing env information
type EnvironmentBool ¶
type EnvironmentBool struct {
// contains filtered or unexported fields
}
EnvironmentBool are environment settings that are booleans
func (EnvironmentBool) Get ¶
func (e EnvironmentBool) Get() (bool, error)
Get will get the boolean value for the setting
type EnvironmentCommand ¶
type EnvironmentCommand struct {
// contains filtered or unexported fields
}
EnvironmentCommand are settings that are parsed as shell commands
func (EnvironmentCommand) Get ¶
func (e EnvironmentCommand) Get() ([]string, error)
Get will read (and shlex) the value if set
type EnvironmentFormatter ¶
type EnvironmentFormatter struct {
// contains filtered or unexported fields
}
EnvironmentFormatter allows for sending a string into a get request
func (EnvironmentFormatter) Get ¶
func (e EnvironmentFormatter) Get(value string) string
Get will retrieve the value with the formatted input included
type EnvironmentInt ¶
type EnvironmentInt struct {
// contains filtered or unexported fields
}
EnvironmentInt are environment settings that are integers
func (EnvironmentInt) Get ¶
func (e EnvironmentInt) Get() (int, error)
Get will get the integer value for the setting
type EnvironmentString ¶
type EnvironmentString struct {
// contains filtered or unexported fields
}
EnvironmentString are string-based settings
func (EnvironmentString) Get ¶
func (e EnvironmentString) Get() string
Get will read the string from the environment
type JSONOutputMode ¶
type JSONOutputMode string
JSONOutputMode is the output mode definition
const ( // ModTimeFormat is the expected modtime format ModTimeFormat = time.RFC3339 // JSONDataOutputHash means output data is hashed JSONDataOutputHash JSONOutputMode = "hash" // JSONDataOutputBlank means an empty entry is set JSONDataOutputBlank JSONOutputMode = "empty" // JSONDataOutputRaw means the RAW (unencrypted) value is displayed JSONDataOutputRaw JSONOutputMode = "plaintext" )
func ParseJSONOutput ¶
func ParseJSONOutput() (JSONOutputMode, error)
ParseJSONOutput handles detecting the JSON output mode
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is a wrapper to help manage the returned key
type KeyModeType ¶
type KeyModeType string
KeyModeType are valid ways to get the key
const ( // IgnoreKeyMode will ignore the value set in the key (acts like no key) IgnoreKeyMode KeyModeType = "ignore" // DefaultKeyMode is the default operating keymode if NOT set DefaultKeyMode = commandKeyMode )
type SystemPlatform ¶
type SystemPlatform string
SystemPlatform represents the platform lockbox is running on.
func NewPlatform ¶
func NewPlatform() (SystemPlatform, error)
NewPlatform gets a new system platform.