Class: Azure::Table::Auth::SharedKey
- Inherits:
-
Core::Auth::SharedKey
- Object
- Core::Auth::SharedKey
- Azure::Table::Auth::SharedKey
- Defined in:
- lib/azure/table/auth/shared_key.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#account_name ⇒ Object
readonly
The account name.
Instance Method Summary collapse
-
#canonicalized_resource(uri) ⇒ String
Calculate the Canonicalized Resource string for a request.
-
#signable_string(method, uri, headers) ⇒ Object
Generate the string to sign.
Instance Attribute Details
#account_name ⇒ Object (readonly)
The account name
23 24 25 |
# File 'lib/azure/table/auth/shared_key.rb', line 23 def account_name @account_name end |
Instance Method Details
#canonicalized_resource(uri) ⇒ String
Calculate the Canonicalized Resource string for a request.
47 48 49 50 51 52 53 54 |
# File 'lib/azure/table/auth/shared_key.rb', line 47 def canonicalized_resource(uri) resource = "/#{account_name}#{uri.path}" comp = CGI.parse(uri.query.to_s).fetch('comp', nil) resource = [resource, 'comp=' + comp[0]].join('?') if comp resource end |
#signable_string(method, uri, headers) ⇒ Object
Generate the string to sign.
Returns a plain text string.
32 33 34 35 36 37 38 39 40 |
# File 'lib/azure/table/auth/shared_key.rb', line 32 def signable_string(method, uri, headers) [ method.to_s.upcase, headers.fetch('Content-MD5', ''), headers.fetch('Content-Type', ''), headers.fetch('Date') { headers.fetch('x-ms-date') }, canonicalized_resource(uri) ].join("\n") end |