Documentation ¶
Index ¶
Constants ¶
View Source
const REALM_STRING string = `Basic realm="Authorization Required"`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct { LoadUser LoadUserFunc // Returns a user from the backing store StoreUser StoreUserFunc // Stores a user to the backing store Hash crypto.Hash // Hash function to hash the salted password. Use at least SHA-2 (such as SHA-256, SHA-512, etc) SaltLength uint // Length of the generated salts. The generated salt should be at least the same length as the length of the output of the hash function. For example, it should be at least 256/8 = 32 for SHA-256 }
func (*Auth) BasicAuthMiddleware ¶
Middleware function for gin
func (*Auth) UpdateUser ¶
Salts and hashes the password, then calls StoreUser to write the new or updated user to the backing store
type LoadUserFunc ¶
type StoreUserFunc ¶
type StoreUserFunc func(user User)
Click to show internal directories.
Click to hide internal directories.