Commit Graph

63 Commits

Author SHA1 Message Date
Francois Lesueur
ab267a2b87 auth_cache: empty digest when cache miss 2026-04-23 09:20:49 +02:00
Peter Bieringer
1b1c4cf0ef fix https://github.com/Kozea/Radicale/issues/2095 2026-04-19 11:56:57 +02:00
webmaster
e22d5b438f fix(auth): prevent login variable overwrite during failed cache cleanup
In the failed login cache cleanup loop, the tuple unpacking was using
`login` as the local variable name, silently overwriting the current
user's login with the one retrieved from the expired cache entry.

This caused subsequent backend authentication (e.g. IMAP) to be
attempted with the wrong username, resulting in spurious auth failures
for legitimate users whenever an expired failed-cache entry happened
to be present at the same time.

Rename the loop variable to `login_expired` to avoid shadowing the
outer `login` variable, and fix the associated debug log to reference
`login_expired` instead of the previously incorrect `login_cache`.

Fixes: intermittent authentication failures when _cache_failed contains
expired entries from previous failed login attempts by other users.

Signed-off-by: webmaster <webmaster@jbsky.fr>
2026-04-10 11:39:56 +02:00
Peter Bieringer
fc50170a8d code/cosmetics 2026-03-29 14:52:41 +02:00
Peter Bieringer
690914e49f add unit 2025-12-13 08:00:06 +01:00
Peter Bieringer
bf8619a41c add support for http_remote_user 2025-11-15 15:32:13 +01:00
Johannes Berg
256ca59aaf auth: clean up remote IP parameter/documentation
Make the remote IP parameter more generic and make it an enum
determining the source instead of a boolean. Also fix the
changelog entry.

Both as requested, I managed to miss those comments previously.
2025-09-09 20:25:49 +02:00
Johannes Berg
b5a1ea911d auth: dovecot: pass remote IP (rip=) to auth server
If known, let the auth server know where the client came
from, using REMOTE_ADDR or, optionally/configurably, the
X-Remote-Addr header value (which is needed when running
behind a trusted proxy.)

Addresses #1859.
2025-09-09 12:10:00 +02:00
Juan F Arjona
7eb4e037cc Fixing extra space lint doesn't like :-|. 2025-05-07 13:33:18 -04:00
Juan F Arjona
1fe0211ba6 Update __init__.py
Making lint happy (?)
2025-05-07 11:59:27 -05:00
Juan F Arjona
d22d74320a Added urldecode_username option to decode the username when sent by the client. This solved problems when authenticating against an imap server from the iOS calendar. 2025-05-02 18:02:43 -04:00
Peter Bieringer
69f85a0bdf only display warning if not started as wsgi 2025-03-14 21:33:36 +01:00
Peter Bieringer
358ae55540 add warning in case authentication based on environment is selected and server is not listen to loopback addresses only 2025-03-13 21:48:14 +01:00
Peter Bieringer
046d39b1bd pam: add support 2025-02-22 17:49:36 +01:00
Peter Bieringer
87dc5538d2 oauth2 module enabling 2025-02-02 09:01:58 +01:00
Peter Bieringer
50b76f7114 imap: config parse 2025-01-16 06:02:06 +01:00
HmBMvXXiSivMcLGFWoqc
3f04914de4 Add support for Dovecot auth over network 2025-01-13 23:31:13 -08:00
Peter Bieringer
2442a794ae tox fixes 2025-01-02 23:17:34 +01:00
Peter Bieringer
a9f2e6fe7b improve code/adjustments 2025-01-03 07:14:32 +01:00
Peter Bieringer
0d43a49ffb add variable sleep to have a constant execution time on failed login 2025-01-02 22:33:54 +01:00
Peter Bieringer
c10ce7ae46 add support for login info log 2025-01-01 16:30:34 +01:00
Peter Bieringer
6ebca08423 extend copyright 2025-01-01 15:47:22 +01:00
Peter Bieringer
c1be04abd1 fixes suggested by tox 2024-12-31 18:26:43 +01:00
Peter Bieringer
5ce0cee8bf add chache cleanup and locking 2024-12-31 16:13:52 +01:00
Peter Bieringer
b75e303556 reorg code, disable caching on not required types 2024-12-31 08:11:19 +01:00
Peter Bieringer
a794a51885 fix failed_login cache, improve coding 2024-12-31 07:57:54 +01:00
Peter Bieringer
9af15e6656 fixes triggered by tox 2024-12-30 05:25:10 +01:00
Peter Bieringer
8e97b709bf implement cache_logins* option 2024-12-30 08:17:59 +01:00
IM
94898ef6c1 flake8 E302 2024-12-25 22:28:01 +03:00
IM
7df2fb35a7 Disable overloading BaseAuth login method 2024-12-25 21:56:04 +03:00
Peter Bieringer
3ebe51a4cb Add: option [auth] uc_username for uppercase conversion (similar to existing lc_username) 2024-12-14 09:25:36 +01:00
Jean-Denis Girard
f25a5fbc79 Rebase galaxy4public patch on top of bf4f5834 2024-10-30 10:33:10 -10:00
Dipl. Ing. Péter Varkoly
a7f33c8795 Reorder imports. 2024-09-12 12:17:34 +02:00
Dipl. Ing. Péter Varkoly
da04d95b75 Fixing type definition error. 2024-09-11 14:13:06 +02:00
Dipl. Ing. Péter Varkoly
e05fbeb950 Apply suggestions of mypy 2024-09-11 09:13:26 +02:00
Dipl. Ing. Péter Varkoly
19e5972b4f Fix merge conflicts. 2024-08-25 14:11:48 +02:00
Peter Bieringer
13b1aaed39 add auth/strip_domain option 2024-07-18 06:50:29 +02:00
Peter Bieringer
e8c092bd2d DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead 2024-06-09 08:46:29 +02:00
Peter Bieringer
bf112d6b5f log also in case of "denyall" is selected, cosmetics 2024-06-07 12:35:21 +02:00
Peter Bieringer
27dfaa8663 warn in case no user authentication is active 2024-06-07 08:35:46 +02:00
Peter Bieringer
d8cbe0e206 extend copyright 2024-06-07 06:46:16 +02:00
Peter Bieringer
5dd27d3c80 add support for auth.type=denyall 2024-06-07 06:45:39 +02:00
IM
239e17d735 added compatibility with a case-insensitive authentication provider 2024-04-17 18:31:51 +03:00
Peter Varkoly
8d19fd7a64 Now rights can be add to user groups too. 2022-02-21 17:15:21 +01:00
Peter Varkoly
2dc0fd29dc Initial version of ldap authentication backend. 2022-02-19 11:57:58 +01:00
Unrud
8fa4345b6f Change "user name" to "username" 2022-01-07 23:54:34 +01:00
Unrud
bbaf0ebd8c Change name in file header 2021-12-09 16:55:46 +01:00
Unrud
cecb17df03 More type hints 2021-09-26 22:24:45 +02:00
Unrud
0cd95f8a39 Rename loader to load_plugin 2020-01-15 00:33:21 +01:00
Unrud
8543f3ea1d Extract method loader() 2020-01-14 22:43:48 +01:00