Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Basic ¶
Basic returns a middleware handler that injects auth.User into the request context upon successful basic authentication. The handler responds http.StatusUnauthorized when authentication fails.
func BasicFunc ¶
BasicFunc returns a middleware handler that injects auth.User into the request context upon successful basic authentication with the given function. The function should return true for a valid username and password combination.
func Bearer ¶
Bearer returns a middleware handler that injects auth.User (empty string) into the request context upon successful bearer authentication. The handler responds http.StatusUnauthorized when authentication fails.
func BearerFunc ¶
BearerFunc returns a middleware handler that injects auth.User (empty string) into the request context upon successful bearer authentication with the given function. The function should return true for a valid bearer token.
func SecureCompare ¶
SecureCompare performs a constant time compare of two strings to prevent timing attacks.