mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Support for serving Rackspace CDN objects via SSL.
This commit is contained in:
parent
6941fc6dfe
commit
8c457441d4
3 changed files with 6 additions and 3 deletions
|
@ -85,6 +85,7 @@ An alternate file may be used by placing its path in the FOG_RC environment vari
|
|||
:rackspace_api_key:
|
||||
:rackspace_username:
|
||||
:rackspace_servicenet:
|
||||
:rackspace_cdn_ssl:
|
||||
:slicehost_password:
|
||||
:terremark_username:
|
||||
:terremark_password:
|
||||
|
|
|
@ -38,7 +38,7 @@ module Fog
|
|||
requires :key
|
||||
@public_url ||= begin
|
||||
begin response = connection.cdn.head_container(key)
|
||||
response.headers['X-CDN-Enabled'] == 'True' && response.headers['X-CDN-URI']
|
||||
response.headers['X-CDN-Enabled'] == 'True' && (connection.rackspace_cdn_ssl == true ? response.headers['X-CDN-SSL-URI'] : response.headers['X-CDN-URI'])
|
||||
rescue Fog::Service::NotFound
|
||||
nil
|
||||
end
|
||||
|
@ -56,7 +56,7 @@ module Fog
|
|||
end
|
||||
true
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
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'
|
||||
|
@ -68,6 +68,7 @@ module Fog
|
|||
|
||||
class Real
|
||||
include Utils
|
||||
attr_reader :rackspace_cdn_ssl
|
||||
|
||||
def initialize(options={})
|
||||
unless options.delete(:provider)
|
||||
|
@ -81,6 +82,7 @@ module Fog
|
|||
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']
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue