Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BasicRealm = "Authorization Required"
BasicRealm is used when setting the WWW-Authenticate response header.
Functions ¶
func Basic ¶
Basic returns a Handler that authenticates via Basic Auth. Writes a http.StatusUnauthorized if authentication fails.
func BasicFunc ¶
BasicFunc returns a Handler that authenticates via Basic Auth using the provided function. The function should return true for a valid username/password combination.
func Bearer ¶
func Bearer(token string) macaron.Handler
Bearer returns a Handler that authenticates via Bearer Auth. Writes a http.StatusUnauthorized if authentication fails.
func BearerFunc ¶
BearerFunc returns a Handler that authenticates via Bearer Auth using the provided function. The function should return true for a valid bearer token.
func SecureCompare ¶
SecureCompare performs a constant time compare of two strings to limit timing attacks.