Documentation ¶
Index ¶
- Constants
- func HashApr1(password string) (string, error)
- func HashBCrypt(password string) (string, error)
- func HashSha(password string) string
- func RemoveUser(file, user string) error
- func SetPassword(file, name, password string, algo Algorithm) error
- func SetPasswordHash(file, user, hash string) error
- type Accounts
- type Algorithm
Constants ¶
View Source
const ( // PasswordSeparator separates passwords from hashes PasswordSeparator = ":" // LineSeparator separates password records LineSeparator = "\n" )
View Source
const MaxHtpasswdFilesize = 8 * 1024 * 1024
MaxHtpasswdFilesize if your htpassd file is larger than 8MB, then your are doing it wrong
Variables ¶
This section is empty.
Functions ¶
func HashBCrypt ¶
func RemoveUser ¶
RemoveUser remove an existing user from a file, returns an error, if the user does not \ exist in the file
func SetPassword ¶
SetPassword set password for a user with a given hashing algorithm
func SetPasswordHash ¶
SetPasswordHash directly set a hash for a user in a file
Types ¶
type Accounts ¶
Accounts name => hash
func ParseHtpasswdFile ¶
ParseHtpasswdFile parse htpasswd file
func (Accounts) SetPassword ¶
SetPassword set a password for a user with a hashing algo
func (Accounts) WriteToFile ¶
WriteToFile put them to a file will be overwritten or created
Click to show internal directories.
Click to hide internal directories.