useridresolver.UserIdResolver module

This module implements the communication interface for resolvin user info to the user base:

UserIdResolver Interface class.

Defines the rough interface for a UserId Resolver

== a UserId Resolver is required to resolve the
Login Name to an unique User Identifier
  • for /etc/passwd this will be the uid
  • for ldap this might be the DN
  • for SQL the unique index ( what’s the right name here (tm))
exception useridresolver.UserIdResolver.ResolverLoadConfigError[source]

Bases: exceptions.Exception

class useridresolver.UserIdResolver.UserIdResolver[source]

Bases: object

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

close()[source]

Hook to close down the resolver after one request

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
classmethod getResolverClassType()[source]

provide the resolver type for registration

getResolverDescriptor()[source]

return the descriptor of the resolver, which is - the class name and - the config description

Returns:resolver description dict
Return type:dict
getResolverId()[source]

get resolver specific information :return: the resolver identifier string - empty string if not exist

getResolverType()[source]

getResolverType - return the type of the resolver

Returns:returns the string ‘ldapresolver’
Return type:string
getUserId(LoginName)[source]
  • returns the identifier string
  • empty string if not exist
getUserInfo(userid)[source]

This function returns all user information for a given user object identified by UserID.

Returns:dictionary, if no object is found, the dictionary is empty
getUserList(serachDict)[source]

This function finds the user objects, that have the term ‘value’ in the user object field ‘key’

Parameters:searchDict – dict with key values of user attributes - the key may be something like ‘loginname’ or ‘email’ the value is a regular expression.
Returns:list of dictionaries (each dictionary contains a user object) or an empty string if no object is found.
getUsername(LoginId)[source]
  • returns the loginname string
  • empty string if not exist
id = ''
loadConfig(config, conf)[source]
name = ''
useridresolver.UserIdResolver.getResolverClass(packageName, className)[source]

helper method to load the UserIdResolver class from a given package in literal. Checks, if the getUserId method exists, if not an error is thrown

example:

getResolverClass(“PasswdIdResolver”, “IdResolver”)()
Parameters:
  • packageName – the name package + module
  • className – the name of the class, which should be loaded
Returns:

the class object