[GH-ISSUE #763] [BUG] LDAP: Filtering custom attributes by value doesn't work #278

Closed
opened 2026-02-27 08:16:19 +03:00 by kerem · 2 comments
Owner

Originally created by @nitnelave on GitHub (Dec 15, 2023).
Original GitHub issue: https://github.com/lldap/lldap/issues/763

Describe the bug
We search with the straight-up string given by LDAP, whereas we should use the schema to parse the attribute value and serialize it.

Note that repeated attributes cannot be searched by values.

Originally created by @nitnelave on GitHub (Dec 15, 2023). Original GitHub issue: https://github.com/lldap/lldap/issues/763 **Describe the bug** We search with the straight-up string given by LDAP, whereas we should use the schema to parse the attribute value and serialize it. Note that repeated attributes cannot be searched by values.
kerem 2026-02-27 08:16:19 +03:00
Author
Owner

@rabidpug commented on GitHub (Jan 14, 2024):

Note that repeated attributes cannot be searched by values.

Does this mean that it's expected that lists cannot be used in filters currently?
And if yes, is it something that will be implemented in the future?

<!-- gh-comment-id:1890843380 --> @rabidpug commented on GitHub (Jan 14, 2024): > Note that repeated attributes cannot be searched by values. Does this mean that it's expected that lists cannot be used in filters currently? And if yes, is it something that will be implemented in the future?
Author
Owner

@nitnelave commented on GitHub (Jan 14, 2024):

@rabidpug no, attributes lists cannot be used in filters.

Supporting that would require a major redesign of the backend and would add significant complexity to the project, to the point that it might be just easier to use a standard LDAP server.

It all comes from the design decisions taken early on in the project: the data is stored in SQL as simple tables. When adding custom attributes, we have to serialize them to store them in the database. Lists are serialized as a single value, and the SQL engine doesn't understand the serialization. We could write a filter like "does the list contain exactly these values in this order" but that's not very helpful.

<!-- gh-comment-id:1890876873 --> @nitnelave commented on GitHub (Jan 14, 2024): @rabidpug no, attributes lists cannot be used in filters. Supporting that would require a major redesign of the backend and would add significant complexity to the project, to the point that it might be just easier to use a standard LDAP server. It all comes from the design decisions taken early on in the project: the data is stored in SQL as simple tables. When adding custom attributes, we have to serialize them to store them in the database. Lists are serialized as a single value, and the SQL engine doesn't understand the serialization. We could write a filter like "does the list contain exactly these values in this order" but that's not very helpful.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/lldap-lldap#278
No description provided.