You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thinking through this: If we add cryptographic signing to BT outgoing webhooks, the clients receiving the webhooks would 1. need to update code to verify the signature and 2. we'd need a mechanism to generate and provide a shared secret? does that match up with what you're thinking?
Not sure the best to share the signing secret, I suppose somewhere in the BT admin dashboard. Stripe provides the signing secret in the stripe CLI. I also dug up the code stripe is using the sign their webhooks for fun:
# Computes a webhook signature given a time (probably the current time),# a payload, and a signing secret.defself.compute_signature(timestamp,payload,secret)raiseArgumentError,"timestamp should be an instance of Time" \
unlesstimestamp.is_a?(Time)raiseArgumentError,"payload should be a string" \
unlesspayload.is_a?(String)raiseArgumentError,"secret should be a string" \
unlesssecret.is_a?(String)timestamped_payload="#{timestamp.to_i}.#{payload}"OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new("sha256"),secret,timestamped_payload)end
@bhumi1102 Verifying the signature is totally optional, so no one will need to update any webhook processing code. It'll just give them a good option for validating the webhook originated at the right place and has not been tampered with.
No description provided.
The text was updated successfully, but these errors were encountered: