-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
We want to add webhook support for Cloudflare in tern. Cloudflare sends events for DNS, security, deployments, and more.
Tasks
- Webhook Handler:
- Implement a handler in
/src/platforms/cloudflare.ts. - Normalize payloads into tern’s event structure (id, type, timestamp, payload).
- Implement a handler in
- Platform Config:
- Add
platformConfigs.cloudflarewith supported event types (e.g., dns.record.created, firewall.event, deployment.finished).
- Add
- Test Cases:
- Add fixtures for at least 3 event types (DNS record created, firewall event, deployment finished).
- Write Jest tests in
/tests/cloudflare.test.tsto validate parsing.
- Docs:
- Add setup instructions in
/docs/platforms.md. - Example: how to configure a webhook in Cloudflare dashboard.
- Add setup instructions in
- Acceptance Criteria:
- Cloudflare handler implemented
- Tests cover 3+ event types
- Docs updated
- Final Integration Testing:
- Trigger a webhook event from the Cloudflare dashboard (use the “Send Test Event” option if available).
- Verify the signature using the platform’s signing secret/HMAC.
- The event should pass verification if the signature is correct.
- The event should fail verification if the signature is invalid.
- Add a test case in Jest covering both valid and invalid signature scenarios.
Contributor directive:
- Mention this issue and its number in your PR to get it linked with the issue.
Helpful Links:
Cloudflare Docs 1
Cloudflare Docs 2
Reactions are currently unavailable