Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUserNotFound = errors.New("user not found") ErrIncorrectPassword = errors.New("password does not match stored hash") )
Functions ¶
This section is empty.
Types ¶
type AuthStore ¶
type AuthStore interface {
ReadPasswordHash(username string) (PasswordHash, error)
}
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
func New ¶
func New(store AuthStore) Authenticator
func (Authenticator) Authenticate ¶
func (a Authenticator) Authenticate(username, password string) error
type PasswordHash ¶
func HashPassword ¶
func HashPassword(plaintext string) (PasswordHash, error)
Hash a plaintext password into a secure password hash.
func PasswordHashFromBytes ¶
func PasswordHashFromBytes(bytes []byte) PasswordHash
Converts raw bytes into a password hash. Note that this doesn't perform a hash on the bytes. The bytes represent an already-hashed password.
Click to show internal directories.
Click to hide internal directories.