Skip to content

Commit

Permalink
Merge remote branch 'minter/rackspace_ssl'
Browse files Browse the repository at this point in the history
  • Loading branch information
geemus committed Mar 24, 2011
2 parents b7b73e5 + 96366ef commit c47e7ca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/fog/core/credentials.rb
Expand Up @@ -85,6 +85,7 @@ def self.missing_credentials
:rackspace_api_key:
:rackspace_username:
:rackspace_servicenet:
:rackspace_cdn_ssl:
:slicehost_password:
:terremark_username:
:terremark_password:
Expand Down
10 changes: 8 additions & 2 deletions lib/fog/storage/models/rackspace/directory.rb
Expand Up @@ -38,7 +38,13 @@ def public_url
requires :key
@public_url ||= begin
begin response = connection.cdn.head_container(key)
response.headers['X-CDN-Enabled'] == 'True' && response.headers['X-CDN-URI']
if response.headers['X-CDN-Enabled'] == 'True'
if connection.rackspace_cdn_ssl == true
response.headers['X-CDN-SSL-URI']
else
response.headers['X-CDN-URI']
end
end
rescue Fog::Service::NotFound
nil
end
Expand All @@ -56,7 +62,7 @@ def save
end
true
end

end

end
Expand Down
4 changes: 3 additions & 1 deletion lib/fog/storage/rackspace.rb
Expand Up @@ -3,7 +3,7 @@ module Rackspace
class Storage < Fog::Service

requires :rackspace_api_key, :rackspace_username
recognizes :rackspace_auth_url, :rackspace_servicenet, :persistent
recognizes :rackspace_auth_url, :rackspace_servicenet, :rackspace_cdn_ssl, :persistent
recognizes :provider # remove post deprecation

model_path 'fog/storage/models/rackspace'
Expand Down Expand Up @@ -68,6 +68,7 @@ def reset_data

class Real
include Utils
attr_reader :rackspace_cdn_ssl

def initialize(options={})
unless options.delete(:provider)
Expand All @@ -81,6 +82,7 @@ def initialize(options={})
require 'json'
@rackspace_api_key = options[:rackspace_api_key]
@rackspace_username = options[:rackspace_username]
@rackspace_cdn_ssl = options[:rackspace_cdn_ssl]
credentials = Fog::Rackspace.authenticate(options)
@auth_token = credentials['X-Auth-Token']

Expand Down

0 comments on commit c47e7ca

Please sign in to comment.