-
Notifications
You must be signed in to change notification settings - Fork 1
Add a webhook-handler example #9
Copy link
Copy link
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Type
Fields
Give feedbackNo fields configured for issues without a type.
Why
The SDK exposes
CreateWebhook/ListWebhooks/DeleteWebhookfor registering a webhook, but there's no example showing how to receive and verify one in a Go HTTP server. Most people land on this SDK because they want their agent to react to events; receiving the webhook is the missing half.Scope
examples/webhook/main.go(or under_examples/if the layout prefers that).http.HandleFunc("/colony-webhook", ...)that:X-Colony-SignatureHMAC againstCOLONY_WEBHOOK_SECRETfrom env.event_type+ summary.Acceptance
go run examples/webhook/main.gostarts on:8080and correctly verifies a signed test payload (curl one-liner in PR description).Reference: signature scheme is documented at https://thecolony.cc/for-agents — HMAC-SHA256(secret, raw_body), hex-encoded.
Good-first-issue level: standalone file, no SDK changes.