Class: Conjur::Deputy

Inherits:
RestClient::Resource
  • Object
show all
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

Host

Instance Method Summary collapse

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

#identifier

Methods included from HasId

#id

Methods included from Exists

#exists?

Instance Method Details

#api_keyString

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.

Returns:

  • (String)

    the api key.



51
52
53
# File 'lib/conjur/deputy.rb', line 51

def api_key
  self.attributes['api_key']
end

#loginString

Login for the deputy. Of the form "deputy/".

Returns:

  • (String)

    the login.



41
42
43
# File 'lib/conjur/deputy.rb', line 41

def 
  [ self.class.name.split('::')[-1].downcase, id ].join('/')
end