mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[vcloud|compute] make auth work
This commit is contained in:
parent
62ede3ea37
commit
792dbebef2
2 changed files with 13 additions and 7 deletions
|
@ -13,7 +13,7 @@ module Fog
|
||||||
},
|
},
|
||||||
:method => 'POST',
|
:method => 'POST',
|
||||||
:parse => true,
|
:parse => true,
|
||||||
:uri => login_uri
|
:uri => "#{base_url}/login"
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -627,7 +627,7 @@ module Fog
|
||||||
include MockDataClasses
|
include MockDataClasses
|
||||||
|
|
||||||
def self.base_url
|
def self.base_url
|
||||||
"https://fakey.com/api/v0.8b-ext2.6"
|
"https://fakey.com/api/v1.0"
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.data_reset
|
def self.data_reset
|
||||||
|
@ -750,7 +750,9 @@ module Fog
|
||||||
@connections = {}
|
@connections = {}
|
||||||
@persistent = options[:persistent]
|
@persistent = options[:persistent]
|
||||||
|
|
||||||
@host = options[:vcloud_host] || Fog::Vcloud::Compute::HOST
|
@username = options[:vcloud_username]
|
||||||
|
@password = options[:vcloud_password]
|
||||||
|
@host = options[:vcloud_host]
|
||||||
@path = options[:vcloud_path] || Fog::Vcloud::Compute::PATH
|
@path = options[:vcloud_path] || Fog::Vcloud::Compute::PATH
|
||||||
@port = options[:vcloud_port] || Fog::Vcloud::Compute::PORT
|
@port = options[:vcloud_port] || Fog::Vcloud::Compute::PORT
|
||||||
@scheme = options[:vcloud_scheme] || Fog::Vcloud::Compute::SCHEME
|
@scheme = options[:vcloud_scheme] || Fog::Vcloud::Compute::SCHEME
|
||||||
|
@ -806,6 +808,10 @@ module Fog
|
||||||
do_request(params)
|
do_request(params)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def base_url
|
||||||
|
"#{@scheme}://#{@host}:#{@port}#{@path}"
|
||||||
|
end
|
||||||
|
|
||||||
# Use this to set the Authorization header for login
|
# Use this to set the Authorization header for login
|
||||||
def authorization_header
|
def authorization_header
|
||||||
"Basic #{Base64.encode64("#{@username}:#{@password}").chomp!}"
|
"Basic #{Base64.encode64("#{@username}:#{@password}").chomp!}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue