Description

A basic wrapper around C libldap

Package Information

Version0.0.3 (2015-Dec-16)
Homepagehttps://github.com/GayDragon/d-libldap
Repositoryhttps://github.com/IrenejMarc/d-libldap
LicenseMIT
CopyrightCopyright © 2015, Irenej Marc
AuthorsIrenej Marc
Registered byIrenej Marc
Dependenciesnone
System dependencieslibldap, probably *nix

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

d-libldap (alternatively, ldldapl - Lightweight D LDAP Library)

Requirements

  • libldap (OpenLDAP's)
  • standard D tools (dub, dmd, whatever, ...)

Building

As with every other dub project out there, just run dub inside the project's directory. If you're using an IDE, you're on your own.

Will later be turned into a library project. Just a program while initial development is still ongoing.

Current features

  • A simple wrapper around the basic LDAP features
  • connect
  • bind
  • basic search
  • That's it, really. For now.

Documentation

Documentation will be written inside the source itself somewhere in the future. For now, the goal is to get the basics working.

Future plans

  • Fix the use of deprecated LDAP functions
  • Add support modifying and adding new records

Licence

MIT

Usage example

import std.stdio;
import std.string;

import ldap.d;


void main()
{
	auto ldap = new LDAPConnection("ldap.example.com", 389);
	// simpleBindS will throw if an error occurs
	ldap.simpleBindS("cn=someuser,cn=users,dc=example,dc=com", "SomePassword");

	auto result = ldap.search(
			"cn=users,dc=example,dc=com", // base
			LDAPScope.subtree,
			"(&(objectClass=user)(|(sAMAccountName=foo)(sAMAccountName=bar)))",
			["name", "distinguishedName"]); // attributes to fetch

	foreach(entry; result)
	{
		writefln("Message type: %s", entry.type);
		writefln("DN: %s", entry.dn);
		writefln("Attributes: %s", entry.attributes);
	}

	ldap.unbindS();
}

Available versions

0.0.3 0.0.2 ~master