Documentation
¶
Overview ¶
Package security provides password input methods and redaction for sensitive data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBecomeSupported ¶
func IsBecomeSupported() bool
IsBecomeSupported returns true if the current platform supports become (sudo)
func ResolvePassword ¶
func ResolvePassword(cfg PasswordConfig) (string, error)
ResolvePassword resolves the sudo password based on configuration Priority: Interactive > File > Env > CLI (if --insecure-sudo-pass)
Types ¶
type CLIPasswordProvider ¶
type CLIPasswordProvider struct {
Password string
}
CLIPasswordProvider wraps the existing --sudo-pass flag
func (*CLIPasswordProvider) GetPassword ¶
func (p *CLIPasswordProvider) GetPassword() (string, error)
func (*CLIPasswordProvider) Source ¶
func (p *CLIPasswordProvider) Source() string
type EnvPasswordProvider ¶
type EnvPasswordProvider struct {
ProgramPath string
}
EnvPasswordProvider executes SUDO_ASKPASS helper program
func (*EnvPasswordProvider) GetPassword ¶
func (p *EnvPasswordProvider) GetPassword() (string, error)
func (*EnvPasswordProvider) Source ¶
func (p *EnvPasswordProvider) Source() string
type FilePasswordProvider ¶
type FilePasswordProvider struct {
FilePath string
}
FilePasswordProvider reads password from a file
func (*FilePasswordProvider) GetPassword ¶
func (p *FilePasswordProvider) GetPassword() (string, error)
func (*FilePasswordProvider) Source ¶
func (p *FilePasswordProvider) Source() string
type InteractivePasswordProvider ¶
type InteractivePasswordProvider struct{}
InteractivePasswordProvider prompts the user for password input
func (*InteractivePasswordProvider) GetPassword ¶
func (p *InteractivePasswordProvider) GetPassword() (string, error)
func (*InteractivePasswordProvider) Source ¶
func (p *InteractivePasswordProvider) Source() string
type PasswordConfig ¶
type PasswordConfig struct {
CLIPassword string
AskInteractive bool
PasswordFile string
InsecureCLI bool
}
PasswordConfig holds configuration for password resolution
type PasswordProvider ¶
PasswordProvider defines an interface for obtaining sudo passwords
type Redactor ¶
type Redactor struct {
// contains filtered or unexported fields
}
Redactor provides thread-safe string redaction for sensitive values
func (*Redactor) AddSensitive ¶
AddSensitive adds a sensitive value to be redacted Empty strings are ignored