devheaders

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled         bool
	UserIDHeader    string
	EmailHeader     string
	FirstNameHeader string
	LastNameHeader  string
	DefaultLanguage string
}

Config controls dev header-based auth.

func LoadConfig

func LoadConfig(loader *config.Loader) Config

LoadConfig reads dev-auth header config from environment.

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

Middleware injects an auth subject in local environments without Clerk.

func New

func New(cfg Config, log ports.Logger) *Middleware

New constructs the middleware.

func (*Middleware) Handler

func (m *Middleware) Handler(next http.Handler) http.Handler

Handler attaches a subject from debug headers if Clerk is disabled.

func (*Middleware) OptionalHandler

func (m *Middleware) OptionalHandler(next http.Handler) http.Handler

OptionalHandler attaches a subject from debug headers if present, otherwise allows anonymous access.

Jump to

Keyboard shortcuts

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