Method: DiscoApp::WebhookService.calculated_hmac

Defined in:
app/services/disco_app/webhook_service.rb

.calculated_hmac(body, secret) ⇒ Object

Calculate the HMAC for the given data and secret.



10
11
12
13
# File 'app/services/disco_app/webhook_service.rb', line 10

def self.calculated_hmac(body, secret)
  digest = OpenSSL::Digest.new('sha256')
  Base64.encode64(OpenSSL::HMAC.digest(digest, secret, body)).strip
end