middleware

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireAuth

func RequireAuth(next http.Handler) http.Handler

RequireAuth middleware ensures that a request has a valid authentication token

func RequireAuthWithLoginfy

func RequireAuthWithLoginfy(loginfy *core.Loginfy) func(http.Handler) http.Handler

RequireAuthWithLoginfy middleware validates JWT token and loads user into context This requires Loginfy to be configured with a session manager and storage

func RequirePermission

func RequirePermission(loginfy *core.Loginfy, permission string) func(http.Handler) http.Handler

RequirePermission middleware checks if user has specific permission in metadata Permissions are stored in user.Metadata["permissions"] as []string

func RequireRole

func RequireRole(loginfy *core.Loginfy, roles ...string) func(http.Handler) http.Handler

RequireRole middleware ensures the authenticated user has at least one of the specified roles

Types

This section is empty.

Jump to

Keyboard shortcuts

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