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
#api, #api_key, #rotate_api_key, #set_cidr_restrictions
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.
32 |
# File 'lib/conjur/user.rb', line 32 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
74 75 76 |
# File 'lib/conjur/user.rb', line 74 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.
88 89 90 |
# File 'lib/conjur/user.rb', line 88 def uidnumber= uidnumber update uidnumber: uidnumber end |
#update(options)
Updating uidnumber
requires Conjur server version 4.3 or later.
Updating cidr
requires Conjur server version 4.6 or later.
This method returns an undefined value.
Assign new attributes to the user.
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 update the uidnumber. You must have update permission on the user's resource or be the user to update CIDR restrictions.
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/conjur/user.rb', line 53 def update if uidnumber = [:uidnumber] # Currently the server raises a 400 Bad Request if uidnumber is missing, require it here raise ArgumentError, "options[:uidnumber] must be a Fixnum" unless uidnumber.kind_of?(Fixnum) self.put() end if cidr = [:cidr] set_cidr_restrictions cidr end end |