Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple named configurations #6

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

lmctv
Copy link

@lmctv lmctv commented Jan 22, 2013

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,

l.

lmctv added 15 commits January 21, 2013 14:07
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.
@lmctv
Copy link
Author

lmctv commented Jun 9, 2013

@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 :-)

lmctv added 6 commits July 1, 2014 16:54
…_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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant