Documentation
¶
Index ¶
Constants ¶
View Source
const ( // MaxUsernameLength is the longest possible username MaxUsernameLength = 64 // MaxLoginLength is the longest possible login MaxLoginLength = 31 // MinPasswordLength is the shortest possible password MinPasswordLength = 8 // MaxPasswordLength is the shortest possible password MaxPasswordLength = 255 // UsernameCharRequirementMessage is basic username requirements UsernameCharRequirementMessage = "Username must contain only numbers, letters, commas, - or _" // UsernameMaxRequirementMessage is the basic username requirements UsernameMaxRequirementMessage = "UserName maximum length is %d" // LoginNonEmptyRequirementMessage is basic login requirements LoginNonEmptyRequirementMessage = "Login is required" // LoginMaxRequirementMessage is the basic login requirements LoginMaxRequirementMessage = "Login maximum length is %d" // LoginRegexRequirementMessage is the basic password requirements LoginRegexRequirementMessage = "Login must contain only numbers, letters, -, . or _" // PasswordMinRequirementMessage is the basic password requirements PasswordMinRequirementMessage = "Password must be at least %d characters long" // PasswordMaxRequirementMessage is the basic password requirements PasswordMaxRequirementMessage = "Password may be at most %d characters long" )
View Source
const (
// RequiredBundle the bundle needed to enable non-root user accounts
RequiredBundle = "sysadmin-basic"
)
Variables ¶
This section is empty.
Functions ¶
func IsSysDefaultUser ¶
IsSysDefaultUser checks if a given login is in the list of default users
func IsValidLogin ¶
IsValidLogin checks the minimum login requirements
func IsValidPassword ¶
IsValidPassword checks the minimum password requirements
func IsValidUsername ¶
IsValidUsername checks the username restrictions
Types ¶
type User ¶
type User struct { Login string `yaml:"login,omitempty"` UserName string `yaml:"username,omitempty,flow"` Password string `yaml:"password,omitempty,flow"` Admin bool `yaml:"admin,omitempty,flow"` SSHKeys []string `yaml:"ssh-keys,omitempty,flow"` }
User abstracts a target system definition
func (*User) Equals ¶
Equals returns true if u and usr point to the same struct or if both have the same Login string
func (*User) SetPassword ¶
SetPassword sets a users password
Click to show internal directories.
Click to hide internal directories.