module Fog::Storage::GoogleJSON::Utils

Public Instance Methods

http_url(params, expires) click to toggle source
# File lib/fog/storage/google_json/utils.rb, line 5
def http_url(params, expires)
  "http://" << host_path_query(params, expires)
end
https_url(params, expires) click to toggle source
# File lib/fog/storage/google_json/utils.rb, line 9
def https_url(params, expires)
  "https://" << host_path_query(params, expires)
end
url(params, expires) click to toggle source
# File lib/fog/storage/google_json/utils.rb, line 13
def url(params, expires)
  Fog::Logger.deprecation("Fog::Storage::Google => #url is deprecated, use #https_url instead [light_black](#{caller.first})[/]")
  https_url(params, expires)
end

Private Instance Methods

host_path_query(params, expires) click to toggle source
# File lib/fog/storage/google_json/utils.rb, line 20
def host_path_query(params, expires)
  params[:headers]["Date"] = expires.to_i
  params[:path] = CGI.escape(params[:path]).gsub("%2F", "/")
  query = [params[:query]].compact
  query << "GoogleAccessId=#{@client.authorization.issuer}"
  query << "Signature=#{CGI.escape(signature(params))}"
  query << "Expires=#{params[:headers]['Date']}"
  "#{params[:host]}/#{params[:path]}?#{query.join('&')}"
end