Module: Conjur::ActsAsUser
Overview
This module provides methods for things that are like users (specifically, those that have api keys).
Instance Method Summary collapse
-
#api ⇒ Conjur::API
Create an api logged in as this user-like thing.
-
#api_key ⇒ String
Returns a newly created user's api_key.
Methods included from ActsAsRole
#can, #cannot, #role, #role_kind, #roleid
Instance Method Details
#api ⇒ Conjur::API
Note:
As with #api_key, this method only works on newly created instances.
Create an api logged in as this user-like thing.
43 44 45 |
# File 'lib/conjur/acts_as_user.rb', line 43 def api Conjur::API.new_from_key login, api_key end |
#api_key ⇒ String
Note:
this method can only be called on newly created user-like things (those returned from, for example,) Conjur::API#create_user.
Returns a newly created user's api_key.
34 35 36 |
# File 'lib/conjur/acts_as_user.rb', line 34 def api_key attributes['api_key'] or raise "api_key is only available on a newly created #{self.class.name.downcase}" end |