bearer

package
v0.228.2 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package bearer provides middleware that validates an Authorization: Bearer JWT against a jwks.KeySet and attaches the claims to the request context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClaimsFromContext

func ClaimsFromContext(ctx context.Context) *jwks.Claims

ClaimsFromContext returns the verified token claims, or nil if absent.

func Middleware

func Middleware(ks *jwks.KeySet, requireAudience string) func(http.Handler) http.Handler

Middleware enforces a verifiable bearer token on every wrapped handler. When requireAudience is non-empty the token's `aud` claim must contain that value (matches Auth0's tenant-API-audience binding). Empty preserves the "echoed, not enforced" behaviour the README documents for tests that swap audiences freely.

Types

This section is empty.

Jump to

Keyboard shortcuts

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