-
Notifications
You must be signed in to change notification settings - Fork 126
add ldappool module #582
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
base: main
Are you sure you want to change the base?
add ldappool module #582
Conversation
2dca347
to
665dc81
Compare
@droideck Hi sorry to bother you. The tests fail with I double checked and I am not referencing any shebang interpreter so I wonder what can I do to get the unittests run, fix them until everything show's successs to get the PR finally discussed and worth being considered ? All the best and kind regards |
Hi! Regarding this PR, could you share a bit about the motivation behind adding this new |
Sure, I did want to put up that for the discussion but I am sure it's also good to have it in here. The motivation for the module is coming from an application which utilizes the LDAP connections in an context manner when objects are created. With adding an connection pool, the behavior can be changed in a manner of avoiding cost-intensive LDAP(s) connection being created over and over and with the builtin lock-authenticate-unlock method the waste of adding yet another connection to verify user authentication is granted. The ldappool module shall abstract the burdens of connection handling, prewarming, ondemand creation as well as basic authentication of users when search by a generic binddn. For some numbers, the application I am talking about does provide a docker v2 API and calling 100 failing docker auth requests ends up with ~900+ LDAP connections being created and dropped. The module shows that this can also be done with a fixed set of connections avoiding session/connection limits and improving the duration for such events (not talking about the fail delay response for secrutiy obfuscation) from tcp/tls connection establish point of view. I also decided to not use threading Queues as they do not give the possibility to choose a Hope it helps solving other similar issues in the python-ldap world |
@michaelalang, thanks for the great write-up! It makes sense, and I think it can be useful for many cases! @mistotebe could you please check the idea too, please? I think you worked on connection wrappers at some point (not exactly like this one, but still, we need your point of view here...) |
From my experience with the OpenLDAP load balancer interacting with various pooling implementations, the following are useful when you need a connection pool:
Also think the implementation could be greatly simplified if the |
He @mistotebe thanks for your input and support, in regards to
I am not trying to add yet another LDAPObject. The methods implemented are for the specific use case of utilizing one connection with a search principal and and authentication principal. All the other methods should only relate to the Pool. The other points you mentioned are a I also wouldn't see how this should be working out as a pool retuned connection with server controls set on paging will not reset if someone just does a simple_s on it ... Anyways, thanks again for the great input. From the code I submitted, what exactly would you change in regards to the mentioned points ? (@droideck I think that question is for you unless @mistotebe wants to answer too) |
I would like to add ldappooling capability to the library.
LDAP Pooling example
entries as dict
changing the connection or credentials for the pool