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

[openstack|compute] Added auth_token_expiration.

This commit is contained in:
Alfonso Juan Dillera 2012-07-18 13:26:33 +08:00 committed by Nelvin Driz
parent 155b0c9157
commit b8335b83a0
2 changed files with 4 additions and 0 deletions

View file

@ -148,11 +148,13 @@ module Fog
mgmt_url = svc['endpoints'].detect{|x| x[@endpoint_type]}[@endpoint_type]
identity_url = identity_svc['endpoints'].detect{|x| x['publicURL']}['publicURL'] if identity_svc
token = body['access']['token']['id']
expires = body['access']['token']['expires']
{
:user => user,
:tenant => tenant,
:token => token,
:expires => expires,
:server_management_url => mgmt_url,
:identity_public_endpoint => identity_url,
:current_user_id => body['access']['user']['id']

View file

@ -226,6 +226,7 @@ module Fog
class Real
attr_reader :auth_token
attr_reader :auth_token_expiration
attr_reader :current_user
attr_reader :current_tenant
@ -338,6 +339,7 @@ module Fog
@openstack_must_reauthenticate = false
@auth_token = credentials[:token]
@auth_token_expiration = credentials[:expires]
@openstack_management_url = credentials[:server_management_url]
@openstack_identity_public_endpoint = credentials[:identity_public_endpoint]
uri = URI.parse(@openstack_management_url)