Documentation ¶
Overview ¶
Package basicauth implements HTTP Basic Authentication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicAuth ¶
type BasicAuth struct { Next middleware.Handler SiteRoot string Rules []Rule }
BasicAuth is middleware to protect resources with a username and password. Note that HTTP Basic Authentication is not secure by itself and should not be used to protect important assets without HTTPS. Even then, the security of HTTP Basic Auth is disputed. Use discretion when deciding what to protect with BasicAuth.
type PasswordMatcher ¶ added in v0.7.6
PasswordMatcher determines whether a password matches a rule.
func GetHtpasswdMatcher ¶ added in v0.7.6
func GetHtpasswdMatcher(filename, username, siteRoot string) (PasswordMatcher, error)
GetHtpasswdMatcher matches password rules.
func PlainMatcher ¶ added in v0.7.6
func PlainMatcher(passw string) PasswordMatcher
PlainMatcher returns a PasswordMatcher that does a constant-time byte-wise comparison.
Click to show internal directories.
Click to hide internal directories.