auth

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(cfg *config.Config) echo.MiddlewareFunc

AuthMiddleware creates authentication middleware

func GetConfigFromContext

func GetConfigFromContext(c echo.Context) *config.Config

GetConfigFromContext retrieves config from Echo context

func RequirePermission

func RequirePermission(permission string) echo.MiddlewareFunc

RequirePermission creates permission-checking middleware

func UserOwnsSession

func UserOwnsSession(c echo.Context, sessionUserID string) bool

UserOwnsSession checks if the current user owns the specified session

Types

type UserContext

type UserContext struct {
	UserID      string
	Role        string
	Permissions []string
	APIKey      string
}

UserContext represents the authenticated user context

func GetUserFromContext

func GetUserFromContext(c echo.Context) *UserContext

GetUserFromContext retrieves user context from Echo context

Jump to

Keyboard shortcuts

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