-
Notifications
You must be signed in to change notification settings - Fork 282
[FUNK-2000] Fixed extensible webhook shared secret issue #3316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3316 +/- ##
=======================================
Coverage 80.03% 80.03%
=======================================
Files 1202 1202
Lines 22105 22112 +7
Branches 4355 4359 +4
=======================================
+ Hits 17691 17697 +6
Misses 3637 3637
- Partials 777 778 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hi @vaibhav-nanda ping me here when you need this reviewed. |
if (payload) { | ||
const payloadData = payload.length ? payload[0]['data'] : payload['data'] | ||
if (settings.sharedSecret && payloadData) { | ||
const digest = createHmac('sha1', settings.sharedSecret) | ||
.update(JSON.stringify(payloadData), 'utf8') | ||
.digest('hex') | ||
xSignatureHeader = { 'X-Signature': digest } | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @vaibhav-nanda I have a few questions about this:
-
Do we need the xSignatureHeader to always be present if the customer provides a sharedSecret?
-
How do you know that you are generating the xSignatureHeader correctly?
-
This Action implements the performBatch() function. If we send a batch of events then I assume the xSignatureHeader needs to created based off of all the data being sent - is that correct?
-
Shouldn't the xSignatureHeader value be generated from the actual payload being sent to the destination platform, rather than the input payload values? I can see that the data object gets encoded before it gets sent.
if (data) return encodeBody(data, contentType)
https://twilio-engineering.atlassian.net/browse/FUNK-2000
The X-Signature is not being sent for extensible webhook right now, although the UI provides an option to add the sharedSecret just like webhooks destination.
Testing
This is tested in staging. The shared secret val is being used to send the required data in

x-signature
header.