middleware

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionContextKey     contextKey = "session"
	ForgejoAuthContextKey contextKey = "forgejo_auth"
)

Variables

This section is empty.

Functions

func GetForgejoAuth

func GetForgejoAuth(ctx context.Context) *model.ForgejoAuth

GetForgejoAuth retrieves the ForgejoAuth from request context

func GetSession

func GetSession(ctx context.Context) *session.Session

GetSession retrieves the session from request context

Types

type AuthMiddleware

type AuthMiddleware struct {
	// contains filtered or unexported fields
}

AuthMiddleware validates user sessions

func NewAuthMiddleware

func NewAuthMiddleware(sessionManager *session.Manager, forgejoAuthDal dal.ForgejoAuthDal) *AuthMiddleware

NewAuthMiddleware creates a new authentication middleware

func (*AuthMiddleware) Handler

func (m *AuthMiddleware) Handler(next http.Handler) http.Handler

Handler is the middleware handler function

Jump to

Keyboard shortcuts

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