jwt

package
v2.5.5 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoToken = ErrUnauthorized.Wrap(errors.New("no token"))

ErrNoToken unwraps to ErrUnauthorized

View Source
var ErrUnauthorized = echo.NewHTTPError(http.StatusUnauthorized, "unauthorized")

Functions

func Middleware added in v2.5.5

func Middleware[Claims any](opts MiddlewareOptions[Claims]) echo.MiddlewareFunc

func NewBuilder added in v2.5.5

func NewBuilder() *jwt.Builder

func ParseJWT added in v2.5.5

func ParseJWT[T any](ctx context.Context, verifier *TokenVerifier, rawToken string) (T, jwt.Token, error)

ParseJWT parses and validates the provided token. The claims are then parsed into the provided type T and returned on success.

Types

type MiddlewareOptions added in v2.5.5

type MiddlewareOptions[Claims any] struct {
	TokenVerifier *TokenVerifier
	UpdateContext func(c *echo.Context, token jwt.Token, claims Claims) error
}

type Token added in v2.5.5

type Token = jwt.Token

type TokenVerifier added in v2.5.5

type TokenVerifier struct {
	Close context.CancelFunc
	// contains filtered or unexported fields
}

func NewTokenVerifier added in v2.5.5

func NewTokenVerifier(ctx context.Context, url string) (*TokenVerifier, error)

func (*TokenVerifier) Verify added in v2.5.5

func (v *TokenVerifier) Verify(ctx context.Context, rawToken string) (jwt.Token, error)

Jump to

Keyboard shortcuts

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