Skip to content

Commit a71ecd6

Browse files
authored
Merge pull request #115 from github/update-docs
docs: Add curl examples for shared secret authentication
2 parents da23e72 + f04f829 commit a71ecd6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/auth_plugins.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,13 @@ auth:
345345
header: Authorization
346346
```
347347

348+
```bash
349+
curl -X POST "https://your-hooks-server.com/webhooks/example" \
350+
-H "Authorization: your-shared-secret" \
351+
-H "Content-Type: application/json" \
352+
-d '{"event":"test","data":"example"}'
353+
```
354+
348355
**Custom header shared secret:**
349356

350357
```yaml
@@ -354,6 +361,15 @@ auth:
354361
header: X-API-Key
355362
```
356363

364+
```bash
365+
curl -X POST "https://your-hooks-server.com/webhooks/example" \
366+
-H "X-API-Key: your-shared-secret" \
367+
-H "Content-Type: application/json" \
368+
-d '{"event":"test","data":"example"}'
369+
```
370+
371+
> **Note:** The shared secret is sent as plain text directly in the header value. No `Bearer` prefix or encoding is required. Always use HTTPS to protect the secret in transit.
372+
357373
## Custom Auth Plugins
358374

359375
This section provides an example of how to implement a custom authentication plugin for a hypothetical system. The plugin checks for a specific authorization header and validates it against a secret stored in an environment variable.

0 commit comments

Comments
 (0)