-
Notifications
You must be signed in to change notification settings - Fork 452
Attributes with upper case letters requested in search on server are filtered out #900
Comments
Can you please provide a link to the source code in question? https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet What version of of |
Sure. Here's the link to that bit of code I am quoting above: https://github.com/ldapjs/node-ldapjs/blob/f2890088e49c0c7b7b880998d73d6e4a448d7b4e/lib/messages/search_response.js#L57-L71C1 I am using 3.0.2. |
Thank you. I wanted to verify that I was looking at the same block of code because of your reduction in the original post. At least this code is old 🤣 We're going to need to draft a test, probably similar to https://github.com/ldapjs/node-ldapjs/blob/f2890088e49c0c7b7b880998d73d6e4a448d7b4e/test/issue-845.test.js, that exhibits the problem and work backward from there. I think that instead of patching |
Did run into the same problem (using 3.0.7).
|
Just hit this using Apache Guacamole LDAP extension. It requests attributes using camelcase, and so they are filtered out. I think the problem is this test in search_response.js:
That line is comparing the incoming ( @x-way your workaround solved my issue, so thanks! |
When making a request to an ldapjs based server that includes a selection of attributes, and any of these attributes contain upper case letters, these attributes will not be included in the response. For example, the response to this request:
if provided through:
will return
i.e.
memberOf
is filtered out. This happens in this part of SearchResponse.js:where the entry's attribute name is cast to lower case, but the response's ones (i.e.
self.attributes
) are not, so that search attributes with upper case letters will never match anything at all.I am currently working around that by patching the attributes in the response object and converting them to lower case from my search functions. I imagine something like that should be done in
SearchResponse.send
instead.The text was updated successfully, but these errors were encountered: