jwt

package
v1.0.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

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 HttpURI

type HttpURI struct {
	Uri     string `yaml:"uri" json:"uri" mapstructure:"uri"`
	Cluster string `yaml:"cluster" json:"cluster" mapstructure:"cluster"`
	TimeOut string `default:"5s" yaml:"timeout" json:"timeout" mapstructure:"timeout"`
}

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)

func (Plugin) Kind

func (p Plugin) Kind() string

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

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
}

type Rules

type Rules struct {
	Match    Match    `yaml:"match" json:"match" mapstructure:"match"`          // router
	Requires Requires `yaml:"requires" json:"requires" mapstructure:"requires"` // router requires jwks check
}

Rules router match

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL