Class: Azure::Storage::Common::Core::Auth::SharedKey

Inherits:
Core::Auth::SharedKey show all
Defined in:
lib/azure/storage/common/core/auth/shared_key.rb

Instance Attribute Summary

Attributes inherited from Core::Auth::SharedKey

#account_name

Attributes inherited from Core::Auth::Signer

#access_key

Instance Method Summary collapse

Methods inherited from Core::Auth::SharedKey

#canonicalized_headers, #canonicalized_resource, #initialize, #name, #sign, #sign_request

Methods inherited from Core::Auth::Signer

#initialize, #sign

Constructor Details

This class inherits a constructor from Azure::Core::Auth::SharedKey

Instance Method Details

#signable_string(method, uri, headers) ⇒ String

Generate the string to sign.

Parameters:

  • method (Symbol)

    HTTP request method.

  • uri (URI)

    URI of the request we’re signing.

  • headers (Hash)

    HTTP request headers.

Returns:



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# 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