Provide refresh webhook headers in API NodePluginArgs #32482
Replies: 5 comments
-
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Beta Was this translation helpful? Give feedback.
-
@vladar - any update on this? |
Beta Was this translation helpful? Give feedback.
-
Want to prepare a PR for this? I think simple passing webhookHeaders along with webhookBody should be enough? |
Beta Was this translation helpful? Give feedback.
-
Yeap - it could do that. I checked the occurrences if webhookBody in code and it looks quite OK to add the functionality there. I might need some guidance on e2e tests and integration ones. |
Beta Was this translation helpful? Give feedback.
-
There is a draft pull request with the implementation: |
Beta Was this translation helpful? Give feedback.
-
Summary
Allow working with webhook's headers as well.
Extend
NodePluginArgs
with headers of the webhook (currently onlyNodePluginArgs.webhookBody
is available).Basic example
The common practice using webhook is to validate the signature to prevent faking the webhooks.
The signature is commonly sent as a part of the headers of the request.
I.e. Headless CMS Kentico Kontent webhooks notification docs.
To be able to validate that hash/signature, it would be great to have the data accessible in
NodePluginArgs
.Motivation
That could prevent to mock refresh webhooks and potentially protect Gatsby Cloud for some DDoS attacks.
Beta Was this translation helpful? Give feedback.
All reactions