def __init__(self, config, logger, name, attrslist, key):
        """Backend initialization"""
        # Recover all the parameters
        self.config = config
        self._logger = logger
        self.backend_name = name
        self.backend_display_name = self.get_param('display_name')
        self.binddn = self.get_param('binddn')
        self.bindpassword = self.get_param('password')
        self.ca = self.get_param('ca', False)
        self.checkcert = self.get_param('checkcert', 'on')
        self.starttls = self.get_param('starttls', 'off')
        self.uri = self.get_param('uri')
        self.timeout = self.get_param('timeout', 1)
        self.userdn = self.get_param('userdn')
        self.groupdn = self.get_param('groupdn')
        self.user_filter_tmpl = self.get_param('user_filter_tmpl')
        self.group_filter_tmpl = self.get_param('group_filter_tmpl')
        self.search_filter_tmpl = self.get_param('search_filter_tmpl')
        self.dn_user_attr = self.get_param('dn_user_attr')
        self.objectclasses = []
        self.key = key
        # objectclasses parameter is a coma separated list in configuration
        # split it to get a real list, and convert it to bytes
        for o in re.split(r'\W+', self.get_param('objectclasses')):
            self.objectclasses.append(self._byte_p23(o))
        self.group_attrs = {}
        self.group_attrs_keys = set([])
        for param in config:
            name, sep, group = param.partition('.')
            if name == 'group_attr':
                self.group_attrs[group] = self.get_param(param)
                self.group_attrs_keys |= set(
                    self._extract_format_keys(self.get_param(param))
                )

        self.attrlist = []
        for a in attrslist:
            self.attrlist.append(self._byte_p2(a))
def __init__ ( self , config , logger , name , attrslist , key ) : self . config = config self . _logger = logger self . backend_name = name self . backend_display_name = self . get_param ( 'display_name' ) self . binddn = self . get_param ( 'binddn' ) self . bindpassword = self . get_param ( 'password' ) self . ca = self . get_param ( 'ca' , False ) self . checkcert = self . get_param ( 'checkcert' , 'on' ) self . starttls = self . get_param ( 'starttls' , 'off' ) self . uri = self . get_param ( 'uri' ) self . timeout = self . get_param ( 'timeout' , 1 ) self . userdn = self . get_param ( 'userdn' ) self . groupdn = self . get_param ( 'groupdn' ) self . user_filter_tmpl = self . get_param ( 'user_filter_tmpl' ) self . group_filter_tmpl = self . get_param ( 'group_filter_tmpl' ) self . search_filter_tmpl = self . get_param ( 'search_filter_tmpl' ) self . dn_user_attr = self . get_param ( 'dn_user_attr' ) self . objectclasses = [ ] self . key = key for o in re . split ( r'\W+' , self . get_param ( 'objectclasses' ) ) : self . objectclasses . append ( self . _byte_p23 ( o ) ) self . group_attrs = { } self . group_attrs_keys = set ( [ ] ) for param in config : name , sep , group = param . partition ( '.' ) if name == 'group_attr' : self . group_attrs [ group ] = self . get_param ( param ) self . group_attrs_keys |= set ( self . _extract_format_keys ( self . get_param ( param ) ) ) self . attrlist = [ ] for a in attrslist : self . attrlist . append ( self . _byte_p2 ( a ) )
Backend initialization