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 way, it becomes possible to add distinct ldap connectors
to the same pyramid app, and reference them by adding a context=...
discriminator to the api calls:
ldap_setup()
ldap_set_login_query()
ldap_set_groups_query()
get_ldap_connector()
and to the Connector's __init__ method.
Feature comes complete with unit tests...
to help groupfinder discriminate between configured backend contexts
to simplify downstream integration.
into multiple_named_configurations
Shorten one line and correct one typo.
Author
|
@mcdonc: please tell me where should I send the beer box I bought to try and bribe you into taking a look at this PR :-) |
…_named_configurations Conflicts: pyramid_ldap/__init__.py
without being forced to read the vcs log
in `ldap_setup`, `get_ldap_connector`, `ldap_set_login_query` and `ldap_set_groups_query` API calls.
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 pull request is a superset of the previous one; hope you don't mind this much noise
coming from my side these days...
Thank you,