restjwt

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "rest"

Variables

View Source
var (
	ErrStatusUnauthorized       = errors.New("status unauthorized")
	ErrInvalidServerCertificate = errors.New("invalid server certificate")
	ErrUnexpectedSigningMethod  = errors.New("unexpected signing method")
	ErrInvalidToken             = errors.New("invalid token")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Enable     bool   `env:"REST_JWT_ENABLE" default:"false" yaml:"enable" json:"enable"`
	ServerCert string `env:"SERVER_CERT" yaml:"serverCert" json:"serverCert"`
}

type Handler

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

func NewJwtHandler

func NewJwtHandler(l *logrus.Entry, cert string) (*Handler, error)

func (*Handler) Token

func (j *Handler) Token(reqToken string) (*jwt.Token, error)

func (*Handler) UserInfo

func (j *Handler) UserInfo(token *jwt.Token) Info

type Info

type Info struct {
	ID                string
	Email             string
	EmailVerified     bool
	FamilyName        string
	GivenName         string
	Name              string
	PreferredUsername string
}

type Plugin

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

func New

func New() *Plugin

func (*Plugin) Boot

func (p *Plugin) Boot(conf interface{}, dependencies ...interface{}) plugins.Plugin

func (*Plugin) Close

func (p *Plugin) Close() error

func (*Plugin) IsEnabled

func (p *Plugin) IsEnabled() bool

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) Start

func (p *Plugin) Start() error

Jump to

Keyboard shortcuts

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