validator

package
v1.3.16 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

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 added in v1.3.1

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

CacheUser adds a user to token validator cache.

func (*TokenValidator) Configure added in v1.3.1

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 added in v1.3.1

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

GetAuthCookies returns auth cookies registered with TokenValidator.

func (*TokenValidator) GetSourcePriority added in v1.3.1

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

GetSourcePriority returns the allowed token sources in their priority order.

func (*TokenValidator) SetSourcePriority added in v1.3.1

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