handler

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminAuthMiddleware

func AdminAuthMiddleware() gin.HandlerFunc

AdminAuthMiddleware creates a middleware that checks if the user has admin role

Types

type Handler

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

Handler represents the authentication handler

func NewHandler

func NewHandler(db database.Database, jwtService *jwt.Service, cfg *config.MCPGatewayConfig, logger *zap.Logger) *Handler

NewHandler creates a new authentication handler

func (*Handler) ChangePassword

func (h *Handler) ChangePassword(c *gin.Context)

ChangePassword handles password change requests

func (*Handler) CreateTenant

func (h *Handler) CreateTenant(c *gin.Context)

CreateTenant handles tenant creation

func (*Handler) CreateUser

func (h *Handler) CreateUser(c *gin.Context)

CreateUser handles user creation

func (*Handler) DeleteTenant

func (h *Handler) DeleteTenant(c *gin.Context)

DeleteTenant handles tenant deletion

func (*Handler) DeleteUser

func (h *Handler) DeleteUser(c *gin.Context)

DeleteUser handles user deletion

func (*Handler) GetTenantInfo

func (h *Handler) GetTenantInfo(c *gin.Context)

GetTenantInfo handles getting tenant info by name

func (*Handler) GetUserInfo

func (h *Handler) GetUserInfo(c *gin.Context)

GetUserInfo handles getting current user info

func (*Handler) GetUserWithTenants

func (h *Handler) GetUserWithTenants(c *gin.Context)

GetUserWithTenants gets a user with their associated tenants

func (*Handler) ListTenants

func (h *Handler) ListTenants(c *gin.Context)

ListTenants handles listing all tenants

func (*Handler) ListUsers

func (h *Handler) ListUsers(c *gin.Context)

ListUsers handles listing all users

func (*Handler) Login

func (h *Handler) Login(c *gin.Context)

Login handles user login

func (*Handler) UpdateTenant

func (h *Handler) UpdateTenant(c *gin.Context)

UpdateTenant handles tenant updates

func (*Handler) UpdateUser

func (h *Handler) UpdateUser(c *gin.Context)

UpdateUser handles user updates

func (*Handler) UpdateUserTenants

func (h *Handler) UpdateUserTenants(c *gin.Context)

UpdateUserTenants updates the tenant associations for a user

type MCP

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

func NewMCP

func NewMCP(db database.Database, store storage.Store, ntf notifier.Notifier, logger *zap.Logger, refreshInterval time.Duration, cacheTTL time.Duration) *MCP

func (*MCP) HandleGetCapabilities added in v0.9.0

func (h *MCP) HandleGetCapabilities(c *gin.Context)

HandleGetCapabilities handles GET /api/mcp/capabilities/:tenant/:name

func (*MCP) HandleGetConfigNames

func (h *MCP) HandleGetConfigNames(c *gin.Context)

HandleGetConfigNames handles the request to get all configuration names

func (*MCP) HandleGetConfigVersions

func (h *MCP) HandleGetConfigVersions(c *gin.Context)

HandleGetConfigVersions handles the request to get configuration versions

func (*MCP) HandleListMCPServers

func (h *MCP) HandleListMCPServers(c *gin.Context)

func (*MCP) HandleMCPServerCreate

func (h *MCP) HandleMCPServerCreate(c *gin.Context)

func (*MCP) HandleMCPServerDelete

func (h *MCP) HandleMCPServerDelete(c *gin.Context)

func (*MCP) HandleMCPServerSync

func (h *MCP) HandleMCPServerSync(c *gin.Context)

func (*MCP) HandleMCPServerUpdate

func (h *MCP) HandleMCPServerUpdate(c *gin.Context)

func (*MCP) HandleSetActiveVersion

func (h *MCP) HandleSetActiveVersion(c *gin.Context)

HandleSetActiveVersion handles setting a version as active

func (*MCP) StartCapabilitiesSync added in v0.9.0

func (h *MCP) StartCapabilitiesSync(ctx context.Context)

StartCapabilitiesSync starts a background goroutine to periodically refresh capabilities for all configured MCP backends. It performs an immediate refresh on start and then ticks at the configured interval.

TODO: For multi-instance deployments, add coordination (e.g., distributed locks) to avoid redundant refreshes across instances.

type OAuthHandler added in v0.9.0

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

OAuthHandler handles external OAuth authentication

func NewOAuthHandler added in v0.9.0

func NewOAuthHandler(db database.Database, jwtService *jwt.Service, authService auth.Auth, logger *zap.Logger) *OAuthHandler

NewOAuthHandler creates a new OAuth handler

func (*OAuthHandler) GetOAuthProviders added in v0.9.0

func (h *OAuthHandler) GetOAuthProviders(c *gin.Context)

GetOAuthProviders returns available OAuth providers

func (*OAuthHandler) GitHubCallback added in v0.9.0

func (h *OAuthHandler) GitHubCallback(c *gin.Context)

GitHubCallback handles GitHub OAuth callback

func (*OAuthHandler) GitHubLogin added in v0.9.0

func (h *OAuthHandler) GitHubLogin(c *gin.Context)

GitHubLogin initiates GitHub OAuth login

func (*OAuthHandler) GoogleCallback added in v0.9.0

func (h *OAuthHandler) GoogleCallback(c *gin.Context)

GoogleCallback handles Google OAuth callback

func (*OAuthHandler) GoogleLogin added in v0.9.0

func (h *OAuthHandler) GoogleLogin(c *gin.Context)

GoogleLogin initiates Google OAuth login

type OpenAPI

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

OpenAPI handles OpenAPI related operations

func NewOpenAPI

func NewOpenAPI(db database.Database, store storage.Store, ntf notifier.Notifier, logger *zap.Logger) *OpenAPI

NewOpenAPI creates a new OpenAPI handler

func (*OpenAPI) HandleImport

func (h *OpenAPI) HandleImport(c *gin.Context)

HandleImport handles OpenAPI import requests

type RuntimeConfigHandler added in v0.8.4

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

RuntimeConfigHandler represents the runtime configuration handler

func NewRuntimeConfigHandler added in v0.8.4

func NewRuntimeConfigHandler(cfg *config.APIServerConfig) *RuntimeConfigHandler

NewRuntimeConfigHandler creates a new runtime configuration handler

func (*RuntimeConfigHandler) HandleRuntimeConfig added in v0.8.4

func (h *RuntimeConfigHandler) HandleRuntimeConfig(c *gin.Context)

HandleRuntimeConfig serves frontend runtime config as JSON

Jump to

Keyboard shortcuts

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