mcavage/node-ldapjs — Issue #37: How to extract info from the search filter?
Author: tttp
Created: 2011-11-18 11:35:17+00:00
State: open

Hi,

I'm only interested of providing the autocomplete feature on thunderbird & outlook using a crm as a backend. I will not support all the advanced feature of ldap and the complex query language. I just want to get whatever the user typed in the address field, this is

outlook: (&(|(mail=xavier*)(cn=xavier*)(sn=xavier*)(givenname=xavier*)(displayname=xavier*)))
thunderbird: (|(cn=xavier*)(mail=xavier*)(sn=xavier*))

I've seen req.filter.json and req.filter.toString(). Both expose the query (obviously), I'm looking for something that would hide it and only return the string as typed, eg. return only "xavier*" ?

Was tempted to run a regex "=(.*)*" but I don't know enough about ldap syntax to know if it's safe, or if there is already a method in ldap.js that'd do that better.

Any suggestion?
X+