Class: SwiftStorage::Account

Inherits:
Node
  • Object
show all
Defined in:
lib/swift_storage/account.rb

Constant Summary

Constants included from Headers

Headers::ACCOUNT_TEMP_URL_KEY, Headers::AUTH_KEY, Headers::AUTH_TOKEN, Headers::AUTH_USER, Headers::CACHE_CONTROL, Headers::CONNECTION, Headers::CONTAINER_READ, Headers::CONTAINER_WRITE, Headers::CONTENT_DISPOSITION, Headers::CONTENT_TYPE, Headers::DELETE_AFTER, Headers::DELETE_AT, Headers::DESTINATION, Headers::EXPIRES, Headers::OBJECT_MANIFEST, Headers::PROXY_CONNECTION, Headers::STORAGE_TOKEN, Headers::STORAGE_URL

Instance Attribute Summary

Attributes inherited from Node

#name, #parent

Instance Method Summary collapse

Methods inherited from Node

#clear_cache, #delete, #delete_if_exists, #exists?, #get_lines, #headers, #initialize, #metadata, #request, #service, #to_s

Methods included from Utils

#hmac, #sig_to_hex, #struct

Constructor Details

This class inherits a constructor from SwiftStorage::Node

Instance Method Details

#relative_pathObject



27
28
29
# File 'lib/swift_storage/account.rb', line 27

def relative_path
  ''
end

#temp_url_keyString

Returns the temporary URL key

Returns:

  • (String)

    Key used to sign temporary URLs



23
24
25
# File 'lib/swift_storage/account.rb', line 23

def temp_url_key
  .temp_url_key rescue nil
end

#write(temp_url_key: nil) ⇒ Object

Write account meta data

Parameters:

  • temp_url_key (String) (defaults to: nil)

    The shared secret used to sign temporary URLs. Changing this key will invalidate all temporary URLs signed with the older key.



11
12
13
14
15
16
# File 'lib/swift_storage/account.rb', line 11

def write(temp_url_key: nil)
  h = {}
  h[ACCOUNT_TEMP_URL_KEY] = temp_url_key if temp_url_key

  request(relative_path, :method => :post, :headers => h)
end