diff --git a/radicale/auth/__init__.py b/radicale/auth/__init__.py index 566b99657..4bb4b33df 100644 --- a/radicale/auth/__init__.py +++ b/radicale/auth/__init__.py @@ -29,7 +29,7 @@ """ -from typing import Sequence, Set, Tuple, Union +from typing import Sequence, Set, Tuple, Union, final from radicale import config, types, utils from radicale.log import logger @@ -50,7 +50,6 @@ def load(configuration: "config.Configuration") -> "BaseAuth": return utils.load_plugin(INTERNAL_TYPES, "auth", "Auth", BaseAuth, configuration) - class BaseAuth: _ldap_groups: Set[str] = set([]) @@ -102,6 +101,7 @@ def _login(self, login: str, password: str) -> str: raise NotImplementedError + @final def login(self, login: str, password: str) -> str: if self._lc_username: login = login.lower() diff --git a/radicale/auth/dovecot.py b/radicale/auth/dovecot.py index 34180eb52..ce2353a0b 100644 --- a/radicale/auth/dovecot.py +++ b/radicale/auth/dovecot.py @@ -32,7 +32,7 @@ def __init__(self, configuration): self.timeout = 5 self.request_id_gen = itertools.count(1) - def login(self, login, password): + def _login(self, login, password): """Validate credentials. Check if the ``login``/``password`` pair is valid according to Dovecot. diff --git a/radicale/auth/ldap.py b/radicale/auth/ldap.py index 2db88c954..cb3858dcd 100644 --- a/radicale/auth/ldap.py +++ b/radicale/auth/ldap.py @@ -202,7 +202,7 @@ def _login3(self, login: str, password: str) -> str: pass return "" - def login(self, login: str, password: str) -> str: + def _login(self, login: str, password: str) -> str: """Validate credentials. In first step we make a connection to the ldap server with the ldap_reader_dn credential. In next step the DN of the user to authenticate will be searched. diff --git a/radicale/tests/custom/auth.py b/radicale/tests/custom/auth.py index 490ec3139..2927ee4d6 100644 --- a/radicale/tests/custom/auth.py +++ b/radicale/tests/custom/auth.py @@ -29,7 +29,7 @@ class Auth(auth.BaseAuth): - def login(self, login: str, password: str) -> str: + def _login(self, login: str, password: str) -> str: if login == "tmp": return login return ""