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

Prepare LDAP server for tests (#1118)

parent 85935955
node_modules
var ldap = require('ldapjs');
var server = ldap.createServer();
server.search('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: 'dwho@badwolf.org'
}
}];
for(var i=0; i<obj.length;i++) {
console.log(obj[i]);
if (req.filter.matches(obj[i])) res.send(obj);
}
res.end();
});
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