Crate ldap_utils

Source
Expand description

§ldap-utils

Implements some LDAP utility functionality around OpenLDAP config files and the ldap3 Rust library

Structs§

Enums§

Functions§

  • apply the LDAP operations on a given LDAP server.
  • try to connect to an LDAP server using ldap3 using the OpenLDAP config files supplemented by hardcoded default values
  • connect to an LDAP server using ldap3 with the given set of default parameters
  • fill the builder with hardcoded default parameters
  • delete an LDAP entry recursively using ldap3
  • diff two sets of LDAPEntries which had their base DNs removed and generates LDAP operations (add, update, delete) to apply to the destination to make it identical to the source
  • perform an LDAP search via ldap3, logging a proper error message if it fails and returning an iterator to already unwrapped search entries
  • generate an ldap3::Mod if there is a DN-valued attribute in the source entry that needs its base DN translated to the destination base DN
  • of the same modify operation because otherwise we might successfully apply the textual modifications and then fail on the binary ones, leaving behind a half-modified object
  • creates a noop_control object for use with ldap3
  • try to detect OpenLDAP connect parameters from its config files (ldap.conf in /etc/ldap or /etc/openldap and .ldaprc in the user home dir)
  • parse an ldap3::Scope from the string one would specify to use the same scope with OpenLDAP’s ldapsearch -s parameter
  • Retrieve the LDAP schema from an LDAP server using ldap3
  • retrieve the RootDSE from an LDAP server using ldap3
  • helper function to search an LDAP server and generate LDAPEntry values with the base DN removed to make them server-independent
  • check if an ldap3::LdapResult is either a success or the success code returned by an operation using the noop_control
  • load ldap connect parameters from a toml file