refactor: rename Processor to Webhook and Webhook to Entrypoint

The top-level entity that groups entrypoints and targets is now called
Webhook (was Processor). The inbound URL endpoint entity is now called
Entrypoint (was Webhook). This rename affects database models, handler
comments, routes, and README documentation.

closes #12
This commit is contained in:
clawbot
2026-03-01 15:44:22 -08:00
parent f9a9569015
commit 6031167c78
11 changed files with 75 additions and 76 deletions

View File

@@ -4,66 +4,66 @@ import (
"net/http"
)
// HandleSourceList shows a list of user's webhook sources
// HandleSourceList shows a list of user's webhooks
func (h *Handlers) HandleSourceList() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// TODO: Implement source list page
// TODO: Implement webhook list page
http.Error(w, "Not implemented", http.StatusNotImplemented)
}
}
// HandleSourceCreate shows the form to create a new webhook source
// HandleSourceCreate shows the form to create a new webhook
func (h *Handlers) HandleSourceCreate() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// TODO: Implement source creation form
// TODO: Implement webhook creation form
http.Error(w, "Not implemented", http.StatusNotImplemented)
}
}
// HandleSourceCreateSubmit handles the source creation form submission
// HandleSourceCreateSubmit handles the webhook creation form submission
func (h *Handlers) HandleSourceCreateSubmit() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// TODO: Implement source creation logic
// TODO: Implement webhook creation logic
http.Error(w, "Not implemented", http.StatusNotImplemented)
}
}
// HandleSourceDetail shows details for a specific webhook source
// HandleSourceDetail shows details for a specific webhook
func (h *Handlers) HandleSourceDetail() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// TODO: Implement source detail page
// TODO: Implement webhook detail page
http.Error(w, "Not implemented", http.StatusNotImplemented)
}
}
// HandleSourceEdit shows the form to edit a webhook source
// HandleSourceEdit shows the form to edit a webhook
func (h *Handlers) HandleSourceEdit() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// TODO: Implement source edit form
// TODO: Implement webhook edit form
http.Error(w, "Not implemented", http.StatusNotImplemented)
}
}
// HandleSourceEditSubmit handles the source edit form submission
// HandleSourceEditSubmit handles the webhook edit form submission
func (h *Handlers) HandleSourceEditSubmit() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// TODO: Implement source update logic
// TODO: Implement webhook update logic
http.Error(w, "Not implemented", http.StatusNotImplemented)
}
}
// HandleSourceDelete handles webhook source deletion
// HandleSourceDelete handles webhook deletion
func (h *Handlers) HandleSourceDelete() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// TODO: Implement source deletion logic
// TODO: Implement webhook deletion logic
http.Error(w, "Not implemented", http.StatusNotImplemented)
}
}
// HandleSourceLogs shows the request/response logs for a webhook source
// HandleSourceLogs shows the request/response logs for a webhook
func (h *Handlers) HandleSourceLogs() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// TODO: Implement source logs page
// TODO: Implement webhook logs page
http.Error(w, "Not implemented", http.StatusNotImplemented)
}
}

View File

@@ -6,19 +6,19 @@ import (
"github.com/go-chi/chi"
)
// HandleWebhook handles incoming webhook requests
// HandleWebhook handles incoming webhook requests at entrypoint URLs
func (h *Handlers) HandleWebhook() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// Get webhook UUID from URL
webhookUUID := chi.URLParam(r, "uuid")
if webhookUUID == "" {
// Get entrypoint UUID from URL
entrypointUUID := chi.URLParam(r, "uuid")
if entrypointUUID == "" {
http.NotFound(w, r)
return
}
// Log the incoming webhook request
h.log.Info("webhook request received",
"uuid", webhookUUID,
"entrypoint_uuid", entrypointUUID,
"method", r.Method,
"remote_addr", r.RemoteAddr,
"user_agent", r.UserAgent(),
@@ -32,7 +32,7 @@ func (h *Handlers) HandleWebhook() http.HandlerFunc {
}
// TODO: Implement webhook handling logic
// For now, return "unimplemented" for all webhook POST requests
// Look up entrypoint by UUID, find parent webhook, fan out to targets
w.WriteHeader(http.StatusNotFound)
_, err := w.Write([]byte("unimplemented"))
if err != nil {