middleware

package
v0.15.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentJWTMiddleware added in v0.13.0

func AgentJWTMiddleware(db *gorm.DB, publicKey *rsa.PublicKey) echo.MiddlewareFunc

func AgentJWTOrPublicMiddleware

func AgentJWTOrPublicMiddleware(db *gorm.DB, publicKey *rsa.PublicKey, allowPublic bool) echo.MiddlewareFunc

func JWTMiddleware

func JWTMiddleware(publicKey *rsa.PublicKey) echo.MiddlewareFunc

JWTMiddleware returns an Echo middleware function that verifies JWT tokens using the provided RSA public key.

func OptionalUserOrAgentJWTMiddleware

func OptionalUserOrAgentJWTMiddleware(db *gorm.DB, publicKey *rsa.PublicKey, allowPublic bool) echo.MiddlewareFunc

OptionalUserOrAgentJWTMiddleware accepts authenticated user JWTs, authenticated agent JWTs, or unauthenticated public requests when allowPublic is true.

func RequireAdminGroups added in v0.5.0

func RequireAdminGroups(db *gorm.DB, cfg *config.Config, logger *zap.SugaredLogger) echo.MiddlewareFunc

RequireAdminGroups enforces that SSO-authenticated users belong to the provider's configured admin groups. Password-based logins bypass this middleware (treated as super admins).

Types

type AgentAuthContext

type AgentAuthContext struct {
	Claims *authn.AgentClaims
	Agent  *relational.Agent
	Key    *relational.AgentServiceAccountKey
}

type Validator

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

func NewValidator

func NewValidator() *Validator

func (*Validator) Validate

func (v *Validator) Validate(i any) error

Jump to

Keyboard shortcuts

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