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

[openstack] Update Authentication through X-Auth-Token

This commit is contained in:
Nelvin Driz 2012-03-04 22:01:55 +08:00
parent cf3d45203b
commit ae66ab45d7
4 changed files with 22 additions and 8 deletions

View file

@ -74,18 +74,29 @@ module Fog
@openstack_api_key = options[:openstack_api_key]
@openstack_username = options[:openstack_username]
@openstack_tenant = options[:openstack_tenant]
@service_name = options[:openstack_service_name]
@openstack_auth_token = options[:openstack_auth_token]
@service_name = options[:openstack_service_name]
@identity_service_name = options[:openstack_identity_service_name]
@endpoint_type = options[:openstack_endpoint_type] || 'publicURL'
@endpoint_type = options[:openstack_endpoint_type] || 'publicURL'
req_body= {
'auth' => {
'passwordCredentials' => {
'username' => @openstack_username,
'password' => @openstack_api_key
if @openstack_auth_token
req_body = {
'auth' => {
'token' => {
'id' => @openstack_auth_token
}
}
}
}
else
req_body = {
'auth' => {
'passwordCredentials' => {
'username' => @openstack_username,
'password' => @openstack_api_key
}
}
}
end
req_body['auth']['tenantName'] = @openstack_tenant if @openstack_tenant
body = retrieve_tokens_v2(connection, req_body, uri)

View file

@ -273,6 +273,7 @@ module Fog
options = {
:openstack_api_key => @openstack_api_key,
:openstack_username => @openstack_username,
:openstack_auth_token => @openstack_auth_token,
:openstack_auth_uri => @openstack_auth_uri,
:openstack_tenant => @openstack_tenant,
:openstack_service_name => @openstack_service_name,

View file

@ -166,6 +166,7 @@ module Fog
options = {
:openstack_api_key => @openstack_api_key,
:openstack_username => @openstack_username,
:openstack_auth_token => @openstack_auth_token,
:openstack_auth_uri => @openstack_auth_uri,
:openstack_tenant => @openstack_tenant,
:openstack_service_name => @openstack_service_name,

View file

@ -141,6 +141,7 @@ module Fog
:openstack_api_key => @openstack_api_key,
:openstack_username => @openstack_username,
:openstack_auth_uri => @openstack_auth_uri,
:openstack_auth_token => @openstack_auth_token,
:openstack_service_name => @openstack_service_name,
:openstack_endpoint_type => 'adminURL'
}