Filters match on attribute values only case-sensitively
See original GitHub issueMany LDAP attributes (eg. cn, givenName) are defined as defaulting to case-insensitive when it comes to applying filters. However:
> ldap = require('ldapjs')
> filter = ldap.parseFilter('(cn=*bob*)')
> filter.matches({cn: 'bob'})
true
> filter.matches({cn: 'Bob'})
false
My suggestion:
- Make all filters case-__in__sensitive by default, since I suspect that is the most common use-case (it certainly is for me),
- Add an argument to
filter.matches(...)
(or when creating aFilter
object) which allows us to indicate which attributes are case-sensitive.
Issue Analytics
- State:
- Created 10 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Filters match on attribute values only case-sensitively #156
Many LDAP attributes (eg. cn, givenName) are defined as defaulting to case-insensitive when it comes to applying filters.
Read more >Enhanced Subscriber Feature Data Filter Operators for ...
Search strings are not case-sensitive. Subscribers with an attribute definition that matches one of the values you define in a comma delimited string...
Read more >14.3. LDAP Search Filters Red Hat Directory Server 11
Compares the given search value to a string in an attribute value. This matching rule is case-insensitive. OID: 2.5.13.32. Compatible syntaxes: Directory String....
Read more >LDAP Filters
An equality filter is used to determine whether an entry contains a specified attribute value. If an entry includes the specified value, regardless...
Read more >Entity Search API returns no results when filter uses 'contains ...
The "equals" filter description is - ( property, value ). This means it filters all the conditions with the exact match while ignoring...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this is what I had to do, I’m sure that has to be an easier way to accomplish this:
The only thing I had to change was
var matcher = new RegExp(re);
tovar matcher = new RegExp(re, 'i');
hi @pfmooney, can you provide directions on how to override the filter match methods?