Class: Conjur::User
- Inherits:
-
RestClient::Resource
- Object
- RestClient::Resource
- Conjur::User
- Includes:
- ActsAsAsset, ActsAsUser
- Defined in:
- lib/conjur/user.rb
Overview
This class represents a Conjur User.
Instance Method Summary collapse
-
#login ⇒ String
This method is simply an alias for HasId#id.
-
#uidnumber ⇒ Fixnum
Get the user's uidnumber, which is used by LDAP and SSH login, among other things.
-
#uidnumber=(uidnumber)
Set the user's uidnumber, which is used by LDAP and SSH login.
-
#update(options)
Assign new attributes to the user.
Methods included from ActsAsUser
Methods included from ActsAsRole
#can, #cannot, #role, #role_kind, #roleid
Methods included from ActsAsAsset
Methods included from HasAttributes
#attributes, #invalidate, #refresh, #save, #to_json
Methods included from ActsAsResource
#deny, #permit, #resource, #resource_kind, #resourceid
Methods included from HasOwner
Methods included from Exists
Methods included from HasId
Instance Method Details
#login ⇒ String
This method is simply an alias for HasId#id. It returns the user's unqualified id, which is referred to as
login
here because it can be used to login to Conjur.
35 |
# File 'lib/conjur/user.rb', line 35 def login; id end |
#uidnumber ⇒ Fixnum
This feature requires Conjur server version 4.3 or later.
Get the user's uidnumber, which is used by LDAP and SSH login, among other things.
Permissions
You must have the 'show'
permission on the user's resource to call this method
69 70 71 |
# File 'lib/conjur/user.rb', line 69 def uidnumber attributes['uidnumber'] end |
#uidnumber=(uidnumber)
This feature requires Conjur server version 4.3 or later.
This method returns an undefined value.
Set the user's uidnumber, which is used by LDAP and SSH login.
Permissions
You must be a member of the user's role to call this method.
83 84 85 |
# File 'lib/conjur/user.rb', line 83 def uidnumber= uidnumber update uidnumber: uidnumber end |
#update(options)
This feature requires Conjur server version 4.3 or later.
This method returns an undefined value.
Assign new attributes to the user. Currently, this method only lets you change the
:uidnumber
attribute.
If a user with the given :uidnumber
already exists, this method will raise RestClient::Forbidden
, with
the response body providing additional details if possible.
Permissions
You must be a member of the user's role to call this method.
53 54 55 56 57 58 |
# File 'lib/conjur/user.rb', line 53 def update # Currently the server raises a 400 Bad Request if uidnumber is missing, require it here raise ArgumentError "options[:uidnumber] is required" unless uidnumber = [:uidnumber] raise ArgumentError, "options[:uidnumber] must be a Fixnum" unless uidnumber.kind_of?(Fixnum) self.put() end |