Documentation ¶
Index ¶
- func AddUser(username string, password string) error
- func ChangePassword(username string, password string) error
- func HashPassword(password string) (string, error)
- func RemoveUser(username string) error
- func UserExists(username string) bool
- func ValidateUser(username string, password string) bool
- type UserData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUser ¶
Appends a user to the `users.toml`, The username must not be taken. The password will be hashed and a salt will be generated and stored alongside it.
Returns nil on success
func ChangePassword ¶
Edits the password record of a specific user. The user must exist.
Returns nil on success
func HashPassword ¶
Hashes a password to be stored in the users file, a salt is applied based on the salt specified in the config.
func UserExists ¶
Tests for existence of specified user in the user file
func ValidateUser ¶
Tests a raw password and username against the credentials in the `users.toml` file.
Types ¶
Click to show internal directories.
Click to hide internal directories.