jwt

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package jwt provides convenience wiring around the stable JWT middleware.

The package aliases core JWT middleware types, reads JWT_* environment configuration, and exposes the same subject and health-check helpers. Import the core middleware directly when environment loading is not needed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HealthChecker

func HealthChecker(cfg Config, client *http.Client) ports.HealthChecker

HealthChecker returns a JWKS health checker.

func WithSubject

func WithSubject(ctx context.Context, subj Subject) context.Context

WithSubject stores the authenticated subject in context.

Types

type Config

type Config = jwtmw.Config

Config aliases the JWT middleware configuration.

func LoadConfig

func LoadConfig(loader *config.Loader) Config

LoadConfig reads JWT configuration from environment.

type Middleware

type Middleware = jwtmw.Middleware

Middleware aliases the JWT middleware.

func NewMiddleware

func NewMiddleware(ctx context.Context, cfg Config, log ports.Logger) (*Middleware, error)

NewMiddleware creates a JWT middleware.

type Subject

type Subject = jwtmw.Subject

Subject aliases the JWT subject payload.

func SubjectFromContext

func SubjectFromContext(ctx context.Context) (Subject, bool)

SubjectFromContext retrieves the subject from context.

Jump to

Keyboard shortcuts

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