class Azure::Storage::Common::Core::Auth::SharedKey

Public Instance Methods

signable_string(method, uri, headers) click to toggle source

Generate the string to sign.

@param method [Symbol] HTTP request method. @param uri [URI] URI of the request we're signing. @param headers [Hash] HTTP request headers.

@return [String]

# File lib/azure/storage/common/core/auth/shared_key.rb, line 40
def signable_string(method, uri, headers)
  [
    method.to_s.upcase,
    headers.fetch("Content-Encoding", ""),
    headers.fetch("Content-Language", ""),
    headers.fetch("Content-Length", "").sub(/^0+/, ""), # from 2015-02-21, if Content-Length == 0, it won't be signed
    headers.fetch("Content-MD5", ""),
    headers.fetch("Content-Type", ""),
    headers.fetch("Date", ""),
    headers.fetch("If-Modified-Since", ""),
    headers.fetch("If-Match", ""),
    headers.fetch("If-None-Match", ""),
    headers.fetch("If-Unmodified-Since", ""),
    headers.fetch("Range", ""),
    canonicalized_headers(headers),
    canonicalized_resource(uri)
  ].join("\n")
end