lmldap

lmldap is a single-executable OpenLDAP (slapd + LMDB) server with zero-config startup, an integrated HTTP/JSON REST server, and an embedded LMScript host. It serves native RFC 4511 LDAPv3 and HTTP REST against a unified directory while exposing context ldap: Ldap and standard REST and CLI interfaces.

Quick reference

npm install -g @lmctl-ai/lmctl@latest
lmldap --version
lmldap --lmcode-schema
lmldap --lmcode-signatures
Interface or flagSignature or syntaxPurpose
CLI zero-config serverlmldap --port 3389 --rest-port 8080 --base-dn dc=example,dc=com --admin-pw secretAuto-provision embedded schemas, LMDB storage, base DN entry, native LDAPv3 listener, and HTTP REST bridge.
CLI host bytecodelmldap --lmcode prog.dslbExecute compiled LMScript bytecode against a live LDAP server or the built-in in-memory directory store.
CLI schema and signatureslmldap --lmcode-schema [--json] | --lmcode-signaturesPrint the embedded schema JSON or all 244 canonical host and lmcode_std_v3 signatures.
REST HTTP bridgeGET /health | /ping | /search | GET/PUT/POST/DELETE /entry/<dn> | POST /bindRead, write, search, delete, and authenticate directory entries over HTTP JSON synchronized with native LDAPv3.
context ldap: Ldapldap.add(dn, json) | ldap.get(dn) | ldap.search(base, filter) | ldap.modify(dn, json) | ldap.del(dn)Create, fetch, query, update, and delete LDAP entries as JSON strings inside _lmcode_ programs.
Ldap existence and authldap.exists(dn) -> bool | ldap.bind(dn, pw) -> boolCheck whether a Distinguished Name exists or verify simple bind credentials.
Batch pipelineldap.batch().add(dn, json).get(dn).search(base, filter).exec() -> stringQueue multiple directory operations and execute them sequentially into a single JSON array response.
Standard REST and CLIRestGet..RestOptions, RestHandler, CliCommand, CliOptionExpose _lmcode_ functions as HTTP routes (:param) or stateless CLI flags and commands via rest_serve and rest_cli.
p = _lmcode_ cli="lmldap" install="github:lmctl-ai/lmldap@latest";
let ok = ldap.add("cn=Alice,dc=example,dc=com", "{\"objectClass\":[\"top\",\"person\",\"inetOrgPerson\"],\"cn\":\"Alice\",\"sn\":\"Smith\",\"mail\":\"alice@example.com\"}");
assert_eq(ok, true);
assert_eq(ldap.exists("cn=Alice,dc=example,dc=com"), true);

@"/directory/:cn"
fn get_user(x: RestExchange) -> void implements RestGet {
  x.json(ldap.get("cn=" + x.param("cn") + ",dc=example,dc=com"));
}

rest_config("session", "global");
let out = rest_cli(str_split("/directory/Alice", " "));
assert_eq(str_contains(out, "alice@example.com"), true);
end _lmcode_
res = run_lmcode(p);
require(res.ok, json_stringify(res));

Documentation pages

Source repository and releases