jwtHandler

package
v0.0.0-...-1d800d4 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSignatureInvalid = &errors.UnauthorizedError{
		Reason: "jwt signature is invalid",
	}
	ErrTokenMalformed = &errors.UnauthorizedError{
		Reason: "jwt is malformed",
	}
	ErrPayloadMalformed = &errors.UnauthorizedError{
		Reason: "jwt payload is malformed",
	}
	ErrPayloadDecodingFailed = &errors.UnauthorizedError{
		Reason: "jwt payload decoding failed",
	}
)

Functions

This section is empty.

Types

type JWT

type JWTHandler

type JWTHandler[T JWT] struct {
	// contains filtered or unexported fields
}

func New

func New[T JWT](options jwtOptions.JWTOptions, newClaims NewClaims[T]) *JWTHandler[T]

func (*JWTHandler[T]) New

func (h *JWTHandler[T]) New() T

func (*JWTHandler[T]) Parse

func (h *JWTHandler[T]) Parse(blob []byte, now time.Time) (T, error)

func (*JWTHandler[T]) ParseInto

func (h *JWTHandler[T]) ParseInto(t T, blob []byte, now time.Time) error

func (*JWTHandler[T]) SetExpiryAndSign

func (h *JWTHandler[T]) SetExpiryAndSign(claims T) (string, error)

type NewClaims

type NewClaims[T JWT] func() T

Jump to

Keyboard shortcuts

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