validator

package
v0.4.20 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultValidator added in v0.4.0

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

Validator does parsing and validation of JWT token

func NewDefaultValidator added in v0.4.0

func NewDefaultValidator(publicKey []byte, validateClaims func(*jwt.MapClaims) (*jwt.MapClaims, error)) (*DefaultValidator, error)

NewDefaultValidator returns a new validator by parsing the given file path as an ED25519 public key

func (*DefaultValidator) GetClaims added in v0.4.0

func (d *DefaultValidator) GetClaims(tokenString string) (*jwt.MapClaims, error)

GetClaims parses and validates the given JWT token string

func (*DefaultValidator) GetToken added in v0.4.0

func (d *DefaultValidator) GetToken(tokenString string) (*jwt.Token, error)

GetToken parses the given JWT token string

type Logger

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

func NewLogger added in v0.3.4

func NewLogger(logger commonlogger.Logger) Logger

NewLogger creates a new JWT validator logger

func (Logger) ValidatedToken

func (l Logger) ValidatedToken()

ValidatedToken logs a message when the server validates a token

type Validator

type Validator interface {
	GetToken(tokenString string) (*jwt.Token, error)
	GetClaims(tokenString string) (*jwt.MapClaims, error)
}

Validator does parsing and validation of JWT token

Jump to

Keyboard shortcuts

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