Skip to content

Commit

Permalink
Merge pull request #1665 from itglob/master
Browse files Browse the repository at this point in the history
Disable overloading BaseAuth login method
  • Loading branch information
pbiering authored Dec 26, 2024
2 parents a4266c9 + 94898ef commit a5dd4d8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion radicale/auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -102,6 +102,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()
Expand Down
2 changes: 1 addition & 1 deletion radicale/auth/dovecot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion radicale/auth/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion radicale/tests/custom/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""

0 comments on commit a5dd4d8

Please sign in to comment.