zulip/zproject
Mateusz Mandera 8c065d1fcd ldap: Ensure django_to_ldap_username returns username that is in ldap.
This changes the way django_to_ldap_username works to make sure the ldap
username it returns actually has a corresponding ldap entry and raise an
exception if that's not possible. It seems to be a more sound approach
than just having it return its best guess - which was the case so far.
Now there is a guarantee that what it returns is the username of an
actual ldap user.

This allows communicating to the registration flow when the email being
registered doesn't belong to ldap, which then will proceed to register
it via the normal email backend flow - finally fixing the bug where you
couldn't register a non-ldap email even with the email backend enabled.

These changes to the behavior of django_to_ldap_username require small
refactorings in a couple of other functions that call it, as well as
adapting some tests to these changes. Finally, additional tests are
added for the above-mentioned registration flow behavior and some
related corner-cases.
2019-10-25 12:14:51 -07:00
..
jinja2 cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
__init__.py
backends.py ldap: Ensure django_to_ldap_username returns username that is in ldap. 2019-10-25 12:14:51 -07:00
dev_settings.py auth: Add initial SAML authentication support. 2019-10-10 15:44:34 -07:00
dev_urls.py storage: Stop using django-pipeline. 2019-07-24 17:40:31 -07:00
email_backends.py tools: Upgrade Pycodestyle and fix new linter errors. 2019-01-31 12:21:41 -08:00
legacy_urls.py urls: Move the json/fetch_api_key endpoint to be an API-style route. 2018-01-08 13:15:52 -05:00
prod_settings_template.py ldap: Do a proper search for email in email_belongs_to_ldap. 2019-10-22 15:53:39 -07:00
settings.py ldap: Do a proper search for email in email_belongs_to_ldap. 2019-10-22 15:53:39 -07:00
slack_importer_test_settings.py settings: Migrate test settings to modern postgres backend name. 2019-01-23 17:08:24 -08:00
terms.md.template Add TERMS_OF_SERVICE setting. 2016-07-29 20:47:31 -07:00
test_settings.py ldap: Use email search in django_to_ldap_username. 2019-10-22 15:57:52 -07:00
urls.py auth: Add initial SAML authentication support. 2019-10-10 15:44:34 -07:00
wsgi.py wsgi.py: Fix broken error ouput for django.setup() call. 2019-06-24 12:19:51 -07:00