Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
)Functions ¶
func Basic ¶
func Basic(configs ...BasicConfig) ngamux.MiddlewareFunc
Types ¶
type BasicConfig ¶
type BasicConfig struct { Authorizer func(username string, password string) bool ErrorHandler func(rw http.ResponseWriter, err error) error Realm string Creds map[string]string }
BasicConfig is a configuration used in Basic function for basic authentication middleware. If credentials, authorizer, or errorhandler is not provided, it uses the default one when passed as an argument to Basic function. For default crendetials, there is default root:root credential stored inside a map with this format `username=password`. You can also provide a realm name for the challenge authentication method.
Click to show internal directories.
Click to hide internal directories.