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
Click to show internal directories.
Click to hide internal directories.