Class: Conjur::Deputy
- Inherits:
-
RestClient::Resource
- Object
- RestClient::Resource
- Conjur::Deputy
- Includes:
- ActsAsResource, ActsAsUser, Exists, HasAttributes, HasId, HasIdentifier
- Defined in:
- lib/conjur/deputy.rb
Overview
A Deputy is an actor, typically representing a service. It is given a login and an api key, just like Hosts and Users, and can perform various actions.
You should not create instances of this class directly. Instead, you can get a Deputy instance with API#deputy or API#create_deputy.
The deputies api is stable, but is primarily used internally.
Direct Known Subclasses
Instance Method Summary collapse
-
#api_key ⇒ String
API Key that can be used to login as the deputy.
-
#login ⇒ String
Login for the deputy.
Methods included from ActsAsResource
#deny, #permit, #resource, #resource_kind, #resourceid
Methods included from ActsAsUser
#api, #rotate_api_key, #set_cidr_restrictions
Methods included from ActsAsRole
#can, #cannot, #role, #role_kind, #roleid
Methods included from HasAttributes
#attributes, #invalidate, #refresh, #save, #to_json
Methods included from HasIdentifier
Methods included from HasId
Methods included from Exists
Instance Method Details
#api_key ⇒ String
API Key that can be used to login as the deputy.
This is only available if the Conjur::Deputy was returned by API#create_deputy.
51 52 53 |
# File 'lib/conjur/deputy.rb', line 51 def api_key self.attributes['api_key'] end |
#login ⇒ String
Login for the deputy. Of the form "deputy/
41 42 43 |
# File 'lib/conjur/deputy.rb', line 41 def login [ self.class.name.split('::')[-1].downcase, id ].join('/') end |