Documentation
¶
Index ¶
Constants ¶
const AuthUserKey = "apiUser"
AuthUserKey is the key with which one can retrieve the authenticated apiUser from gin.Context
Variables ¶
var ErrorCryptBasicAuthUnsupportedHash = errors.New("unsupported crypt hash")
ErrorCryptBasicAuthUnsupportedHash is thrown if a hash is not supported by the crypt library
Functions ¶
func BasicAuth ¶
func BasicAuth(users map[string]string) gin.HandlerFunc
BasicAuth is a basic authorization middleware for Gin with crypt(3) support. Takes in a map of users and password hashes where each key is a user and the value is the hashed password. Successfully authenticated users username is stored in gin.Context using AuthUserKey.
Types ¶
This section is empty.