Class: Conjur::HostFactoryToken
- Inherits:
-
RestClient::Resource
- Object
- RestClient::Resource
- Conjur::HostFactoryToken
show all
- Includes:
- HasAttributes
- Defined in:
- lib/conjur/host_factory_token.rb
Instance Method Summary
collapse
#attributes, #invalidate, #refresh
Instance Method Details
#cidr ⇒ Object
43
44
45
|
# File 'lib/conjur/host_factory_token.rb', line 43
def cidr
attributes['cidr']
end
|
#expiration ⇒ Object
35
36
37
|
# File 'lib/conjur/host_factory_token.rb', line 35
def expiration
DateTime.iso8601(attributes['expiration'])
end
|
#revoke! ⇒ Object
47
48
49
50
51
|
# File 'lib/conjur/host_factory_token.rb', line 47
def revoke!
invalidate do
RestClient::Resource.new(self['revoke'].url, options).post
end
end
|
#save ⇒ Object
53
54
55
|
# File 'lib/conjur/host_factory_token.rb', line 53
def save
raise "HostFactoryToken attributes are not updatable"
end
|
#to_json(options = {}) ⇒ Object
25
26
27
|
# File 'lib/conjur/host_factory_token.rb', line 25
def to_json(options = {})
{ token: token, expiration: expiration, cidr: cidr }
end
|
#token ⇒ Object
Also known as:
id
29
30
31
|
# File 'lib/conjur/host_factory_token.rb', line 29
def token
self.url.split('/')[-1]
end
|