Permalink
Browse files

Renames hp_account_meta_key to os_account_meta_temp_url_key

  • Loading branch information...
1 parent 4fe2865 commit 90e50e5502e26524956811cd7c551a12627bec79 @enterprise-rails enterprise-rails committed Jun 26, 2013
Showing with 10 additions and 8 deletions.
  1. +10 −8 lib/fog/hp/storage.rb
View
@@ -10,9 +10,11 @@ class HP < Fog::Service
recognizes :persistent, :connection_options
recognizes :hp_use_upass_auth_style, :hp_auth_version, :user_agent
recognizes :hp_access_key, :hp_account_id # :hp_account_id is deprecated use hp_access_key instead
- recognizes :hp_account_meta_key
+
+ # :os_account_meta_temp_url_key is an OpenStack specific setting used to generate temporary urls.
+ recognizes :os_account_meta_temp_url_key
- secrets :hp_secret_key, :hp_account_meta_key
+ secrets :hp_secret_key, :os_account_meta_temp_url_key
model_path 'fog/hp/models/storage'
model :directory
@@ -173,10 +175,10 @@ def generate_object_temp_url(container, object, expires_secs, method)
# HP uses a different strategy to create the signature that is passed to swift than OpenStack.
# As the HP provider is broadly used by OpenStack users the OpenStack strategy is applied when
- # the @hp_account_meta_key is given.
- if @hp_account_meta_key then
- hmac = OpenSSL::HMAC.new(@hp_account_meta_key, OpenSSL::Digest::SHA1.new)
- signature = hmac.update(string_to_sign).hexdigest
+ # the @os_account_meta_temp_url_key is given.
+ if @os_account_meta_temp_url_key then
+ hmac = OpenSSL::HMAC.new(@os_account_meta_temp_url_key, OpenSSL::Digest::SHA1.new)
+ signature= hmac.update(string_to_sign).hexdigest
else
# Only works with 1.9+ Not compatible with 1.8.7
#signed_string = Digest::HMAC.hexdigest(string_to_sign, @hp_secret_key, Digest::SHA1)
@@ -230,7 +232,7 @@ def initialize(options={})
end
@hp_secret_key = options[:hp_secret_key]
@hp_tenant_id = options[:hp_tenant_id]
- @hp_account_meta_key = options[:hp_account_meta_key]
+ @os_account_meta_temp_url_key = options[:os_account_meta_temp_url_key]
end
def data
@@ -268,7 +270,7 @@ def initialize(options={})
options[:hp_service_type] = "Object Storage"
@hp_tenant_id = options[:hp_tenant_id]
@hp_avl_zone = options[:hp_avl_zone]
- @hp_account_meta_key = options[:hp_account_meta_key]
+ @os_account_meta_temp_url_key = options[:os_account_meta_temp_url_key]
### Make the authentication call
if (auth_version == :v2)

0 comments on commit 90e50e5

Please sign in to comment.