middleware

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetServiceRegistry

func GetServiceRegistry(c *gin.Context) (*service.ServiceRegistry, bool)

GetServiceRegistry extracts the service registry from gin context

Types

type AdminOnlyMiddleware

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

AdminOnlyMiddleware restricts access to admin-only endpoints

func NewAdminOnlyMiddleware

func NewAdminOnlyMiddleware(logger *logrus.Logger) *AdminOnlyMiddleware

NewAdminOnlyMiddleware creates a new admin-only middleware

func (*AdminOnlyMiddleware) Handle

func (aom *AdminOnlyMiddleware) Handle() gin.HandlerFunc

Handle checks if the user has admin privileges

type OrganizationConfigMiddleware

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

OrganizationConfigMiddleware adds organization configuration to the context

func NewOrganizationConfigMiddleware

func NewOrganizationConfigMiddleware(serviceRegistry *service.ServiceRegistry, logger *logrus.Logger) *OrganizationConfigMiddleware

NewOrganizationConfigMiddleware creates a new organization config middleware

func (*OrganizationConfigMiddleware) Handle

Handle loads and adds organization configuration to the context

type ServiceEnabledMiddleware

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

ServiceEnabledMiddleware checks if a service is enabled for the organization

func NewServiceEnabledMiddleware

func NewServiceEnabledMiddleware(serviceRegistry *service.ServiceRegistry, serviceName string, logger *logrus.Logger) *ServiceEnabledMiddleware

NewServiceEnabledMiddleware creates a new service enabled middleware

func (*ServiceEnabledMiddleware) Handle

Handle checks if the service is enabled before processing the request

type ServiceRegistryMiddleware

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

ServiceRegistryMiddleware adds the service registry to the context

func NewServiceRegistryMiddleware

func NewServiceRegistryMiddleware(serviceRegistry *service.ServiceRegistry) *ServiceRegistryMiddleware

NewServiceRegistryMiddleware creates a new service registry middleware

func (*ServiceRegistryMiddleware) Handle

Handle adds the service registry to the gin context

type SuperAdminOnlyMiddleware

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

SuperAdminOnlyMiddleware restricts access to super admin only endpoints

func NewSuperAdminOnlyMiddleware

func NewSuperAdminOnlyMiddleware(logger *logrus.Logger) *SuperAdminOnlyMiddleware

NewSuperAdminOnlyMiddleware creates a new super admin only middleware

func (*SuperAdminOnlyMiddleware) Handle

func (saom *SuperAdminOnlyMiddleware) Handle() gin.HandlerFunc

Handle checks if the user has super admin privileges

Jump to

Keyboard shortcuts

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