auth

package
v0.0.0-...-48d9f46 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

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

Middleware provides HTTP authentication middleware

func NewMiddleware

func NewMiddleware(token string) (*Middleware, error)

NewMiddleware creates a new auth middleware SECURITY: Returns error if token is empty to prevent silent bypass

func (*Middleware) ChiMiddleware

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

ChiMiddleware provides Chi-style middleware function. It delegates to Handler, which has the same signature.

func (*Middleware) Handler

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

Handler returns an HTTP handler that enforces authentication

func (*Middleware) RequireAuth

func (m *Middleware) RequireAuth(handlerFunc http.HandlerFunc) http.HandlerFunc

RequireAuth wraps a handler function with authentication

Jump to

Keyboard shortcuts

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