Wildcard filters are not supported

Issue #4 new
Theo Chatzimichos
created an issue

Currently wildard filters in search_s need seeding. Seems to be a bit hard to implement though.

Comments (3)

  1. Wilfredo Sanchez

    Not super hard. I have modified versions of Test._parse_expression and Test.matches here:


    Basically, I just split on "*” and then do substring searches while making sure that the substrings are in order and don’t overlap.

    I also noticed that matches doesn’t normalize strings to lowercase, and it seems like LDAP searches are case-insensitive, so that may be needed.

    Also, matches seems to work on accident in cases were attribute values are single-value strings. That is, len(values) > 0 is true for both a list and a string, and self.value in values does a substring search if values is a string, so that also works.

  2. Peter Sagerson repo owner

    Case-sensitivity varies by attribute and theoretically by server. In fact, each attribute may have not just one, but three separate matching rules: for equality, ordering, and substrings. Many standard matching rules are defined, but I imagine a server would be free to implement any arbitrary algorithm it wanted.

    It would probably make sense for mockldap to exhibit correct behavior for the standard schemas. It would likely be a tedious project of moderate size.

  3. Log in to comment