Documentation
¶
Index ¶
- Variables
- type OSAuth
- func (l *OSAuth) AuthUser(username, password string) bool
- func (l *OSAuth) AuthUserFromShadow(username string, password string, shadow io.Reader) bool
- func (l *OSAuth) LookupUser(username string) *User
- func (l *OSAuth) LookupUserFromPasswd(username string, passwd io.Reader) (*User, error)
- func (l *OSAuth) VerifyPasswordHash(hash, password string) bool
- type OSAuther
- type ShadowEntry
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPasswdFilename = "/etc/passwd"
View Source
var DefaultShadowFilename = "/etc/shadow"
View Source
var ErrUserNotFound = errors.New("user not found")
ErrUserNotFound is returned when the user is not found in the passwd file.
Functions ¶
This section is empty.
Types ¶
type OSAuth ¶ added in v0.13.0
type OSAuth struct{}
func (*OSAuth) AuthUserFromShadow ¶ added in v0.13.0
AuthUserFromShadow checks if the given username and password are valid for the given shadow file.
func (*OSAuth) LookupUser ¶ added in v0.13.0
func (*OSAuth) LookupUserFromPasswd ¶ added in v0.13.0
LookupUserFromPasswd reads the passwd file from the given reader and returns the user, if found. TODO: Use this function inside the LookupUser.
func (*OSAuth) VerifyPasswordHash ¶ added in v0.13.0
type ShadowEntry ¶
type ShadowEntry struct {
Username string // Login name
Password string // Hashed password
Lastchanged int // Days since Jan 1, 1970 that password was last changed
Minimum int // The minimum number of days required between password changes i.e. the number of days left before the user is allowed to change his/her password
Maximum int // The maximum number of days the password is valid (after that user is forced to change his/her password)
Warn int // The number of days before password is to expire that user is warned that his/her password must be changed
Inactive int // The number of days after password expires that account is disabled
Expire int // Days since Jan 1, 1970 that account is disabled i.e. an absolute date specifying when the login may no longer be used.
}
Click to show internal directories.
Click to hide internal directories.