Skip to content

Commit 1c8ce42

Browse files
committed
feat(gateway): add incident.io source
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
1 parent c05ebcb commit 1c8ce42

17 files changed

Lines changed: 2293 additions & 67 deletions

File tree

devops/docker/compose/.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
# TROGON_SOURCE_GITLAB_STREAM_MAX_AGE_SECS=604800
1919
# TROGON_SOURCE_GITLAB_NATS_ACK_TIMEOUT_SECS=10
2020

21+
# --- incident.io Source ---
22+
# TROGON_SOURCE_INCIDENTIO_SIGNING_SECRET= # Svix signing secret, includes whsec_ prefix
23+
# TROGON_SOURCE_INCIDENTIO_SUBJECT_PREFIX=incidentio
24+
# TROGON_SOURCE_INCIDENTIO_STREAM_NAME=INCIDENTIO
25+
# TROGON_SOURCE_INCIDENTIO_STREAM_MAX_AGE_SECS=604800
26+
# TROGON_SOURCE_INCIDENTIO_NATS_ACK_TIMEOUT_SECS=10
27+
# TROGON_SOURCE_INCIDENTIO_TIMESTAMP_TOLERANCE_SECS=300
28+
2129
# --- Linear Source ---
2230
# TROGON_SOURCE_LINEAR_WEBHOOK_SECRET=
2331
# TROGON_SOURCE_LINEAR_SUBJECT_PREFIX=linear

devops/docker/compose/compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ services:
6161
TROGON_SOURCE_GITLAB_STREAM_MAX_AGE_SECS: "${TROGON_SOURCE_GITLAB_STREAM_MAX_AGE_SECS:-604800}"
6262
TROGON_SOURCE_GITLAB_NATS_ACK_TIMEOUT_SECS: "${TROGON_SOURCE_GITLAB_NATS_ACK_TIMEOUT_SECS:-10}"
6363

64+
TROGON_SOURCE_INCIDENTIO_SIGNING_SECRET: "${TROGON_SOURCE_INCIDENTIO_SIGNING_SECRET:-}"
65+
TROGON_SOURCE_INCIDENTIO_SUBJECT_PREFIX: "${TROGON_SOURCE_INCIDENTIO_SUBJECT_PREFIX:-incidentio}"
66+
TROGON_SOURCE_INCIDENTIO_STREAM_NAME: "${TROGON_SOURCE_INCIDENTIO_STREAM_NAME:-INCIDENTIO}"
67+
TROGON_SOURCE_INCIDENTIO_STREAM_MAX_AGE_SECS: "${TROGON_SOURCE_INCIDENTIO_STREAM_MAX_AGE_SECS:-604800}"
68+
TROGON_SOURCE_INCIDENTIO_NATS_ACK_TIMEOUT_SECS: "${TROGON_SOURCE_INCIDENTIO_NATS_ACK_TIMEOUT_SECS:-10}"
69+
TROGON_SOURCE_INCIDENTIO_TIMESTAMP_TOLERANCE_SECS: "${TROGON_SOURCE_INCIDENTIO_TIMESTAMP_TOLERANCE_SECS:-300}"
70+
6471
TROGON_SOURCE_LINEAR_WEBHOOK_SECRET: "${TROGON_SOURCE_LINEAR_WEBHOOK_SECRET:-}"
6572
TROGON_SOURCE_LINEAR_SUBJECT_PREFIX: "${TROGON_SOURCE_LINEAR_SUBJECT_PREFIX:-linear}"
6673
TROGON_SOURCE_LINEAR_STREAM_NAME: "${TROGON_SOURCE_LINEAR_STREAM_NAME:-LINEAR}"

devops/docker/compose/services/trogon-gateway/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ prefix:
1414
| Slack | `/slack/webhook` | `TROGON_SOURCE_SLACK_SIGNING_SECRET` |
1515
| Telegram | `/telegram/webhook` | `TROGON_SOURCE_TELEGRAM_WEBHOOK_SECRET` |
1616
| GitLab | `/gitlab/webhook` | `TROGON_SOURCE_GITLAB_WEBHOOK_SECRET` |
17+
| incident.io | `/incidentio/webhook` | `TROGON_SOURCE_INCIDENTIO_SIGNING_SECRET` |
1718
| Linear | `/linear/webhook` | `TROGON_SOURCE_LINEAR_WEBHOOK_SECRET` |
1819

1920
The gateway port is configured via `TROGON_GATEWAY_PORT` (default `8080`).
@@ -65,6 +66,17 @@ docker compose --profile dev up
6566
Find the ngrok tunnel URL in `docker compose logs ngrok`, then set it as
6667
your Discord application's Interactions Endpoint URL (append `/discord/webhook`).
6768

69+
## incident.io webhooks
70+
71+
incident.io uses Svix-style webhook signing. Set `TROGON_SOURCE_INCIDENTIO_SIGNING_SECRET`
72+
to the `whsec_...` signing secret from incident.io and configure the webhook
73+
endpoint as `/incidentio/webhook`.
74+
75+
incident.io does not guarantee ordered delivery, and private incident events may
76+
contain only resource IDs rather than full objects. The gateway forwards the raw
77+
verified payload to NATS and leaves any enrichment or reordering to downstream
78+
consumers.
79+
6880
## Exposing webhooks with ngrok
6981

7082
```bash

rsworkspace/Cargo.lock

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rsworkspace/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ trogon-nats = { path = "crates/trogon-nats" }
1717
trogon-source-discord = { path = "crates/trogon-source-discord" }
1818
trogon-source-github = { path = "crates/trogon-source-github" }
1919
trogon-source-gitlab = { path = "crates/trogon-source-gitlab" }
20+
trogon-source-incidentio = { path = "crates/trogon-source-incidentio" }
2021
trogon-source-linear = { path = "crates/trogon-source-linear" }
2122
trogon-source-slack = { path = "crates/trogon-source-slack" }
2223
trogon-source-telegram = { path = "crates/trogon-source-telegram" }

rsworkspace/crates/trogon-gateway/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ trogon-nats = { workspace = true }
2323
trogon-source-discord = { workspace = true }
2424
trogon-source-github = { workspace = true }
2525
trogon-source-gitlab = { workspace = true }
26+
trogon-source-incidentio = { workspace = true }
2627
trogon-source-linear = { workspace = true }
2728
trogon-source-slack = { workspace = true }
2829
trogon-source-telegram = { workspace = true }

0 commit comments

Comments
 (0)