auth

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const AuthTypeBearer string = "bearer"

Variables

View Source
var (
	ErrMissingAuthHeader   = errors.New("missing authorization header")
	ErrBadFormatAuthHeader = errors.New("invalid format for authorization header")
)

Functions

This section is empty.

Types

type BasicAuthValidator added in v0.0.26

type BasicAuthValidator struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

func NewBasicAuthValidator added in v0.0.26

func NewBasicAuthValidator(conf *config.BasicAuthConfig) (*BasicAuthValidator, error)

func (BasicAuthValidator) ValidateToken added in v0.0.26

func (v BasicAuthValidator) ValidateToken(request *http.Request) (map[string]interface{}, error)

type JWTValidator

type JWTValidator struct {
	JWKS jwk.Set
	// contains filtered or unexported fields
}

func NewJWTValidator

func NewJWTValidator(cfg *config.JWTConfig, opts ...JWTValidatorOption) (*JWTValidator, error)

func (JWTValidator) ValidateToken

func (v JWTValidator) ValidateToken(request *http.Request) (map[string]interface{}, error)

type JWTValidatorOption added in v0.0.31

type JWTValidatorOption func(*JWTValidator)

type TokenValidator

type TokenValidator interface {
	ValidateToken(request *http.Request) (map[string]interface{}, error)
}

func GetTokenValidator

func GetTokenValidator(conf config.AuthConfig) (TokenValidator, error)

Jump to

Keyboard shortcuts

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