Class: ConfigureS3Website::HttpHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/configure-s3-website/http_helper.rb

Class Method Summary collapse

Class Method Details

.call_cloudfront_api(path, method, body, config_source, headers = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/configure-s3-website/http_helper.rb', line 18

def self.call_cloudfront_api(path, method, body, config_source, headers = {})
  date = Time.now.utc.strftime("%a, %d %b %Y %H:%M:%S %Z")
  digest = create_cloudfront_digest(config_source, date)
  self.call_api(
    path,
    method,
    body,
    config_source,
    'cloudfront.amazonaws.com',
    digest,
    date,
    headers
  )
end

.call_s3_api(path, method, body, config_source) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/configure-s3-website/http_helper.rb', line 3

def self.call_s3_api(path, method, body, config_source)
  endpoint = Endpoint.by_config_source(config_source)
  date = Time.now.utc.strftime("%a, %d %b %Y %H:%M:%S %Z")
  digest = create_s3_digest(path, method, config_source, date)
  self.call_api(
    path,
    method,
    body,
    config_source,
    endpoint.hostname,
    digest,
    date
  )
end