Module: Cloudfront::Connection

Included in:
Cloudfront
Defined in:
lib/cloudfront/connection.rb

Constant Summary collapse

HOST =
'https://cloudfront.amazonaws.com'

Instance Method Summary collapse

Instance Method Details

#build_connection(key_id, key_secret) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/cloudfront/connection.rb', line 12

def build_connection(key_id, key_secret)
  Faraday::Connection.new(HOST) do |builder|
    builder.use FaradayMiddleware::CloudfrontSigner, key_id, key_secret
    builder.use FaradayMiddleware::XmlContentType
    builder.use FaradayMiddleware::ParseXml

    # Used for debug purpose only.
    # builder.use Faraday::Response::Logger
    
    builder.use Faraday::Adapter::NetHttp
  end
end