Skip to content

Add WebhookPlugin for HTTP POST notifications (issue #89, Phase 2)#92

Open
stalep wants to merge 1 commit into
Hyperfoil:mainfrom
stalep:issue_89_p2
Open

Add WebhookPlugin for HTTP POST notifications (issue #89, Phase 2)#92
stalep wants to merge 1 commit into
Hyperfoil:mainfrom
stalep:issue_89_p2

Conversation

@stalep
Copy link
Copy Markdown
Member

@stalep stalep commented May 15, 2026

Implements the first notification channel: HTTP POST webhook. Sends a JSON payload containing folder name, detection node info, change details, and a formatted text message to a configured URL.

Features:

  • Accepts URL via JSON config ({"url": "https://..."}) or plain URL
  • Optional Authorization header via secrets ({"authHeader": "Bearer ..."})
  • Custom message templates with {folderName}, {nodeName}, {nodeType}, {changeCount} placeholders
  • Slack incoming webhook compatible (uses 'text' field in payload)
  • Config validation: requires valid http/https URL
  • 10s connect timeout, 30s request timeout
  • Throws on HTTP 4xx/5xx responses for NotificationLog failure tracking

Tests (14):

  • Validation: valid JSON config, plain URL, https, null, empty, non-http scheme, missing url field
  • Send: JSON payload structure, auth header, custom template, default message, HTTP error handling, plain URL config
  • Method identity check

…ase 2)

Implements the first notification channel: HTTP POST webhook. Sends a
JSON payload containing folder name, detection node info, change details,
and a formatted text message to a configured URL.

Features:
- Accepts URL via JSON config ({"url": "https://..."}) or plain URL
- Optional Authorization header via secrets ({"authHeader": "Bearer ..."})
- Custom message templates with {folderName}, {nodeName}, {nodeType},
  {changeCount} placeholders
- Slack incoming webhook compatible (uses 'text' field in payload)
- Config validation: requires valid http/https URL
- 10s connect timeout, 30s request timeout
- Throws on HTTP 4xx/5xx responses for NotificationLog failure tracking

Tests (14):
- Validation: valid JSON config, plain URL, https, null, empty,
  non-http scheme, missing url field
- Send: JSON payload structure, auth header, custom template,
  default message, HTTP error handling, plain URL config
- Method identity check
@stalep stalep requested a review from barreiro May 15, 2026 16:03
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