validator

package
v0.0.0-...-200b26a Latest Latest
Warning

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

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

Documentation

Overview

Package validator provides structures responsible for validating tokens according to custom policies

Index

Constants

View Source
const (
	NOT = "NOT"
	ANY = "ANY"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type JwtTokenValidator

type JwtTokenValidator struct{}

JwtTokenValidator implements the TokenValidator

func (*JwtTokenValidator) Validate

func (*JwtTokenValidator) Validate(tokenStr string, tokenType Token, jwks keyset.KeySet, rules []v1.Rule, userInfoEndpoint string) *errors.OAuthError

Validate validates tokens according to the specified policies. If any policy fails, the entire request should be rejected

type OidcTokenValidator

type OidcTokenValidator struct{}

OidcTokenValidator implements the TokenValidator

func (*OidcTokenValidator) Validate

func (o *OidcTokenValidator) Validate(tokenStr string, tokenType Token, jwks keyset.KeySet, rules []v1.Rule, userInfoEndpoint string) *errors.OAuthError

Validate validates tokens according to the specified policies. If any policy fails, the entire request should be rejected

type RawTokens

type RawTokens struct {
	Access string
	ID     string
}

RawTokens - holds references to raw access and id tokens empty tokens are represented with ""

type Token

type Token int
const (
	Access Token = iota
	ID
)

func (Token) String

func (t Token) String() string

type TokenValidator

type TokenValidator interface {
	Validate(token string, tokenType Token, jwks keyset.KeySet, rules []v1.Rule, userInfoEndpoint string) *errors.OAuthError
}

TokenValidator parses and validates JWT tokens according to policies

func NewTokenValidator

func NewTokenValidator(policyType policy.Type) TokenValidator

New creates a New TokenValidator

type Validator

type Validator struct{}

Validator implements the TokenValidator

Jump to

Keyboard shortcuts

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