Class: Azure::Storage::Table::Auth::SharedKey
- Inherits:
-
Common::Core::Auth::SharedKey
- Object
- Common::Core::Auth::SharedKey
- Azure::Storage::Table::Auth::SharedKey
- Defined in:
- table/lib/azure/storage/table/auth/shared_key.rb
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
34 35 36 |
# File 'table/lib/azure/storage/table/auth/shared_key.rb', line 34 def account_name @account_name end |
Instance Method Details
#canonicalized_resource(uri) ⇒ String
Calculate the Canonicalized Resource string for a request.
58 59 60 61 62 63 64 65 |
# File 'table/lib/azure/storage/table/auth/shared_key.rb', line 58 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.
43 44 45 46 47 48 49 50 51 |
# File 'table/lib/azure/storage/table/auth/shared_key.rb', line 43 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 |