Implement authentication with LDAP

Enable an additional lookup against an LDAP directory
during login and user creation to ensure that only
specific users can login and register on the EteBase
server instance.
This commit is contained in:
2020-11-06 15:22:26 +01:00
parent 801826b8b6
commit 1fef1e2b7a
5 changed files with 98 additions and 1 deletions

View File

@@ -78,6 +78,34 @@ class AppSettings:
@cached_property
def CHALLENGE_VALID_SECONDS(self): # pylint: disable=invalid-name
return self._setting("CHALLENGE_VALID_SECONDS", 60)
@cached_property
def USE_LDAP(self): # pylint: disable=invalid-name
return self._setting("USE_LDAP", False)
@cached_property
def LDAP_FILTER(self): # pylint: disable=invalid-name
return self._setting("LDAP_FILTER", "")
@cached_property
def LDAP_SEARCH_BASE(self): # pylint: disable=invalid-name
return self._setting("LDAP_SEARCH_BASE", "")
@cached_property
def LDAP_SERVER(self): # pylint: disable=invalid-name
return self._setting("LDAP_SERVER", "")
@cached_property
def LDAP_BIND_DN(self): # pylint: disable=invalid-name
return self._setting("LDAP_BIND_DN", "")
@cached_property
def LDAP_BIND_PASSWORD(self): # pylint: disable=invalid-name
return self._setting("LDAP_BIND_PW", "")
@cached_property
def LDAP_SEARCH_BASE(self): # pylint: disable=invalid-name
return self._setting("LDAP_SEARCH_BASE", "")
app_settings = AppSettings('ETEBASE_')