Commit 63e2b666 authored by Xavier Guimard's avatar Xavier Guimard

Prepare LDAP server for tests (#1118)

parent 85935955
var ldap = require('ldapjs');
var server = ldap.createServer();'dc=example,dc=com', function(req, res, next) {
var obj = [{
dn: 'dc=example,dc=com',
attributes: {
objectclass: ['dcObject', 'organization'],
o: 'example',
dc: 'example'
}, {
dn: 'uid=dwho,dc=example,dc=com',
attributes: {
objectclass: ['inetOrgPerson'],
uid: 'dwho',
cn: 'Dr Who',
mail: ''
for(var i=0; i<obj.length;i++) {
if (req.filter.matches(obj[i])) res.send(obj);
server.listen(1389, function() {
console.log('LDAP server listening at %s', server.url);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment