Documentation
¶
Overview ¶
Package access provides access control middleware and utilities for the application.
Package access provides access control middleware and utilities for the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware(manager *Manager, _ logging.Logger) echo.MiddlewareFunc
Middleware creates a new access control middleware
func TestMatchPathPattern ¶
func TestMatchPathPattern()
TestMatchPathPattern is a simple test function to verify pattern matching
Types ¶
type Config ¶
type Config struct {
// DefaultAccess is the default access level for routes
DefaultAccess Level
// PublicPaths are paths that are always accessible
PublicPaths []string
// AdminPaths are paths that require admin access
AdminPaths []string
}
Config holds the configuration for the access middleware
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages access control rules
func NewManager ¶
NewManager creates a new access manager
func (*Manager) GetRequiredAccess ¶
GetRequiredAccess returns the required access level for a path and method
func (*Manager) IsAdminPath ¶
IsAdminPath checks if a path requires admin access
func (*Manager) IsPublicPath ¶
IsPublicPath checks if a path is public
Click to show internal directories.
Click to hide internal directories.