-
Notifications
You must be signed in to change notification settings - Fork 1
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
Standard Webhooks Support #4
Comments
Thanks @Nezteb, open to ideas and PRs on how to conform with their specs. |
I actually started to make a new repo to build something myself, but then I realized I should make an issue here first, as I'd rather not re-invent the wheel. 😄 I had asked in the Elixir Slack #phoenix channel, but since it has limited history I'll copy-paste the relevant bits:
|
Thanks for the additional context! I'd love some help on this if you're up for it. And I don't mind breaking changes as long as they are versioned correctly. |
I think the first thing to do is document the differences between the current version of webhoox and how they differ from standardwebhooks. |
@Nezteb Have you figured out how to create the proper Standard Webhooks signature using Elixir? expected_signature = "v1,6QrvW80BV1T1hZESsZOhKSqc3uaKGE2ceF9RRP2Et28="
id = "msg_p5jXN8AQM9LWM0D4loKWxJek"
timestamp = 1674087231
payload = Jason.encode!(%{"event_type" => "ping", "data" => %{"success" => true}})
signature = "#{id}.#{timestamp}.#{payload}" |> IO.inspect()
"msg_p5jXN8AQM9LWM0D4loKWxJek.1674087231.{\"data\":{\"success\":true},\"event_type\":\"ping\"}"
secret = "MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"
encoded_signature = :crypto.mac(:hmac, :sha256, secret, signature) |> Base.encode64() |> String.trim() |> IO.inspect()
"9SzW0S/o+gbH+/OiAFy1dAxAXeWmKiK/gClIRhFhF7Y="
signature_with_version = "v1,#{encoded_signature}" |> IO.inspect()
"v1,9SzW0S/o+gbH+/OiAFy1dAxAXeWmKiK/gClIRhFhF7Y="
expected_signature == signature_with_version
false I've tried this but it does not seem to verify over at: https://www.standardwebhooks.com/verify Any ideas? |
tl;dr a few companies worked together to create a specification for webhooks: https://www.standardwebhooks.com/
It'd be cool for this project to somehow conform to the new spec. 😄
The text was updated successfully, but these errors were encountered: