[GH-ISSUE #436] Add support for SubString #166

Closed
opened 2026-02-27 08:15:38 +03:00 by kerem · 0 comments
Owner

Originally created by @Evantage-WS on GitHub (Feb 9, 2023).
Original GitHub issue: https://github.com/lldap/lldap/issues/436

For issue https://github.com/nitnelave/lldap/issues/432, support for SubString is requested. Could you please add support for SubString?

Example log:

2023-02-09T13:17:07.809316229+00:00 INFO     LDAP session [ 54.9ms | 0.14% / 100.00% ]
2023-02-09T13:17:07.809381062+00:00 INFO     ┝━ LDAP request [ 54.8ms | 0.23% / 99.77% ]
2023-02-09T13:17:07.809426062+00:00 DEBUG    │  ┝━ 🐛 [debug]:  | msg: LdapMsg { msgid: 1, op: BindRequest(LdapBindRequest { dn: "cn=admin,ou=people,dc=example,dc=com", cred: Simple("********") }), ctrl: [] }
2023-02-09T13:17:07.809431395+00:00 DEBUG    │  ┝━ do_bind [ 54.7ms | 0.05% / 99.54% ]
2023-02-09T13:17:07.809435937+00:00 DEBUG    │  │  ┝━ 🐛 [debug]: DN: cn=admin,ou=people,dc=example,dc=com
2023-02-09T13:17:07.809448145+00:00 DEBUG    │  │  ┝━ bind [ 54.6ms | 0.30% / 99.31% ]
2023-02-09T13:17:07.809811853+00:00 DEBUG    │  │  │  ┕━ passwords_match [ 54.4ms | 99.01% ]
2023-02-09T13:17:07.864215420+00:00 DEBUG    │  │  ┝━ get_user_groups [ 98.4µs | 0.18% ]
2023-02-09T13:17:07.864221670+00:00 DEBUG    │  │  │  ┝━ 🐛 [debug]:  | user_id: UserId("admin")
2023-02-09T13:17:07.864247170+00:00 DEBUG    │  │  │  ┝━ 🐛 [debug]:  | query: SELECT "groups"."group_id", "display_name", "creation_date", "uuid" FROM "groups" INNER JOIN "memberships" ON "groups"."group_id" = "memberships"."group_id" WHERE "user_id" = ?
2023-02-09T13:17:07.864451627+00:00 DEBUG    │  │  │  ┕━ 🐛 [debug]:  | return: {GroupDetails { group_id: GroupId(1), display_name: "lldap_admin", creation_date: 2023-02-09T08:52:05.019774311Z, uuid: Uuid("a92dd3f8-dfbb-3c57-8fd6-46c93a5021e2") }}
2023-02-09T13:17:07.864453794+00:00 DEBUG    │  │  ┕━ 🐛 [debug]: Success!
2023-02-09T13:17:07.864458544+00:00 DEBUG    │  ┕━ 🐛 [debug]:  | response: BindResponse(LdapBindResponse { res: LdapResult { code: Success, matcheddn: "", message: "", referral: [] }, saslcreds: None })
2023-02-09T13:17:07.864670960+00:00 INFO     ┕━ LDAP request [ 45.7µs | 0.06% / 0.08% ]
2023-02-09T13:17:07.864678877+00:00 DEBUG       ┝━ 🐛 [debug]:  | msg: LdapMsg { msgid: 2, op: SearchRequest(LdapSearchRequest { base: "ou=people,dc=example,dc=com", scope: Subtree, aliases: Never, sizelimit: 0, timelimit: 0, typesonly: false, filter: And([Equality("objectClass", "inetOrgPerson"), Or([Substring("uid", LdapSubstringFilter { initial: Some("tes"), any: [], final_: None }), Substring("sn", LdapSubstringFilter { initial: Some("tes"), any: [], final_: None }), Substring("givenName", LdapSubstringFilter { initial: Some("tes"), any: [], final_: None })]), Or([Equality("uid", "%s"), Equality("sn", "%s"), Equality("givenName", "%s")])]), attrs: ["dn", "memberOf", "objectClass", "inetOrgPerson", "uid", "cn", ""] }), ctrl: [] }
2023-02-09T13:17:07.864679585+00:00 DEBUG       ┝━ do_search [ 15.5µs | 0.01% / 0.03% ]
2023-02-09T13:17:07.864685293+00:00 DEBUG       │  ┝━ 🐛 [debug]:  | request.base: "ou=people,dc=example,dc=com" | scope: Users
2023-02-09T13:17:07.864685960+00:00 DEBUG       │  ┕━ get_user_list [ 7.67µs | 0.01% ]
2023-02-09T13:17:07.864688752+00:00 DEBUG       │     ┕━ 🐛 [debug]:  | ldap_filter: And([Equality("objectClass", "inetOrgPerson"), Or([Substring("uid", LdapSubstringFilter { initial: Some("tes"), any: [], final_: None }), Substring("sn", LdapSubstringFilter { initial: Some("tes"), any: [], final_: None }), Substring("givenName", LdapSubstringFilter { initial: Some("tes"), any: [], final_: None })]), Or([Equality("uid", "%s"), Equality("sn", "%s"), Equality("givenName", "%s")])])
2023-02-09T13:17:07.864700002+00:00 DEBUG       ┕━ 🐛 [debug]:  | response: SearchResultDone(LdapResult { code: UnwillingToPerform, matcheddn: "", message: "Unsupported user filter: Unsupported user filter: Substring(\"uid\", LdapSubstringFilter { initial: Some(\"tes\"), any: [], final_: None })", referral: [] })
2023-02-09T13:17:08.300759330+00:00 INFO     LDAP session [ 42.2ms | 0.11% / 100.00% ]
2023-02-09T13:17:08.300784913+00:00 INFO     ┝━ LDAP request [ 42.1ms | 0.22% / 99.78% ]
2023-02-09T13:17:08.300792913+00:00 DEBUG    │  ┝━ 🐛 [debug]:  | msg: LdapMsg { msgid: 1, op: BindRequest(LdapBindRequest { dn: "cn=admin,ou=people,dc=example,dc=com", cred: Simple("********") }), ctrl: [] }
2023-02-09T13:17:08.300794538+00:00 DEBUG    │  ┝━ do_bind [ 42.0ms | 0.04% / 99.55% ]
2023-02-09T13:17:08.300796747+00:00 DEBUG    │  │  ┝━ 🐛 [debug]: DN: cn=admin,ou=people,dc=example,dc=com
2023-02-09T13:17:08.300801038+00:00 DEBUG    │  │  ┝━ bind [ 41.9ms | 0.15% / 99.27% ]
2023-02-09T13:17:08.300965246+00:00 DEBUG    │  │  │  ┕━ passwords_match [ 41.8ms | 99.12% ]
2023-02-09T13:17:08.342778439+00:00 DEBUG    │  │  ┝━ get_user_groups [ 101µs | 0.24% ]
2023-02-09T13:17:08.342785772+00:00 DEBUG    │  │  │  ┝━ 🐛 [debug]:  | user_id: UserId("admin")
2023-02-09T13:17:08.342811647+00:00 DEBUG    │  │  │  ┝━ 🐛 [debug]:  | query: SELECT "groups"."group_id", "display_name", "creation_date", "uuid" FROM "groups" INNER JOIN "memberships" ON "groups"."group_id" = "memberships"."group_id" WHERE "user_id" = ?
2023-02-09T13:17:08.342994188+00:00 DEBUG    │  │  │  ┕━ 🐛 [debug]:  | return: {GroupDetails { group_id: GroupId(1), display_name: "lldap_admin", creation_date: 2023-02-09T08:52:05.019774311Z, uuid: Uuid("a92dd3f8-dfbb-3c57-8fd6-46c93a5021e2") }}
2023-02-09T13:17:08.342996647+00:00 DEBUG    │  │  ┕━ 🐛 [debug]: Success!
2023-02-09T13:17:08.343001022+00:00 DEBUG    │  ┕━ 🐛 [debug]:  | response: BindResponse(LdapBindResponse { res: LdapResult { code: Success, matcheddn: "", message: "", referral: [] }, saslcreds: None })
2023-02-09T13:17:08.343202396+00:00 INFO     ┕━ LDAP request [ 47.3µs | 0.07% / 0.11% ]
2023-02-09T13:17:08.343211271+00:00 DEBUG       ┝━ 🐛 [debug]:  | msg: LdapMsg { msgid: 2, op: SearchRequest(LdapSearchRequest { base: "ou=people,dc=example,dc=com", scope: Subtree, aliases: Never, sizelimit: 0, timelimit: 0, typesonly: false, filter: And([Equality("objectClass", "inetOrgPerson"), Or([Substring("uid", LdapSubstringFilter { initial: Some("test"), any: [], final_: None }), Substring("sn", LdapSubstringFilter { initial: Some("test"), any: [], final_: None }), Substring("givenName", LdapSubstringFilter { initial: Some("test"), any: [], final_: None })]), Or([Equality("uid", "%s"), Equality("sn", "%s"), Equality("givenName", "%s")])]), attrs: ["dn", "memberOf", "objectClass", "inetOrgPerson", "uid", "cn", ""] }), ctrl: [] }
2023-02-09T13:17:08.343212188+00:00 DEBUG       ┝━ do_search [ 15.8µs | 0.02% / 0.04% ]
2023-02-09T13:17:08.343218563+00:00 DEBUG       │  ┝━ 🐛 [debug]:  | request.base: "ou=people,dc=example,dc=com" | scope: Users
2023-02-09T13:17:08.343219396+00:00 DEBUG       │  ┕━ get_user_list [ 7.29µs | 0.02% ]
2023-02-09T13:17:08.343222313+00:00 DEBUG       │     ┕━ 🐛 [debug]:  | ldap_filter: And([Equality("objectClass", "inetOrgPerson"), Or([Substring("uid", LdapSubstringFilter { initial: Some("test"), any: [], final_: None }), Substring("sn", LdapSubstringFilter { initial: Some("test"), any: [], final_: None }), Substring("givenName", LdapSubstringFilter { initial: Some("test"), any: [], final_: None })]), Or([Equality("uid", "%s"), Equality("sn", "%s"), Equality("givenName", "%s")])])
2023-02-09T13:17:08.343233354+00:00 DEBUG       ┕━ 🐛 [debug]:  | response: SearchResultDone(LdapResult { code: UnwillingToPerform, matcheddn: "", message: "Unsupported user filter: Unsupported user filter: Substring(\"uid\", LdapSubstringFilter { initial: Some(\"test\"), any: [], final_: None })", referral: [] })

Thanks!

Originally created by @Evantage-WS on GitHub (Feb 9, 2023). Original GitHub issue: https://github.com/lldap/lldap/issues/436 For issue https://github.com/nitnelave/lldap/issues/432, support for SubString is requested. Could you please add support for SubString? Example log: ``` 2023-02-09T13:17:07.809316229+00:00 INFO LDAP session [ 54.9ms | 0.14% / 100.00% ] 2023-02-09T13:17:07.809381062+00:00 INFO ┝━ LDAP request [ 54.8ms | 0.23% / 99.77% ] 2023-02-09T13:17:07.809426062+00:00 DEBUG │ ┝━ 🐛 [debug]: | msg: LdapMsg { msgid: 1, op: BindRequest(LdapBindRequest { dn: "cn=admin,ou=people,dc=example,dc=com", cred: Simple("********") }), ctrl: [] } 2023-02-09T13:17:07.809431395+00:00 DEBUG │ ┝━ do_bind [ 54.7ms | 0.05% / 99.54% ] 2023-02-09T13:17:07.809435937+00:00 DEBUG │ │ ┝━ 🐛 [debug]: DN: cn=admin,ou=people,dc=example,dc=com 2023-02-09T13:17:07.809448145+00:00 DEBUG │ │ ┝━ bind [ 54.6ms | 0.30% / 99.31% ] 2023-02-09T13:17:07.809811853+00:00 DEBUG │ │ │ ┕━ passwords_match [ 54.4ms | 99.01% ] 2023-02-09T13:17:07.864215420+00:00 DEBUG │ │ ┝━ get_user_groups [ 98.4µs | 0.18% ] 2023-02-09T13:17:07.864221670+00:00 DEBUG │ │ │ ┝━ 🐛 [debug]: | user_id: UserId("admin") 2023-02-09T13:17:07.864247170+00:00 DEBUG │ │ │ ┝━ 🐛 [debug]: | query: SELECT "groups"."group_id", "display_name", "creation_date", "uuid" FROM "groups" INNER JOIN "memberships" ON "groups"."group_id" = "memberships"."group_id" WHERE "user_id" = ? 2023-02-09T13:17:07.864451627+00:00 DEBUG │ │ │ ┕━ 🐛 [debug]: | return: {GroupDetails { group_id: GroupId(1), display_name: "lldap_admin", creation_date: 2023-02-09T08:52:05.019774311Z, uuid: Uuid("a92dd3f8-dfbb-3c57-8fd6-46c93a5021e2") }} 2023-02-09T13:17:07.864453794+00:00 DEBUG │ │ ┕━ 🐛 [debug]: Success! 2023-02-09T13:17:07.864458544+00:00 DEBUG │ ┕━ 🐛 [debug]: | response: BindResponse(LdapBindResponse { res: LdapResult { code: Success, matcheddn: "", message: "", referral: [] }, saslcreds: None }) 2023-02-09T13:17:07.864670960+00:00 INFO ┕━ LDAP request [ 45.7µs | 0.06% / 0.08% ] 2023-02-09T13:17:07.864678877+00:00 DEBUG ┝━ 🐛 [debug]: | msg: LdapMsg { msgid: 2, op: SearchRequest(LdapSearchRequest { base: "ou=people,dc=example,dc=com", scope: Subtree, aliases: Never, sizelimit: 0, timelimit: 0, typesonly: false, filter: And([Equality("objectClass", "inetOrgPerson"), Or([Substring("uid", LdapSubstringFilter { initial: Some("tes"), any: [], final_: None }), Substring("sn", LdapSubstringFilter { initial: Some("tes"), any: [], final_: None }), Substring("givenName", LdapSubstringFilter { initial: Some("tes"), any: [], final_: None })]), Or([Equality("uid", "%s"), Equality("sn", "%s"), Equality("givenName", "%s")])]), attrs: ["dn", "memberOf", "objectClass", "inetOrgPerson", "uid", "cn", ""] }), ctrl: [] } 2023-02-09T13:17:07.864679585+00:00 DEBUG ┝━ do_search [ 15.5µs | 0.01% / 0.03% ] 2023-02-09T13:17:07.864685293+00:00 DEBUG │ ┝━ 🐛 [debug]: | request.base: "ou=people,dc=example,dc=com" | scope: Users 2023-02-09T13:17:07.864685960+00:00 DEBUG │ ┕━ get_user_list [ 7.67µs | 0.01% ] 2023-02-09T13:17:07.864688752+00:00 DEBUG │ ┕━ 🐛 [debug]: | ldap_filter: And([Equality("objectClass", "inetOrgPerson"), Or([Substring("uid", LdapSubstringFilter { initial: Some("tes"), any: [], final_: None }), Substring("sn", LdapSubstringFilter { initial: Some("tes"), any: [], final_: None }), Substring("givenName", LdapSubstringFilter { initial: Some("tes"), any: [], final_: None })]), Or([Equality("uid", "%s"), Equality("sn", "%s"), Equality("givenName", "%s")])]) 2023-02-09T13:17:07.864700002+00:00 DEBUG ┕━ 🐛 [debug]: | response: SearchResultDone(LdapResult { code: UnwillingToPerform, matcheddn: "", message: "Unsupported user filter: Unsupported user filter: Substring(\"uid\", LdapSubstringFilter { initial: Some(\"tes\"), any: [], final_: None })", referral: [] }) 2023-02-09T13:17:08.300759330+00:00 INFO LDAP session [ 42.2ms | 0.11% / 100.00% ] 2023-02-09T13:17:08.300784913+00:00 INFO ┝━ LDAP request [ 42.1ms | 0.22% / 99.78% ] 2023-02-09T13:17:08.300792913+00:00 DEBUG │ ┝━ 🐛 [debug]: | msg: LdapMsg { msgid: 1, op: BindRequest(LdapBindRequest { dn: "cn=admin,ou=people,dc=example,dc=com", cred: Simple("********") }), ctrl: [] } 2023-02-09T13:17:08.300794538+00:00 DEBUG │ ┝━ do_bind [ 42.0ms | 0.04% / 99.55% ] 2023-02-09T13:17:08.300796747+00:00 DEBUG │ │ ┝━ 🐛 [debug]: DN: cn=admin,ou=people,dc=example,dc=com 2023-02-09T13:17:08.300801038+00:00 DEBUG │ │ ┝━ bind [ 41.9ms | 0.15% / 99.27% ] 2023-02-09T13:17:08.300965246+00:00 DEBUG │ │ │ ┕━ passwords_match [ 41.8ms | 99.12% ] 2023-02-09T13:17:08.342778439+00:00 DEBUG │ │ ┝━ get_user_groups [ 101µs | 0.24% ] 2023-02-09T13:17:08.342785772+00:00 DEBUG │ │ │ ┝━ 🐛 [debug]: | user_id: UserId("admin") 2023-02-09T13:17:08.342811647+00:00 DEBUG │ │ │ ┝━ 🐛 [debug]: | query: SELECT "groups"."group_id", "display_name", "creation_date", "uuid" FROM "groups" INNER JOIN "memberships" ON "groups"."group_id" = "memberships"."group_id" WHERE "user_id" = ? 2023-02-09T13:17:08.342994188+00:00 DEBUG │ │ │ ┕━ 🐛 [debug]: | return: {GroupDetails { group_id: GroupId(1), display_name: "lldap_admin", creation_date: 2023-02-09T08:52:05.019774311Z, uuid: Uuid("a92dd3f8-dfbb-3c57-8fd6-46c93a5021e2") }} 2023-02-09T13:17:08.342996647+00:00 DEBUG │ │ ┕━ 🐛 [debug]: Success! 2023-02-09T13:17:08.343001022+00:00 DEBUG │ ┕━ 🐛 [debug]: | response: BindResponse(LdapBindResponse { res: LdapResult { code: Success, matcheddn: "", message: "", referral: [] }, saslcreds: None }) 2023-02-09T13:17:08.343202396+00:00 INFO ┕━ LDAP request [ 47.3µs | 0.07% / 0.11% ] 2023-02-09T13:17:08.343211271+00:00 DEBUG ┝━ 🐛 [debug]: | msg: LdapMsg { msgid: 2, op: SearchRequest(LdapSearchRequest { base: "ou=people,dc=example,dc=com", scope: Subtree, aliases: Never, sizelimit: 0, timelimit: 0, typesonly: false, filter: And([Equality("objectClass", "inetOrgPerson"), Or([Substring("uid", LdapSubstringFilter { initial: Some("test"), any: [], final_: None }), Substring("sn", LdapSubstringFilter { initial: Some("test"), any: [], final_: None }), Substring("givenName", LdapSubstringFilter { initial: Some("test"), any: [], final_: None })]), Or([Equality("uid", "%s"), Equality("sn", "%s"), Equality("givenName", "%s")])]), attrs: ["dn", "memberOf", "objectClass", "inetOrgPerson", "uid", "cn", ""] }), ctrl: [] } 2023-02-09T13:17:08.343212188+00:00 DEBUG ┝━ do_search [ 15.8µs | 0.02% / 0.04% ] 2023-02-09T13:17:08.343218563+00:00 DEBUG │ ┝━ 🐛 [debug]: | request.base: "ou=people,dc=example,dc=com" | scope: Users 2023-02-09T13:17:08.343219396+00:00 DEBUG │ ┕━ get_user_list [ 7.29µs | 0.02% ] 2023-02-09T13:17:08.343222313+00:00 DEBUG │ ┕━ 🐛 [debug]: | ldap_filter: And([Equality("objectClass", "inetOrgPerson"), Or([Substring("uid", LdapSubstringFilter { initial: Some("test"), any: [], final_: None }), Substring("sn", LdapSubstringFilter { initial: Some("test"), any: [], final_: None }), Substring("givenName", LdapSubstringFilter { initial: Some("test"), any: [], final_: None })]), Or([Equality("uid", "%s"), Equality("sn", "%s"), Equality("givenName", "%s")])]) 2023-02-09T13:17:08.343233354+00:00 DEBUG ┕━ 🐛 [debug]: | response: SearchResultDone(LdapResult { code: UnwillingToPerform, matcheddn: "", message: "Unsupported user filter: Unsupported user filter: Substring(\"uid\", LdapSubstringFilter { initial: Some(\"test\"), any: [], final_: None })", referral: [] }) ``` Thanks!
kerem 2026-02-27 08:15:38 +03:00
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#166
No description provided.