Open
Conversation
To avoid useless activation of the context managers both in Connector.ldap_login_query() and Connector.user_groups()
to correctly check exception from the first search too.
by setting a sizelimit on authentication searches.
The API has been preserved by refactoring the caching and connection searching into a new _LDAPQuery.execute_cache method that gets called in turn by _LDAPQuery.execute
by refactoring the _LDAPQuery class:
- slightly refactor _LDAPQuery.execute by splitting it into
a new method _LDAPQuery.execute_cache, which does the real work
of searching and caching, and a replacement _LDAPQuery.execute
which will skip the call to execute_cache when filter_tmpl
is empty.
- directly call _LDAPQuery.execute_cache after entering the
user-bind self.manager.connection() context manager
This will avoid trivial DOS and ldap.FILTER_ERROR exceptions on attempted logins by users sporting "funny" login names, like 'user*name' or 'user(middle)name'. This is a forward port of f3057446181106 to silence merge conflicts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the first part of the changes I've tried to send yesterday.
I've undone the part which seemed more controversial even to myself,
in the hope these changes could get in with less friction...
This request is meant to replace both
#3
#4
Thank you,
@anilj: with this pull request,the base dn in itself is templated; I'm not really sure about
adding the means to enable passing an arbitrary dictionary into Connector.authenticate() and
Connector.user_groups(). Some more details on your use-case?