mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
ldap auth: Reassure django_auth_ldap our auth-failed exceptions are normal.
The main `authenticate` method in the django_auth_ldap package logs a message at `exception` level if it passes through an exception it wasn't expecting. Sensible practice, but we'd been passing through just such an exception for any kind of routine authentication failure. After we recently stopped suppressing an arbitrary subset of loggers with `disable_existing_loggers`, these started showing up noisily, including in tests. So, make our exceptions expected. Just like our own code, the upstream code raises exceptions of a particular type for routine auth failures, and catches them and just returns None. We make our type derive from that one, so as to just piggyback on that behavior. Fixes an issue reported in a comment to #6674.
This commit is contained in:
@@ -376,7 +376,7 @@ class ZulipRemoteUserBackend(RemoteUserBackend):
|
||||
return None
|
||||
return user_profile
|
||||
|
||||
class ZulipLDAPException(Exception):
|
||||
class ZulipLDAPException(_LDAPUser.AuthenticationFailed):
|
||||
pass
|
||||
|
||||
class ZulipLDAPAuthBackendBase(ZulipAuthMixin, LDAPBackend):
|
||||
|
||||
Reference in New Issue
Block a user