From 69eb6d90387a774dd220ed73502d42c5826cc3db Mon Sep 17 00:00:00 2001 From: Patrick Mooney Date: Fri, 16 Oct 2015 00:33:46 -0500 Subject: [PATCH] More docs clean-up --- docs/examples.md | 8 +++++--- docs/persistent_search.md | 23 ----------------------- 2 files changed, 5 insertions(+), 26 deletions(-) delete mode 100644 docs/persistent_search.md diff --git a/docs/examples.md b/docs/examples.md index 71881ef..656bded 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -15,7 +15,9 @@ with ldapjs. ///--- Shared handlers 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(); @@ -54,10 +56,10 @@ with ldapjs. if (!db[dn]) return next(new ldap.NoSuchObjectError(dn)); - if (!dn[dn].userpassword) + if (!db[dn].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()); res.end(); diff --git a/docs/persistent_search.md b/docs/persistent_search.md deleted file mode 100644 index bf236be..0000000 --- a/docs/persistent_search.md +++ /dev/null @@ -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. \ No newline at end of file