Module: Fog::Storage::AWS::Utils

Included in:
Mock, Real
Defined in:
lib/fog/aws/storage.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#regionObject

Returns the value of attribute region.



114
115
116
# File 'lib/fog/aws/storage.rb', line 114

def region
  @region
end

Instance Method Details

#cdnObject



116
117
118
119
120
121
122
# File 'lib/fog/aws/storage.rb', line 116

def cdn
  @cdn ||= Fog::AWS::CDN.new(
    :aws_access_key_id => @aws_access_key_id,
    :aws_secret_access_key => @aws_secret_access_key,
    :use_iam_profile => @use_iam_profile
  )
end

#http_url(params, expires) ⇒ Object



124
125
126
# File 'lib/fog/aws/storage.rb', line 124

def http_url(params, expires)
  signed_url(params.merge(:scheme => 'http'), expires)
end

#https_url(params, expires) ⇒ Object



128
129
130
# File 'lib/fog/aws/storage.rb', line 128

def https_url(params, expires)
  signed_url(params.merge(:scheme => 'https'), expires)
end

#request_url(params) ⇒ Object



137
138
139
140
# File 'lib/fog/aws/storage.rb', line 137

def request_url(params)
  params = request_params(params)
  params_to_url(params)
end

#signed_url(params, expires) ⇒ Object



142
143
144
145
146
147
148
149
150
151
152
# File 'lib/fog/aws/storage.rb', line 142

def signed_url(params, expires)
  #convert expires from a point in time to a delta to now
  expires = expires.to_i
  if @signature_version == 4
    params = v4_signed_params_for_url(params, expires)
  else
    params = v2_signed_params_for_url(params, expires)
  end

  params_to_url(params)
end

#url(params, expires) ⇒ Object



132
133
134
135
# File 'lib/fog/aws/storage.rb', line 132

def url(params, expires)
  Fog::Logger.deprecation("Fog::Storage::AWS => #url is deprecated, use #https_url instead [light_black](#{caller.first})[/]")
  https_url(params, expires)
end