Skip to content

Commit d188dce

Browse files
Merge pull request #8 from systemli/update-readme
Readme: Document how to create X-Signature header
2 parents 3f9d939 + 4c02b6a commit d188dce

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
# userli-webhook-listener
22

33
[![Integration](https://github.com/systemli/userli-webhook-listener/actions/workflows/integration.yml/badge.svg)](https://github.com/systemli/userli-webhook-listener/actions/workflows/integration.yml) [![Quality](https://github.com/systemli/userli-webhook-listener/actions/workflows/quality.yml/badge.svg)](https://github.com/systemli/userli-webhook-listener/actions/workflows/quality.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=systemli_userli-webhook-listener&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=systemli_userli-webhook-listener) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=systemli_userli-webhook-listener&metric=coverage)](https://sonarcloud.io/summary/new_code?id=systemli_userli-webhook-listener) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=systemli_userli-webhook-listener&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=systemli_userli-webhook-listener)
4+
5+
## Debugging
6+
7+
Cheat sheet for sending requests with X-Signature header:
8+
9+
```shell
10+
WEBHOOK_LISTENER_URL="https://example.org"
11+
SECRET="secret"
12+
PAYLOAD='{"type":"user.deleted","timestamp":"2025-01-01T00:00:00.000000Z","data":{"email":"user@example.org"}}'
13+
SIGNATURE=$(printf '%s' "$PAYLOAD" | openssl dgst -sha256 -hmac "$SECRET" | sed 's/^.* //')
14+
15+
curl -i "$WEBHOOK_URL
16+
-H "Content-Type: application/json"
17+
-H "X-Signature: $SIGNATURE"
18+
-d "$PAYLOAD"
19+
```

0 commit comments

Comments
 (0)