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

Paged LDAP Requests #61

Closed
wants to merge 1 commit into from
Closed

Conversation

jtpereyda
Copy link
Contributor

LdapSource now uses page requets, a work-around for servers that report ldap.SIZELIMIT_EXCEEDED.

  • One source said that Active Directory defaults to a page size limit of 1000, so that is the hard-coded page size. We could add an option, but hopefully no server has a smaller limit. Increasing the limit could increase efficiency, but probably only on the initial setup.
  • The implementation is based loosely on this sample, but a lot of tweaks were needed: http://www.novell.com/coolsolutions/tip/18274.html
  • The basic idea, from what I gather, is that the paged request tells us when it finishes, and also gives us a new cookie that we can use to get the next page. I modified the __iter__ method to look for these cookies and re-call the Search function when needed.

With this change, nsscache update is finally working on Ubuntu with an Active Directory server. Or, on my Ubuntu install with my site's AD server.

@jaqx0r
Copy link
Contributor

jaqx0r commented Oct 3, 2015

Very cool, thanks. Can you add a test for this?

On Sat, 3 Oct 2015, 10:45 Joshua Pereyda notifications@github.com wrote:

LdapSource now uses page requets, a work-around for servers that report
ldap.SIZELIMIT_EXCEEDED.

  • One source said
    http://jeftek.com/219/avoid-changing-the-maxpagesize-ldap-query-policy/
    that Active Directory defaults to a page size limit of 1000, so that is the
    hard-coded page size. We could add an option, but hopefully no server has a
    smaller limit. Increasing the limit could increase efficiency, but probably
    only on the initial setup.
  • The implementation is based loosely on this sample, but a lot of
    tweaks were needed: http://www.novell.com/coolsolutions/tip/18274.html
  • The basic idea, from what I gather, is that the paged request tells
    us when it finishes, and also gives us a new cookie that we can use to get
    the next page. I modified the iter method to look for these
    cookies and re-call the Search function when needed.

With this change, nsscache update is finally working on Ubuntu with an

Active Directory server. Or, on my Ubuntu install with my site's AD server.

You can view, comment on, or merge this pull request online at:

#61
Commit Summary

  • LdapSource now uses page requets, a work-around for servers that
    report ldap.SIZELIMIT_EXCEEDED.

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#61.

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.

None yet

2 participants