Class: Fog::Identity::OpenStack::V3::Tokens

Inherits:
OpenStack::Collection show all
Defined in:
lib/fog/openstack/models/identity_v3/tokens.rb

Instance Attribute Summary

Attributes inherited from OpenStack::Collection

#response

Instance Method Summary collapse

Methods inherited from OpenStack::Collection

#all, #destroy, #get, #load_response, #summary

Instance Method Details

#authenticate(auth) ⇒ Object



12
13
14
15
16
17
# File 'lib/fog/openstack/models/identity_v3/tokens.rb', line 12

def authenticate(auth)
  response = service.token_authenticate(auth)
  token_hash = response.body['token']
  Fog::Identity::OpenStack::V3::Token.new(
      token_hash.merge(:service => service, :value => response.headers['X-Subject-Token']))
end

#check(subject_token) ⇒ Object



26
27
28
29
# File 'lib/fog/openstack/models/identity_v3/tokens.rb', line 26

def check(subject_token)
  service.token_check(subject_token)
  return true
end

#revoke(subject_token) ⇒ Object



31
32
33
34
# File 'lib/fog/openstack/models/identity_v3/tokens.rb', line 31

def revoke(subject_token)
  service.token_revoke(subject_token)
  return true
end

#validate(subject_token) ⇒ Object



19
20
21
22
23
24
# File 'lib/fog/openstack/models/identity_v3/tokens.rb', line 19

def validate(subject_token)
  response = service.token_validate(subject_token)
  token_hash = response.body['token']
  Fog::Identity::OpenStack::V3::Token.new(
      token_hash.merge(:service => service, :value => response.headers['X-Subject-Token']))
end