middleware

package
v0.0.0-...-57af29b Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationMiddleware

type AuthorizationMiddleware struct {
	SkipPaths   map[string]struct{} // Paths to skip authorization check
	TokenHeader string              // Header field to read token from, e.g., "Authorization"
}

AuthorizationMiddleware is a middleware for handling authorization.

func NewAuthorizationMiddleware

func NewAuthorizationMiddleware(skipPaths []string) *AuthorizationMiddleware

NewAuthorizationMiddleware creates a new AuthorizationMiddleware. skipPaths: list of paths that don't require authorization

func (*AuthorizationMiddleware) Handle

func (a *AuthorizationMiddleware) Handle() echo.MiddlewareFunc

Handle implements the Middleware interface for AuthorizationMiddleware.

func (*AuthorizationMiddleware) ShouldSkip

func (a *AuthorizationMiddleware) ShouldSkip(path string) bool

ShouldSkip determines whether the middleware should skip a specific path.

Jump to

Keyboard shortcuts

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