Sha256: 98898dc5feb9dde700205a18385fa83ec971e2d1dc20eec8679fe5694d4e83b9

Contents?: true

Size: 861 Bytes

Versions: 15

Compression:

Stored size: 861 Bytes

Contents

# frozen_string_literal: true

module Mock
  module Twilio
    module Webhooks
      class RestError < StandardError
      end
      class Base
        DELAY = [0.5, 0.8]

        def self.build_signature_for_request(request_url, params)
          validator = ::Twilio::Security::RequestValidator.new(::Twilio.auth_token)
          validator.build_signature_for(request_url, params)
        end

        def self.twilio_client
          ::Twilio::REST::Client.new
        end

        def self.webhook_client
          Mock::Twilio::WebhooksClient.new
        end

        def self.auth_twilio
          [twilio_client.account_sid, twilio_client.auth_token]
        end

        def self.headers
          {
            'X-Forwarded-Proto': Mock::Twilio.proto,
            'Host': Mock::Twilio.forwarded_host
          }
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
mock-twilio-1.3.2 lib/mock/twilio/webhooks/base.rb
mock-twilio-1.3.1 lib/mock/twilio/webhooks/base.rb
mock-twilio-1.3.0 lib/mock/twilio/webhooks/base.rb
mock-twilio-1.2.0 lib/mock/twilio/webhooks/base.rb
mock-twilio-1.1.0 lib/mock/twilio/webhooks/base.rb
mock-twilio-1.0.0 lib/mock/twilio/webhooks/base.rb
mock-twilio-0.8.0 lib/mock/twilio/webhooks/base.rb
mock-twilio-0.7.2 lib/mock/twilio/webhooks/base.rb
mock-twilio-0.7.1 lib/mock/twilio/webhooks/base.rb
mock-twilio-0.7.0 lib/mock/twilio/webhooks/base.rb
mock-twilio-0.6.0 lib/mock/twilio/webhooks/base.rb
mock-twilio-0.5.0 lib/mock/twilio/webhooks/base.rb
mock-twilio-0.4.0 lib/mock/twilio/webhooks/base.rb
mock-twilio-0.3.0 lib/mock/twilio/webhooks/base.rb
mock-twilio-0.2.0 lib/mock/twilio/webhooks/base.rb