Bottin doesn't support subString filter #4

Open
opened 2021-07-21 17:45:19 +00:00 by erwan · 0 comments
Member

LDAP filter allow the subStrings Filter, like follow theses sources show:
ldapWiki, ldap.com.

Replay the bug:

	//Search value with ldap and filter
	searchRequest := ldap.NewSearchRequest(
		config.UserBaseDN,
		ldap.ScopeSingleLevel, ldap.NeverDerefAliases, 0, 0, false,
		fmt.Sprintf("(&(cn=%s*))", input),
		[]string{config.UserNameAttr, "dn", "displayname", "givenname", "sn", "mail"},
		nil)

	sr, err := login.conn.Search(searchRequest)
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}

Expected Result:

We obtain all users where their Cn begin with the substring input

Real Result:

An error from LDAP:
LDAP Result Code 53 "Unwilling To Perform": Unsupported filter: message.FilterSubstrings{type_:"cn", substrings:[]message.Substring{"e", "e"}} message.FilterSubstrings

Conclusion:

Bottin don't consider the SubString Filter like a basic filter.
Add this filter in further version will help greatly the research for users or groups.

LDAP filter allow the subStrings Filter, like follow theses sources show: [ldapWiki](https://ldapwiki.com/wiki/Substring%20Search%20Filter), [ldap.com](https://ldap.com/ldap-filters/). ### Replay the bug: ```go //Search value with ldap and filter searchRequest := ldap.NewSearchRequest( config.UserBaseDN, ldap.ScopeSingleLevel, ldap.NeverDerefAliases, 0, 0, false, fmt.Sprintf("(&(cn=%s*))", input), []string{config.UserNameAttr, "dn", "displayname", "givenname", "sn", "mail"}, nil) sr, err := login.conn.Search(searchRequest) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } ``` ### Expected Result: We obtain all users where their Cn begin with the substring input ### Real Result: An error from LDAP: `LDAP Result Code 53 "Unwilling To Perform": Unsupported filter: message.FilterSubstrings{type_:"cn", substrings:[]message.Substring{"e", "e"}} message.FilterSubstrings` ### Conclusion: Bottin don't consider the SubString Filter like a basic filter. Add this filter in further version will help greatly the research for users or groups.
erwan changed title from Bottin, Don't support subString filter to Bottin, Doesn't support subString filter 2021-07-21 18:07:39 +00:00
erwan changed title from Bottin, Doesn't support subString filter to Bottin doesn't support subString filter 2021-07-21 18:07:52 +00:00
quentin added the
feature
label 2021-09-17 15:27:48 +00: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: Deuxfleurs/bottin#4
No description provided.