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

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

Instance Attribute Summary

Attributes inherited from OpenStack::Collection

#response

Instance Method Summary collapse

Methods inherited from OpenStack::Collection

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

Instance Method Details

#authenticate(auth) ⇒ Object


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

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


27
28
29
30
# File 'lib/fog/identity/openstack/v3/models/tokens.rb', line 27

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

#revoke(subject_token) ⇒ Object


32
33
34
35
# File 'lib/fog/identity/openstack/v3/models/tokens.rb', line 32

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

#validate(subject_token) ⇒ Object


19
20
21
22
23
24
25
# File 'lib/fog/identity/openstack/v3/models/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