Class: Azure::Storage::Auth::SharedKeyLite

Inherits:
SharedKey show all
Defined in:
lib/azure/storage/core/auth/shared_key_lite.rb

Instance Attribute Summary

Attributes inherited from SharedKey

#account_name

Attributes inherited from Core::Auth::Signer

#access_key

Instance Method Summary collapse

Methods inherited from SharedKey

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

Methods inherited from Core::Auth::Signer

#initialize, #sign

Constructor Details

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

Instance Method Details

#nameString

The name of the strategy.

Returns:


23
24
25
# File 'lib/azure/storage/core/auth/shared_key_lite.rb', line 23

def name
  'SharedKeyLite'
end

#signable_string(method, uri, headers) ⇒ Object

Generate the string to sign.

Returns a plain text string.

Parameters:

  • method (Symbol)

    The HTTP request method.

  • uri (URI)

    The URI of the request we're signing.

  • headers (Hash)

    A Hash of HTTP request headers.


34
35
36
37
38
39
40
41
42
43
# File 'lib/azure/storage/core/auth/shared_key_lite.rb', line 34

def signable_string(method, uri, headers)
  [
    method.to_s.upcase,
    headers.fetch('Content-MD5', ''),
    headers.fetch('Content-Type', ''),
    headers.fetch('Date') { raise IndexError, 'Headers must include Date' },
    canonicalized_headers(headers),
    canonicalized_resource(uri)
  ].join("\n")
end