Webhook signing secrets
When you configure a webhook endpoint in Pocketsflow:- You will receive (or set) a signing secret.
- Pocketsflow uses this secret to sign outgoing webhook requests.
- Store the secret securely (for example, as an environment variable).
- Never share it publicly or commit it to version control.
Verifying signatures
The exact algorithm and header names may evolve, but the general pattern is:- Pocketsflow calculates a signature using:
- The request body.
- A timestamp.
- Your shared secret.
- The signature is sent in an HTTP header (for example,
X-Pocketsflow-Signature). - Your server:
- Recalculates the expected signature using the same inputs.
- Compares it to the header value in a time-safe way.
Additional defenses
Best practices for webhook security include:- Validating the
Content-Typeand payload shape before processing. - Enforcing reasonable time windows on timestamps in the signature header.
- Using HTTPS endpoints with valid certificates.
- Limiting which IP ranges can reach your webhook, if feasible.
Handling secrets safely
Use your stack’s standard tools for managing secrets:- Environment variables.
- Secret managers (for example, components of your cloud provider).
- You suspect they have been exposed.
- You change ownership of infrastructure.