forked from molecule-ai/molecule-core
Implement SlackAdapter satisfying the ChannelAdapter interface: - ValidateConfig: rejects any webhook_url that doesn't start with https://hooks.slack.com/ — returns "invalid Slack webhook URL" so the handler surfaces 400 {"error":"invalid config: invalid Slack webhook URL"} - SendMessage: HTTP POST JSON {"text":"..."} to the webhook URL with a 10s timeout; rejects invalid-prefix URLs at send time too (defence in depth) - ParseWebhook: handles both slash-command (form-encoded) and Events API (JSON) payloads; no-ops on url_verification and non-message events - StartPolling: returns nil immediately (Slack doesn't support polling via Incoming Webhooks) Register "slack" in the adapter registry. Twelve unit tests cover Type/DisplayName, happy-path validation, every bad-URL variant (wrong scheme, wrong host, SSRF lookalike, empty string), empty webhook in SendMessage, StartPolling nil return, and registry lookup/listing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| cmd | ||
| internal | ||
| migrations | ||
| Dockerfile | ||
| Dockerfile.tenant | ||
| entrypoint-tenant.sh | ||
| go.mod | ||
| go.sum | ||