Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuthFieldSpec ¶ added in v4.4.0
BasicAuthFieldSpec returns the spec for an HTTP BasicAuth component
func ClientFieldSpec ¶
ClientFieldSpec returns a field spec for an http client component.
func ServerCORSFieldSpec ¶
ServerCORSFieldSpec returns a field spec for an http server CORS component.
Types ¶
type BasicAuth ¶ added in v4.4.0
type BasicAuth struct {
Enabled bool `json:"enabled" yaml:"enabled"`
Username string `json:"username" yaml:"username"`
PasswordHash string `json:"password_hash" yaml:"password_hash"`
Realm string `json:"realm" yaml:"realm"`
Algorithm string `json:"algorithm" yaml:"algorithm"`
Salt string `json:"salt" yaml:"salt"`
}
BasicAuth contains the configuration fields for the HTTP BasicAuth
func NewBasicAuth ¶ added in v4.4.0
func NewBasicAuth() BasicAuth
NewBasicAuth returns a BasicAuth with default values
func (BasicAuth) Validate ¶ added in v4.4.0
Validate confirms that the BasicAuth is properly configured
func (BasicAuth) WrapHandler ¶ added in v4.4.0
func (b BasicAuth) WrapHandler(next http.HandlerFunc) http.HandlerFunc
WrapHandler wraps the provided HTTP handler with middleware that enforces BasicAuth if it's enabled.
type Config ¶
type Config struct {
URL string `json:"url" yaml:"url"`
Verb string `json:"verb" yaml:"verb"`
Headers map[string]string `json:"headers" yaml:"headers"`
Metadata metadata.IncludeFilterConfig `json:"metadata" yaml:"metadata"`
ExtractMetadata metadata.IncludeFilterConfig `json:"extract_headers" yaml:"extract_headers"`
RateLimit string `json:"rate_limit" yaml:"rate_limit"`
Timeout string `json:"timeout" yaml:"timeout"`
Retry string `json:"retry_period" yaml:"retry_period"`
MaxBackoff string `json:"max_retry_backoff" yaml:"max_retry_backoff"`
NumRetries int `json:"retries" yaml:"retries"`
BackoffOn []int `json:"backoff_on" yaml:"backoff_on"`
DropOn []int `json:"drop_on" yaml:"drop_on"`
SuccessfulOn []int `json:"successful_on" yaml:"successful_on"`
TLS tls.Config `json:"tls" yaml:"tls"`
ProxyURL string `json:"proxy_url" yaml:"proxy_url"`
auth.Config `json:",inline" yaml:",inline"`
OAuth2 auth.OAuth2Config `json:"oauth2" yaml:"oauth2"`
}
Config is a configuration struct for an HTTP client.
type ServerCORS ¶
type ServerCORS struct {
Enabled bool `json:"enabled" yaml:"enabled"`
AllowedOrigins []string `json:"allowed_origins" yaml:"allowed_origins"`
}
ServerCORS contains configuration for allowing CORS headers.
func NewServerCORS ¶
func NewServerCORS() ServerCORS
NewServerCORS returns a new server CORS config with default fields.
func (ServerCORS) WrapHandler ¶
WrapHandler wraps a provided HTTP handler with middleware that enables CORS requests (when configured).