소스 검색

ldap auth: remove unused code

Bastien Sevajol 9 년 전
부모
커밋
6608789dd4
1개의 변경된 파일1개의 추가작업 그리고 11개의 파일을 삭제
  1. 1 11
      tracim/tracim/lib/auth/ldap.py

+ 1 - 11
tracim/tracim/lib/auth/ldap.py 파일 보기

37
         self._config['sa_auth'].authmetadata = LDAPApplicationAuthMetadata(self._config.get('sa_auth'))
37
         self._config['sa_auth'].authmetadata = LDAPApplicationAuthMetadata(self._config.get('sa_auth'))
38
 
38
 
39
     def _get_ldap_auth(self):
39
     def _get_ldap_auth(self):
40
-        auth_plug = LDAPSearchAuthenticatorPlugin(
40
+        return LDAPSearchAuthenticatorPlugin(
41
             url=self._config.get('ldap_url'),
41
             url=self._config.get('ldap_url'),
42
             base_dn=self._config.get('ldap_base_dn'),
42
             base_dn=self._config.get('ldap_base_dn'),
43
             bind_dn=self._config.get('ldap_bind_dn'),
43
             bind_dn=self._config.get('ldap_bind_dn'),
47
             naming_attribute=self._config.get('ldap_naming_attribute'),
47
             naming_attribute=self._config.get('ldap_naming_attribute'),
48
             start_tls=ini_conf_to_bool(self._config.get('ldap_tls', False)),
48
             start_tls=ini_conf_to_bool(self._config.get('ldap_tls', False)),
49
         )
49
         )
50
-        auth_plug.set_auth(self)
51
-        return auth_plug
52
 
50
 
53
     def _get_ldap_user_provider(self):
51
     def _get_ldap_user_provider(self):
54
         return LDAPAttributesPlugin(
52
         return LDAPAttributesPlugin(
76
 
74
 
77
 class LDAPSearchAuthenticatorPlugin(BaseLDAPSearchAuthenticatorPlugin):
75
 class LDAPSearchAuthenticatorPlugin(BaseLDAPSearchAuthenticatorPlugin):
78
 
76
 
79
-    def __init__(self, *args, **kwargs):
80
-        super().__init__(*args, **kwargs)
81
-        self._auth = None
82
-        self._user_api = UserApi(None)
83
-
84
-    def set_auth(self, auth):
85
-        self._auth = auth
86
-
87
     def authenticate(self, environ, identity):
77
     def authenticate(self, environ, identity):
88
         # Note: super().authenticate return None if already authenticated or not found
78
         # Note: super().authenticate return None if already authenticated or not found
89
         email = super().authenticate(environ, identity)
79
         email = super().authenticate(environ, identity)