Sha256: e7f4d7f842ce8e221c05aafea0a2b8b228077e159460a86bf58f1043624d4400
Contents?: true
Size: 591 Bytes
Versions: 1
Compression:
Stored size: 591 Bytes
Contents
module Workarea module FlowIo module WebhookRequestSignature # @param[String] request_signature # @param[String] request_body # # @return Boolean def self.valid?(request_signature:, request_body:) return false unless request_signature.present? && request_body.present? digest = OpenSSL::Digest.new('sha256') expected_signature = 'sha256=' + OpenSSL::HMAC.hexdigest(digest, Workarea::FlowIo.webhook_shared_secret, request_body) Rack::Utils.secure_compare request_signature, expected_signature end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
workarea-flow_io-1.2.1 | app/services/workarea/flow_io/webhook_request_signature.rb |