More docs clean-up
This commit is contained in:
parent
622b7486f7
commit
69eb6d9038
|
@ -15,7 +15,9 @@ with ldapjs.
|
||||||
///--- Shared handlers
|
///--- Shared handlers
|
||||||
|
|
||||||
function authorize(req, res, next) {
|
function authorize(req, res, next) {
|
||||||
if (!req.connection.ldap.bindDN.equals('cn=root'))
|
/* Any user may search after bind, only cn=root has full power */
|
||||||
|
var isSearch = (req instanceof ldap.SearchRequest);
|
||||||
|
if (!req.connection.ldap.bindDN.equals('cn=root') && !isSearch)
|
||||||
return next(new ldap.InsufficientAccessRightsError());
|
return next(new ldap.InsufficientAccessRightsError());
|
||||||
|
|
||||||
return next();
|
return next();
|
||||||
|
@ -54,10 +56,10 @@ with ldapjs.
|
||||||
if (!db[dn])
|
if (!db[dn])
|
||||||
return next(new ldap.NoSuchObjectError(dn));
|
return next(new ldap.NoSuchObjectError(dn));
|
||||||
|
|
||||||
if (!dn[dn].userpassword)
|
if (!db[dn].userpassword)
|
||||||
return next(new ldap.NoSuchAttributeError('userPassword'));
|
return next(new ldap.NoSuchAttributeError('userPassword'));
|
||||||
|
|
||||||
if (db[dn].userpassword !== req.credentials)
|
if (db[dn].userpassword.indexOf(req.credentials) === -1)
|
||||||
return next(new ldap.InvalidCredentialsError());
|
return next(new ldap.InvalidCredentialsError());
|
||||||
|
|
||||||
res.end();
|
res.end();
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
---
|
|
||||||
titile: Persistent Search Cache API| ldapjs
|
|
||||||
markdown2extras: wiki-tables
|
|
||||||
logo-color: green
|
|
||||||
logo-font-family: google:Aldrich, Verdana, sans-serif
|
|
||||||
header-font-family: google:Aldrich, Verdana, sans-serif
|
|
||||||
---
|
|
||||||
|
|
||||||
# ldapjs Persistent Search Cache API
|
|
||||||
|
|
||||||
This document covers the ldapjs Persistent Search Cache API and assumes you are familiar with LDAP. If you're not, read the [guide](http://ldapjs.org/guide.html) first.
|
|
||||||
|
|
||||||
This document also assumes you are familiar with LDAP persistent search. If you're not, read the [rfc](http://tools.ietf.org/id/draft-ietf-ldapext-psearch-03.txt) first.
|
|
||||||
|
|
||||||
Note this API is a cache used to store all connected persistent search clients, and does not actually implement persistent search.
|
|
||||||
|
|
||||||
# addClient(req, res, callback)
|
|
||||||
|
|
||||||
Adds a client to the cache.
|
|
||||||
|
|
||||||
# removeClient(req, res, callback)
|
|
||||||
|
|
||||||
Removes a client from the cache.
|
|
Loading…
Reference in New Issue