Documentation
¶
Index ¶
Constants ¶
View Source
const (
Kind = constant.HTTPAuthJwtFilter
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ErrMsg string `yaml:"err_msg" json:"err_msg" mapstructure:"err_msg"` Rules []Rules `yaml:"rules" json:"rules" mapstructure:"rules"` Providers []Providers `yaml:"providers" json:"providers" mapstructure:"providers"` }
Config describe the config of FilterFactory
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
func (*Filter) Decode ¶
func (f *Filter) Decode(ctx *http.HttpContext) filter.FilterStatus
type FilterFactory ¶
type FilterFactory struct {
// contains filtered or unexported fields
}
FilterFactory is http filter instance
func (*FilterFactory) Apply ¶
func (factory *FilterFactory) Apply() error
func (*FilterFactory) Config ¶
func (factory *FilterFactory) Config() interface{}
func (*FilterFactory) PrepareFilterChain ¶
func (factory *FilterFactory) PrepareFilterChain(ctx *http.HttpContext, chain filter.FilterChain) error
type FromHeaders ¶
type FromHeaders struct { Name string `default:"Authorization" yaml:"name" json:"name" mapstructure:"name"` // header key ValuePrefix string `default:"Bearer " yaml:"value_prefix" json:"value_prefix" mapstructure:"value_prefix"` // header value }
FromHeaders Get the token from a field in the header,default Authorization: Bearer <token>
type Local ¶
type Local struct {
InlineString string `yaml:"inline_string" json:"inline_string" mapstructure:"inline_string"` // local jwks public key
}
type Match ¶
type Match struct {
Prefix string `yaml:"prefix" json:"prefix" mapstructure:"prefix"` // url
}
type Plugin ¶
type Plugin struct { }
Plugin is http filter plugin.
func (*Plugin) CreateFilterFactory ¶
func (p *Plugin) CreateFilterFactory() (filter.HttpFilterFactory, error)
type Providers ¶
type Providers struct { Name string `yaml:"name" json:"name" mapstructure:"name"` // jwt name ForwardPayloadHeader string `yaml:"forward_payload_header" json:"forward_payload_header" mapstructure:"forward_payload_header"` // header add issuer FromHeaders FromHeaders `yaml:"from_headers" json:"from_headers" mapstructure:"from_headers"` // from header get token Issuer string `yaml:"issuer" json:"issuer" mapstructure:"issuer"` // jwt issuer Local *Local `yaml:"local_jwks" json:"local_jwks" mapstructure:"local_jwks"` // local jwks Remote *Remote `yaml:"remote_jwks" json:"remote_jwks" mapstructure:"remote_jwks"` // remote jwks }
type Remote ¶
type Remote struct {
HttpURI HttpURI `yaml:"http_uri" json:"http_uri" mapstructure:"http_uri"` // remote jwks public key
}
type Requirement ¶
type Requirement struct {
ProviderName string `yaml:"provider_name" json:"provider_name" mapstructure:"provider_name"` // jwks providers name
}
type Requires ¶
type Requires struct { RequiresAny Requirement `yaml:"requires_any" json:"requires_any" mapstructure:"requires_any"` // single token check RequiresAll []Requirement `yaml:"requires_all" json:"requires_all" mapstructure:"requires_all"` // multiple token check,will only verify one, if the token fails, continue to the next check }
Click to show internal directories.
Click to hide internal directories.