add option for serving jwt info

This commit is contained in:
Robin Appelman 2026-11-04 00:57:16 +01:00
commit c04a04ea29
Signed by: robin
SSH key fingerprint: SHA256:kifqgrqnut7q1YUIrI0AdMNC23qiKAS/T9uGFmIYvbE
8 changed files with 256 additions and 22 deletions

View file

@ -35,6 +35,27 @@ feed = "docker-hub://matrixdotorg/synapse"
hook = "https://hook.example.com/hook2/call"
```
### JWT Authorization
rss-webhook-trigger supports generating JWT tokens to use for authorization. This can be used to authenticate against various services without the need for long-lived keys.
This current has been tested with [Forgejo's Authorized Integrations](https://forgejo.org/docs/latest/user/api/authorized-integrations).
```toml
[jwt]
key = "RS256 JWT key, or path to the key"
issuer = "https://example.com"
# optionally, serve `/.well-known/openid-configuration` and `/.well-known/keys` with the key information
listen = { address = "0.0.0.0", port = "3000" }
# listen = {path = "/var/run/webhook.sock" }
[[feed]]
feed = "https://example.com/feed3.xml"
hook = "https://hook.example.com/hook3/call"
headers = { authorization = {type = "jwt", aud: "...."} }
body = { event_type = "build" }
```
### Usage in NixOS
A NixOS module is included and can be used like this: