Verify Webhooks in Ruby on Rails with Public Private Key Crytography
06-Oct-2021 1278
When we first launched OhMySMTP we chose Paddle as our Payments Provider, primarily because they handle all sales taxes and payment infrastructure globally. One of the things that took longer than it should have was ensuring that alerts (webhooks) received from paddle.com actually come from Paddle.Luckily Paddle signs every request using Public Key Cryptography, and it works in a similar way to DKIM. Paddle creates a short signature, using a Private Key specific to our Paddle account, and includes it with every webhook sent from their system, which we can verify on our end using the Public Key (see https://developer.paddle.com/webhook-reference/verifying-webhooks for more details). Without this a nefarious actor might figure out your webhook endpoint and create a bunch of fake subscriptions/updates in your app.
Verify Webhooks in Ruby on Rails with Public Private Key Crytography #ruby #rubydeveloper #rubyonrails #Verify #Webhooks #Rails #Public #Private #Crytography #webhooks https://rubyonrails.ba/link/verify-webhooks-in-ruby-on-rails-with-public-private-key-crytography