Documentation ¶
Index ¶
Constants ¶
View Source
const (
RegexPrefix = "r#"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BasicAuth ¶
type BasicAuth struct {
// contains filtered or unexported fields
}
BasicAuth make sure the request is allowed to be sent to backend Use apache htpasswd utility for generating passwords e.g. htpasswd -nB user Middleware will look for Authorization header for credentials value should be "Basic <base64encoded user:password>"
func (BasicAuth) Info ¶
func (w BasicAuth) Info() *middleware.MiddlewareInfo
type Config ¶
type Config struct { Users []Credentials `yaml:"users" mapstructure:"users"` // TODO take a file instead of embedded users in yaml UserDB string `yaml:"userdb" mapstructure:"userdb"` // Scope is optional and used for additional policy based // authorization over user Scope Scope `yaml:"scope" mapstructure:"scope"` }
type Credentials ¶
type Credentials struct { User string `yaml:"user" mapstructure:"user"` // Password must be hashed using MD5, SHA1, or BCrypt(recommended) using htpasswd Password string `yaml:"password" mapstructure:"password"` // Capabilities are optional and used with scope for applying authz // Supports regular expr if marked with r# as a prefix Capabilities []string `yaml:"capabilities" mapstructure:"capabilities"` }
Click to show internal directories.
Click to hide internal directories.