@junando/webhook 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/package.json +4 -3
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# @junando/webhook
|
|
2
|
+
|
|
3
|
+
AWS Lambda handler for the Junando alerting platform. Receives Alertmanager webhooks and Slack interactivity payloads, validates them at the boundary, and publishes to SQS FIFO for async processing. Designed to respond in < 50ms with no business logic.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @junando/webhook
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @junando/webhook
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Deploy as an AWS Lambda function. The `handler` export is compatible with `APIGatewayProxyEventV2`.
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { handler } from '@junando/webhook'
|
|
19
|
+
|
|
20
|
+
export { handler }
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Endpoints
|
|
24
|
+
|
|
25
|
+
| Method | Path | Description |
|
|
26
|
+
|--------|------|-------------|
|
|
27
|
+
| `GET` | `/health` | Health check — returns `{ status: 'ok' }` |
|
|
28
|
+
| `GET` | `/metrics` | Prometheus metrics in text format |
|
|
29
|
+
| `POST` | `/` | Alertmanager webhook — validates with Zod, publishes to SQS FIFO |
|
|
30
|
+
| `POST` | `/webhook/slack-interactivity` | Slack actions — verifies HMAC-SHA256 with 5-min replay protection |
|
|
31
|
+
|
|
32
|
+
## Environment variables
|
|
33
|
+
|
|
34
|
+
| Variable | Description |
|
|
35
|
+
|----------|-------------|
|
|
36
|
+
| `SQS_QUEUE_URL` | SQS FIFO queue URL to publish alerts |
|
|
37
|
+
| `SLACK_SIGNING_SECRET` | Secret for HMAC verification of Slack payloads |
|
|
38
|
+
|
|
39
|
+
> **Local dev**: if `SQS_QUEUE_URL` is not set, the webhook runs `ProcessIncidentUseCase` inline (dynamic import to avoid cold start penalty in AWS).
|
|
40
|
+
|
|
41
|
+
## Requirements
|
|
42
|
+
|
|
43
|
+
- Node.js >= 24
|
|
44
|
+
- AWS Lambda runtime
|
|
45
|
+
- SQS FIFO queue
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
Apache-2.0
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junando/webhook",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "AWS Lambda webhook handler — receives and enqueues external alert payloads for Junando",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/handler.js",
|
|
8
8
|
"files": [
|
|
9
|
-
"dist"
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md"
|
|
10
11
|
],
|
|
11
12
|
"repository": {
|
|
12
13
|
"type": "git",
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
"dependencies": {
|
|
20
21
|
"@aws-sdk/client-sqs": "^3.600.0",
|
|
21
22
|
"zod": "^3.23.0",
|
|
22
|
-
"@junando/core": "0.6.
|
|
23
|
+
"@junando/core": "0.6.2"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
26
|
"@types/aws-lambda": "^8.10.145",
|