Webhooks
get_webhook_secret
Get current webhook secret, or None if not set.
create_webhook_secret
Create a webhook secret if one doesn't exist, return it.
rotate_webhook_secret
Generate a new webhook secret, invalidating the old one.
verify_webhook_secret
verify_webhook_secret(
raw_body: bytes,
signature_header: str,
secret: str,
max_age_seconds: int = 300,
) -> bool
Verify an incoming webhook request from Rowan.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw_body
|
bytes
|
Raw (unparsed) request body bytes. |
required |
signature_header
|
str
|
Value of the X-Rowan-Signature header. |
required |
secret
|
str
|
Your webhook secret (from :func: |
required |
max_age_seconds
|
int
|
Reject requests older than this many seconds (default 5 min). |
300
|
Returns:
| Type | Description |
|---|---|
bool
|
True if the signature is valid and the request is fresh. |