Documentation
¶
Index ¶
Constants ¶
View Source
const ContextLoginKey = "echo-basic-auth.login"
ContextLoginKey is the key used to store the login after successful auth in the context
Variables ¶
This section is empty.
Functions ¶
func NewMiddleware ¶
func NewMiddleware(auths ...*Auth) echo.MiddlewareFunc
NewMiddleware returns a new BasicAuth middleware instance
func NewValidator ¶
func NewValidator(auths ...*Auth) middleware.BasicAuthValidator
NewValidator returns a new BasicAuthValidator
Types ¶
type Auth ¶
type Auth struct {
Login string `json:"login" yaml:"login"` // Basic auth login
Password string `json:"password" yaml:"password"` //nolint:gosec // this is an auth model, the field is intentional
IPs []string `json:"ips" yaml:"ips"` // Allowed IPs and CIDRs
// contains filtered or unexported fields
}
Auth model
Click to show internal directories.
Click to hide internal directories.