Crate ldap_test_server
source ·Expand description
This crate allow running isolated OpenLDAP (slapd) server in integration tests.
§Examples
use ldap_test_server::{LdapServerConn, LdapServerBuilder};
let server: LdapServerConn = LdapServerBuilder::new("dc=planetexpress,dc=com")
// add LDIF to database before LDAP server is started
.add(1, "dn: dc=planetexpress,dc=com
objectclass: dcObject
objectclass: organization
o: Planet Express
dc: planetexpress
dn: ou=people,dc=planetexpress,dc=com
objectClass: top
objectClass: organizationalUnit
description: Planet Express crew
ou: people")
// init databases and started LDAP server
.run()
.await;
// Add entity to running LDAP server
server.add(r##"dn: cn=Turanga Leela,ou=people,dc=planetexpress,dc=com
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
cn: Turanga Leela
sn: Turanga
givenName: Leela"##).await;
Structs§
- LDAP server builder
- Connection to running LDAP server