Skip to content

feat: inbound webhook receivers (#155)#268

Merged
Polliog merged 12 commits into
developfrom
feat/receivers-155
Jul 3, 2026
Merged

feat: inbound webhook receivers (#155)#268
Polliog merged 12 commits into
developfrom
feat/receivers-155

Conversation

@Polliog

@Polliog Polliog commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Closes #155

What

External systems (CI/CD pipelines, uptime monitors, arbitrary tools) can now push events into LogTide through per-receiver tokenized webhook endpoints. Payloads are normalized into standard log entries by adapters and flow through the regular ingestion pipeline, so PII masking (fail-closed), usage quotas, Sigma detection, log pipelines, metering and live tail all apply automatically.

How it works

  • Public endpoint: POST /api/v1/receivers/:receiverId/:token. The URL is the credential (lr_-prefixed token, SHA-256 hash stored, timing-safe compare) because GitHub and Uptime Robot cannot send custom headers. Responds 202 and processes asynchronously via a new receiver-events queue job (queue abstraction, works on both BullMQ and graphile-worker). Payloads capped at 256 KB.
  • Adapters (pure functions, drop-in registry):
    • github: workflow_run (completed) and deployment_status events, conclusion-to-level mapping; ping and unsupported events are marked skipped, not failed
    • uptime: shape-detects Uptime Robot (alertType 1/2/3) and Better Stack incident payloads
    • generic: any JSON object, with optional dot-path field mapping (message/level/service/timestamp, levelMap, defaults) validated by a shared Zod schema; full payload always preserved in metadata
  • Event debug view: every received event is recorded on a receiver_events row (raw payload, normalized output, processed/skipped/failed status, error), pruned to the newest 100 per receiver.
  • Management: project-scoped CRUD + recent-events API under /api/v1/projects/:projectId/receivers (session auth, same pattern as api-keys), audit-logged as receiver.created/receiver.deleted. New receivers.max capability limit enforced with the canonical withLimitLock pattern (unlimited by default for OSS).
  • UI: "Webhook Receivers" section in project settings with adapter picker, one-time URL reveal with copy, enable/disable switch and a recent-events viewer.
  • Docs: docs/receivers.md (endpoint contract, adapter reference, field-mapping reference).

Database

Migration 052_receivers.sql: receivers and receiver_events tables. Both registered in the tenant-table manifest and scoping tripwire.

Tests

  • 44 new backend tests: adapter units (20), service (6), management routes (6), capability 4-case + race (5), public endpoint + job end-to-end (7)
  • Full backend suite green (4682 tests), shared (177) and frontend (72) green, svelte-check clean vs baseline, check:tenant-scoping OK

Out of scope (follow-ups)

GitHub HMAC signature verification (X-Hub-Signature-256), per-receiver rate limiting, token rotation, more adapters (GitLab, Sentry, PagerDuty).

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

@Polliog Polliog merged commit 7a2df92 into develop Jul 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant