validator

package
v1.0.47 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 12 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, ar *requests.AuthorizationRequest) (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) RegisterAuthProxy

func (v *TokenValidator) RegisterAuthProxy(cfg *authproxy.Config, authenticators []authproxy.Authenticator) error

RegisterAuthProxy registers authproxy.Authenticator 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