1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Fix for auth uri using Identity service.

This commit is contained in:
Rupak Ganguly 2012-02-09 17:59:07 -05:00
parent 3445e07e42
commit 0a3fa872e3
4 changed files with 7 additions and 7 deletions

View file

@ -48,15 +48,17 @@ module Fog
# keystone based control services style authentication
def self.authenticate_v2(options, connection_options = {})
hp_auth_uri = options[:hp_auth_uri] || "https://region-a.geo-1.identity.hpcloudsvc.com/v2.0/"
endpoint = URI.parse(hp_auth_uri)
hp_auth_uri = options[:hp_auth_uri] || "https://region-a.geo-1.identity.hpcloudsvc.com:35357v2.0/tokens"
# append /tokens if missing from auth uri
@hp_auth_uri = hp_auth_uri.include?('tokens')? hp_auth_uri : hp_auth_uri + "tokens"
endpoint = URI.parse(@hp_auth_uri)
@scheme = endpoint.scheme || "http"
@host = endpoint.host || "region-a.geo-1.identity.hpcloudsvc.com"
@port = endpoint.port.to_s || "80"
@port = endpoint.port.to_s || "35357"
if (endpoint.path)
@auth_path = endpoint.path.slice(1, endpoint.path.length) # remove the leading slash
else
@auth_path = "v2.0/"
@auth_path = "v2.0/tokens"
end
service_url = "#{@scheme}://#{@host}:#{@port}"
connection = Fog::Connection.new(service_url, false, connection_options)

View file

@ -72,7 +72,7 @@ module Fog
credentials = Fog::HP.authenticate_v2(options, @connection_options)
### When using the v2 CS authentication, the CDN Mgmt comes from the service catalog
@hp_cdn_uri = credentials[:endpoint_url]
cdn_mgmt_url = "#{@hp_cdn_uri}"
cdn_mgmt_url = @hp_cdn_uri
else
# Call the legacy v1.0/v1.1 authentication
credentials = Fog::HP.authenticate_v1(options, @connection_options)

View file

@ -108,7 +108,6 @@ module Fog
require 'multi_json'
@hp_secret_key = options[:hp_secret_key]
@hp_account_id = options[:hp_account_id]
@hp_auth_uri = options[:hp_auth_uri]
@hp_servicenet = options[:hp_servicenet]
@connection_options = options[:connection_options] || {}
### Set an option to use the style of authentication desired; :v1 or :v2 (default)

View file

@ -141,7 +141,6 @@ module Fog
require 'multi_json'
@hp_secret_key = options[:hp_secret_key]
@hp_account_id = options[:hp_account_id]
@hp_auth_uri = options[:hp_auth_uri]
@hp_cdn_ssl = options[:hp_cdn_ssl]
@connection_options = options[:connection_options] || {}
### Set an option to use the style of authentication desired; :v1 or :v2 (default)