-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Active Directory workaround #6559
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a unit test to check your use case does not break in future refactor. (and to check that you code actually works as expected :) )
if len(res) > 1: | ||
for elem in res: | ||
if elem['type'] == 'searchResEntry': | ||
tmp.append(elem) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean to do res = tmp after the loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right , seems I was too sloppy when making the patch. Will Fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, now the missing line is... below our conversation and easy to miss... Sorry for that.
Will add a unit test later (perhaps over the weekend). Do you have a pointer to an existing test which runs against a dummy LDAP instance or something like that? |
I recently had to connect a buildbot instance to an Active Directory and I needed a workaround to get it done, which I'd like to share. The problem is caused by Active Directory returning additional search result references which can not be suppressed by query parameters (e.g. https://superuser.com/questions/1438270/why-does-ad-return-searchresref-ldap-references-for-every-ldap-search). This leads to an exception when doing the user lookup.
I am sure that there are more elegant ways to filter out the unwanted search references than I did ;-) The unit tests ran fine without any changes before and after my change.
newsfragments
directory (and read theREADME.txt
in that directory)