filter

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OIDCAccessTokenName = "oidc-access-token"
	OIDCTokenName       = "oidc-token"
	OIDCIDName          = "oidc-id_token"
)

Variables

View Source
var HeaderKeyRegex = regexp.MustCompile(`[^\w!#$%&'*+\-.^\x60|~]`)

Functions

func SafeHeader added in v0.4.0

func SafeHeader(s string) string

Types

type Chain

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

func NewChain

func NewChain(opts *Opts, key *passport.KeyProvider, filters ...ChainFilter) *Chain

func (*Chain) NewHandler added in v0.1.6

func (c *Chain) NewHandler(h http.Handler) http.Handler

type ChainFilter

type ChainFilter interface {
	DoFilter(http.ResponseWriter, *http.Request) (*ingress.UserInfo, error)
}

type Claims added in v0.4.0

type Claims map[string]interface{}

type OIDCCreateOpts

type OIDCCreateOpts struct {
	ClientID       string
	ClientSecret   string
	RedirectURL    string
	UserRedirect   string
	FetchUserInfo  bool
	CookieSameSite string
}

type OIDCFilter

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

func NewOIDCFilter

func NewOIDCFilter(ctx context.Context, baseURL string, issuerURL string, opt *OIDCCreateOpts) (*OIDCFilter, error)

func (*OIDCFilter) AddRoutes

func (f *OIDCFilter) AddRoutes(ctx context.Context, r *mux.Router)

func (*OIDCFilter) DoFilter

type Opts

type Opts struct {
	SubjectHeader    string // http header to put the user subject
	SourceHeader     string // http header to indicate what the subject means (e.g. to distinguish oauth2 vs pki)
	VerifyHeader     string // http header to put authenticity signature
	VerifyHashHeader string // http header to put authenticity hash
	// ClaimPrefixHeader is the prefix for http headers
	// containing user claims
	ClaimPrefixHeader string
	Append            bool
}

type PKIFilter

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

func NewPKIFilter

func NewPKIFilter(mode ingress.FilterMode, escapedHeader string, enforcing bool) *PKIFilter

func (*PKIFilter) DoFilter

func (f *PKIFilter) DoFilter(w http.ResponseWriter, r *http.Request) (*ingress.UserInfo, error)

Jump to

Keyboard shortcuts

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