Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidUser = errors.New("user is invalid") ErrFailedToParseBasicAuth = errors.New("the provided basic authentication credentials are invalid") ErrMetadataNotFound = errors.New("metadata not found") ErrAuthHeaderNotFound = errors.New("authorization header not found") ErrFailedToDecodeBasicAuth = errors.New("failed to decode authorization header") ErrAuthHeaderInvalidFormat = errors.New("invalid authorization header format") ErrInvalidPassword = errors.New("password is invalid") )
Functions ¶
func CompareBasicAuth ¶
CompareBasicAuth compares a stored credential (username:password_hash) with a provided username and password. It uses bcrypt to securely compare the password hash stored in the credential with the provided password.
func ExtractBasicAuth ¶ added in v1.2.0
ExtractBasicAuth extracts the user and password or password hash from the given basic auth credential. The credential should be in the form "user:password" or "user:password_hahs".
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.