6.2.1.2. useridresolver.PasswdIdResolver module¶
- This module implements the communication interface
- for resolvin user info to the /etc/passwd user base
- PasswdIdResolver.IdResolver class
- implements the UserIdResolver for local /etc/passwd lookup
- Remarks:
- Don’t use this as an enterprise solution!
- class useridresolver.PasswdIdResolver.IdResolver[source]¶
Bases: useridresolver.UserIdResolver.UserIdResolver
- checkPass(uid, password)[source]¶
This function checks the password for a given uid. - returns true in case of success - false if password does not match
We do not support shadow passwords at the moment. so the seconds column of the passwd file needs to contain the crypted password
- fields = {'username': 1, 'phone': 0, 'surname': 0, 'description': 0, 'mobile': 0, 'gender': 0, 'givenname': 0, 'userid': 1, 'email': 0}¶
- classmethod getResolverClassDescriptor()[source]¶
return the descriptor of the resolver, which is - the class name and - the config description
Returns: resolver description dict Return type: dict
- getSearchFields(searchDict=None)[source]¶
show, which search fields this userIdResolver supports
TODO: implementation is not completed
Parameters: searchDict – fields, which should be queried Returns: dict of all searchFields
- getUserId(LoginName)[source]¶
search the user id from the login name
Parameters: LoginName – the login of the user Returns: the userId
- getUserInfo(userId, no_passwd=False)[source]¶
get some info about the user as we only have the loginId, we have to traverse the dict for the value
Parameters: - userId – the to be searched user
- no_passwd – retrun no password
Returns: dict of user info
- getUserList(searchDict)[source]¶
get a list of all users matching the search criteria of the searchdict
Parameters: searchDict – dict of search expressions
- getUsername(userId)[source]¶
## TODO: why does this return bool
Parameters: userId – the user to be searched Returns: true, if a user id exists
- loadConfig(configDict)[source]¶
The UserIdResolver could be configured from the pylon app config - here this could be the passwd file , whether it is /etc/passwd or /etc/shadow
- sF = {'username': 0, 'userid': 2, 'description': 4, 'cryptpass': 1, 'email': 4}¶
- searchFields = {'username': 'text', 'userid': 'numeric', 'description': 'text', 'email': 'text'}¶