finds.dev← search

// the find

activeldap/ruby-ldap

★ 65 · C · NOASSERTION · updated May 2023

Ruby/LDAP is an extension library for Ruby. It provides the interface to some LDAP libraries (e.g. OpenLDAP, Netscape SDK and Active Directory). The common API for application development is described in RFC1823 and is supported by Ruby/LDAP.

Ruby/LDAP is a C extension that wraps the native LDAP client libraries (OpenLDAP, Netscape SDK, wldap32) and exposes the RFC1823 API to Ruby. It is for Ruby developers who need libldap's SSL, StartTLS, and SASL behaviour from Ruby, and who are willing to build a native extension to get it.

- It calls the real libldap rather than reimplementing the protocol, so SASL mechanisms, StartTLS, and SSL behaviour match what the C client does. The source split into clientauth.c, saslconn.c, and sslconn.c follows those feature areas cleanly.

- The LDIF reader and writer (lib/ldap/ldif.rb) is pure Ruby, with LDAP::Record covering change records. That makes batch import and export usable without going through the C layer.

- There is a Windows build path (win/winldap.h, win/winlber.h, wldap32.def), which is uncommon among Ruby LDAP bindings.

- The README still lists Ruby 1.8.x and 1.9.x as requirements, and the last push was 2023-05-19. Expect to patch the build for current Ruby and OpenSSL before it compiles cleanly.

- The API keeps the RFC1823 shape: long positional argument lists on search and search_ext, and search2 returning hashes. There is no paged-results helper beyond the raw control encode and decode, so callers write their own paging loops.

- The test directory expects a real slapd built from the openldap templates in test/. There is no fixture or mock layer, so running the suite means standing up an LDAP server first.

- For most new code, net-ldap is pure Ruby and avoids the native build entirely. This extension only pays for itself when you specifically need libldap's SASL or SSL features.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →