validator

package
v1.3.24 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenValidator

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

TokenValidator validates tokens in http requests.

func NewTokenValidator

func NewTokenValidator() *TokenValidator

NewTokenValidator returns an instance of TokenValidator

func (*TokenValidator) Authorize

func (v *TokenValidator) Authorize(ctx context.Context, r *http.Request) (usr *user.User, err error)

Authorize authorizes HTTP requests based on the presence and the content of the tokens in the requests.

func (*TokenValidator) CacheUser

func (v *TokenValidator) CacheUser(usr *user.User) error

CacheUser adds a user to token validator cache.

func (*TokenValidator) Configure

func (v *TokenValidator) Configure(ctx context.Context, keys []*kms.CryptoKey, accessList *acl.AccessList, opts *options.TokenValidatorOptions) error

Configure adds access list and keys for the verification of tokens.

func (*TokenValidator) GetAuthCookies

func (v *TokenValidator) GetAuthCookies() map[string]interface{}

GetAuthCookies returns auth cookies registered with TokenValidator.

func (*TokenValidator) GetSourcePriority

func (v *TokenValidator) GetSourcePriority() []string

GetSourcePriority returns the allowed token sources in their priority order.

func (*TokenValidator) RegisterIdentityProvider added in v1.3.23

func (v *TokenValidator) RegisterIdentityProvider(cfg *idp.IdentityProviderConfig) error

RegisterIdentityProvider registers an identity provider with TokenValidator.

func (*TokenValidator) SetSourcePriority

func (v *TokenValidator) SetSourcePriority(arr []string) error

SetSourcePriority sets the order in which various token sources are being evaluated for the presence of keys. The default order is cookie, header, and query parameters.

Jump to

Keyboard shortcuts

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