inejge / ldap3

A pure-Rust LDAP library using the Tokio stack
Apache License 2.0
226 stars 39 forks source link

Add support for creating LDAP clients from existing TcpStream/UnixStream. #132

Closed mateuszkj closed 2 weeks ago

mateuszkj commented 3 months ago

Allow creating Ldap client (sync and async) from exiting Tcp/Unix streams.

That's allows to create LDAP client from file descriptor and handle connection (with ssl) in sandboxed process.

Example scenario:

  1. Open tcp stream to LDAP server in normal mode.
  2. Go process into capsicum/seccomp mode.
  3. Handle ldap client (and SSL) in sandboxed process.
inejge commented 3 months ago

FYI: I'll be mostly offline for the next ten days or so, and I won't be able to handle any issues.

inejge commented 2 months ago

[Better late than never, eh?] Thanks for the PR, its concept is a worthwhile addition to the library and I'll be happy to have it included; however, I'm not keen to further complicate the connection API, which already has a lot of variations.

I would prefer to place the stream into LdapConnSettings (as an Option of an enum of Tcp|Unix stream, I imagine), provide the methods for initializing that field, and modify new_tcp() and new_unix() to use the field if present. Could you rework the PR along those lines?

inejge commented 2 weeks ago

Merged and reverted to rework with the LdapConnSettings method -- thanks for the contribution anyway.