Documentation
¶
Overview ¶
Package middlewares provides an interface for middlewares and the middlewares themselves.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthForward ¶
type AuthForward struct {
// The address of the authentication server.
Address string `yaml:"address"`
// The headers to forward from the request to the authentication server.
// If this is nil, all headers will be forwarded.
RequestHeaders []string `yaml:"requestHeaders"`
// The headers to forward from the authentication server to the service.
ResponseHeaders []string `yaml:"responseHeaders"`
// Specifies whether to forward X-Forwarded-* headers to the authentication server.
XForwarded bool `yaml:"xForwarded"`
}
AuthForward is a middleware that forwards the request to an authentication server and proxies to the service if the authentication is successful.
type IPAllow ¶
type IPAllow []string
IPAllow is a middleware that only allows requests from a list of IP addresses. Accepts IPs in CIDR notation.
func NewIPAllow ¶
NewIPAllow creates a new IPAllow middleware.
type Middleware ¶
Middleware is an interface for all middlewares.
type Middlewares ¶
type Middlewares struct {
IPAllow *IPAllow `yaml:"ipAllow"`
AuthForward *AuthForward `yaml:"authForward"`
XForward *XForward `yaml:"xForward"`
}
Middlewares is an exhaustive structure of all middlewares.
func (*Middlewares) List ¶
func (c *Middlewares) List() []Middleware
List returns a list of middlewares that are not nil.
Click to show internal directories.
Click to hide internal directories.