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

Expose destroy method from ldapjs #64

Open
colthreepv opened this issue Feb 5, 2020 · 3 comments
Open

Expose destroy method from ldapjs #64

colthreepv opened this issue Feb 5, 2020 · 3 comments

Comments

@colthreepv
Copy link

Is it possible to destroy the ldap connection that the library is using?

@jsumners
Copy link
Owner

jsumners commented Feb 5, 2020

Possibly. Would you like to send a PR?

@colthreepv
Copy link
Author

Ok, I will articulate about what I have seen
From the usage I analyzed in the library LDAP clients gets created with utils.createClient and they are treated as expendable
At this point I am unsure if the LDAP connections are permanent or they are on-demand, do they get interrupted after some seconds, or they have some sort of keep-alive (like tcp/http connections)

If they have a keep-alive mechanic, I think there should be a connection re-using between calls of the ActiveDirectory library, eg: multiple authenticate() calls loop on one or more LDAP underlying connections (I would propose just one, for simplicity as starting point)

Therefore, when there is such a mechanic, the destroy() option would have sense.
I was requesting it because usually in automatic tests connections like this keep the process open, and I implemented ldap.destroy when using the underlying library

Does this reasoning seem sound to you? Any insight about the nature of LDAP connections, as if they have a permanent or on-demand behaviour?

@jsumners
Copy link
Owner

jsumners commented Feb 6, 2020

I really can't remember all of the details in this library, but I do think that the library handles creating and throwing away connections automatically.

I highly recommend using https://npm.im/adldap over this library if your needs are basic.

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

No branches or pull requests

2 participants