jwt

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 7 Imported by: 2 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package jwt provides JWT-based authentication primitives — signing helpers, HMAC + RSA verifiers, claims parsing — used by the kit/auth HTTP + gRPC interceptors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FxModule

func FxModule() fx.Option

func NewHMACIssuer

func NewHMACIssuer(secretKey string) (*hmacIssuer, error)

func NewHMACIssuerFromEnv

func NewHMACIssuerFromEnv() (*hmacIssuer, error)

Types

type Claims

type Claims struct {
	AccountID  uuid.UUID
	Username   string
	ExpiryTime time.Time
}

Claims represents JWT claims

func (*Claims) Expiry

func (c *Claims) Expiry() time.Time

func (*Claims) Get

func (c *Claims) Get(key string) any

func (*Claims) Subject

func (c *Claims) Subject() string

type Issuer

type Issuer interface {
	Issue(ctx context.Context, accountID uuid.UUID, username string) (string, error)
}

Issuer issues JWT tokens

type IssuerValidator

type IssuerValidator interface {
	Issuer
	Validator
}

IssuerValidator combines issuer and validator

type Validator

type Validator interface {
	Validate(ctx context.Context, token string) (*Claims, error)
}

Validator validates JWT tokens

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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