Module: Fog::Rackspace::Identity::Common

Included in:
Mock, Real
Defined in:
lib/fog/rackspace/identity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#auth_tokenObject (readonly)

Returns the value of attribute auth_token



37
38
39
# File 'lib/fog/rackspace/identity.rb', line 37

def auth_token
  @auth_token
end

#service_catalogObject (readonly)

Returns the value of attribute service_catalog



37
38
39
# File 'lib/fog/rackspace/identity.rb', line 37

def service_catalog
  @service_catalog
end

Instance Method Details

#apply_options(options) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/fog/rackspace/identity.rb', line 45

def apply_options(options)
  @rackspace_username = options[:rackspace_username]
  @rackspace_api_key = options[:rackspace_api_key]
  @rackspace_region = options[:rackspace_region]
  @rackspace_auth_url = options[:rackspace_auth_url] || US_ENDPOINT

  @uri = URI.parse(@rackspace_auth_url)
  @host = @uri.host
  @path = @uri.path
  @port = @uri.port
  @scheme = @uri.scheme
  @persistent = options[:persistent] || false
  @connection_options = options[:connection_options] || {}
end

#authenticate(options = {}) ⇒ Object



39
40
41
42
43
# File 'lib/fog/rackspace/identity.rb', line 39

def authenticate(options={})
  data = self.create_token(@rackspace_username, @rackspace_api_key).body
  @service_catalog = ServiceCatalog.from_response(self, data)
  @auth_token = data['access']['token']['id']
end