Documentation
¶
Index ¶
- Variables
- func NewMCPHandler(caseUC *usecase.CaseUseCase, actionUC *usecase.ActionUseCase, ...) http.Handler
- func SlackSignatureMiddleware(signingSecret string) func(http.Handler) http.Handler
- type AuthUseCase
- type Options
- func WithAuth(authUC AuthUseCase) Options
- func WithGraphiQL(enabled bool) Options
- func WithMCP(handler http.Handler) Options
- func WithSlackCommand(handler *SlackCommandHandler) Options
- func WithSlackInteraction(handler *SlackInteractionHandler) Options
- func WithSlackService(svc slack.Service) Options
- func WithSlackWebhook(handler *SlackWebhookHandler, signingSecret string) Options
- func WithTickHook(handler *TickHookHandler) Options
- func WithWorkspaceRegistry(registry *model.WorkspaceRegistry) Options
- type Server
- type SlackCommandHandler
- type SlackInteractionHandler
- type SlackWebhookHandler
- type TickHookHandler
- type TickScanner
Constants ¶
This section is empty.
Variables ¶
var ErrMCPAuthorizationDenied = goerr.New("authorization denied")
ErrMCPAuthorizationDenied is returned to the MCP client when the Rego policy denies a tool call (result.allow is false).
Functions ¶
func NewMCPHandler ¶
func NewMCPHandler( caseUC *usecase.CaseUseCase, actionUC *usecase.ActionUseCase, registry *model.WorkspaceRegistry, policy interfaces.PolicyClient, env map[string]string, ) http.Handler
NewMCPHandler builds the http.Handler that serves the MCP endpoint over Streamable HTTP (mounted at /mcp by the Server). policy is mandatory: every tool call is authorized against data.auth.mcp before any data is read.
The transport runs in Stateless mode so each HTTP request carries its own authorization and the request context (populated by withMCPRequestContext) flows into the tool handlers — there is no cross-request session state held in process memory.
Types ¶
type AuthUseCase ¶
type AuthUseCase = usecase.AuthUseCaseInterface
type Options ¶
type Options func(*Server)
func WithAuth ¶
func WithAuth(authUC AuthUseCase) Options
func WithGraphiQL ¶
func WithMCP ¶
WithMCP wires the MCP (Model Context Protocol) endpoint at /mcp. The handler already embeds its own authorization (Rego policy) and request-context middleware, so it is mounted as-is. nil handler leaves the route unregistered.
func WithSlackCommand ¶
func WithSlackCommand(handler *SlackCommandHandler) Options
func WithSlackInteraction ¶
func WithSlackInteraction(handler *SlackInteractionHandler) Options
func WithSlackService ¶
func WithSlackWebhook ¶
func WithSlackWebhook(handler *SlackWebhookHandler, signingSecret string) Options
func WithTickHook ¶
func WithTickHook(handler *TickHookHandler) Options
WithTickHook wires the POST /hooks/tick handler so external schedulers (Cloud Scheduler, internal cron) can trigger a sweep over scheduled Jobs. nil handler leaves the route unregistered.
func WithWorkspaceRegistry ¶
func WithWorkspaceRegistry(registry *model.WorkspaceRegistry) Options
type SlackCommandHandler ¶
type SlackCommandHandler struct {
// contains filtered or unexported fields
}
SlackCommandHandler handles Slack slash command requests
func NewSlackCommandHandler ¶
func NewSlackCommandHandler(slackUC *usecase.SlackUseCases) *SlackCommandHandler
NewSlackCommandHandler creates a new Slack command handler
func (*SlackCommandHandler) ServeHTTP ¶
func (h *SlackCommandHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP handles Slack slash command webhook requests. It supports both /hooks/slack/command and /hooks/slack/command/{ws_id} paths.
type SlackInteractionHandler ¶
type SlackInteractionHandler struct {
// contains filtered or unexported fields
}
SlackInteractionHandler handles Slack interactive component payloads (button clicks, modal submissions, etc.)
All usecase dependencies are required at construction time; this handler is only wired when Slack webhooks are enabled, and at that point every Slack surface (action buttons, slash command modals, draft buttons) is in play. Optional wiring previously left fields nil and forced every entry point to guard against zero-value handlers — a fragile pattern that masked real wiring regressions behind silent skips.
func NewSlackInteractionHandler ¶
func NewSlackInteractionHandler( actionUC *usecase.ActionUseCase, agentUC *usecase.AgentUseCase, slackUC *usecase.SlackUseCases, caseUC *usecase.CaseUseCase, mentionProposalUC *usecase.MentionProposalUseCase, jobRunner *jobuc.JobRunner, ) *SlackInteractionHandler
NewSlackInteractionHandler creates a new Slack interaction handler. Every dependency except jobRunner is mandatory; jobRunner may be nil in deployments that do not run interactive Jobs.
func (*SlackInteractionHandler) ServeHTTP ¶
func (h *SlackInteractionHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP handles Slack interaction webhook requests
type SlackWebhookHandler ¶
type SlackWebhookHandler struct {
// contains filtered or unexported fields
}
SlackWebhookHandler handles Slack Events API webhook requests
func NewSlackWebhookHandler ¶
func NewSlackWebhookHandler(slackUC *usecase.SlackUseCases) *SlackWebhookHandler
NewSlackWebhookHandler creates a new Slack webhook handler
func (*SlackWebhookHandler) ServeHTTP ¶
func (h *SlackWebhookHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP handles Slack webhook requests
type TickHookHandler ¶
type TickHookHandler struct {
// contains filtered or unexported fields
}
TickHookHandler exposes POST /hooks/tick. The endpoint is intentionally unauthenticated: the assumption is that the deployment fronts it with IAP / internal-network policy. Body is ignored.
The handler returns 200 immediately and dispatches the sweep in the background, mirroring the Slack hook ack-fast pattern: external schedulers (Cloud Scheduler) treat a delayed response as failure (and may retry, doubling the work) while the LLM round-trips inside the sweep can comfortably exceed any reasonable HTTP timeout.
func NewTickHookHandler ¶
func NewTickHookHandler(scanner TickScanner) *TickHookHandler
NewTickHookHandler builds the handler.
func (*TickHookHandler) ServeHTTP ¶
func (h *TickHookHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements http.Handler.
type TickScanner ¶
TickScanner is the narrow surface the HTTP layer needs to fire a scheduled-Job sweep. The runtime implementation lives in pkg/usecase/job.ScheduledScanner; this interface keeps the HTTP layer off the usecase import.