kamax-matrix / mxisd

Federated Matrix Identity Server
GNU Affero General Public License v3.0
220 stars 112 forks source link

Enable directory search by sql #47

Closed Rohithzr closed 6 years ago

Rohithzr commented 6 years ago

I am trying to activate directory search as documented in directory-users.md

I see that the query passes one param that should be i believe the seach query? but when I see in the database :

Query:
select * from user_directory;
Response:
userId: @username:idigid.com
displayName: NULL

now this user just signed up so no display name is present but is this the right behavior? shouldn't i be able to search the user with "username" and not needing to write "@username:idigid.com"

maxidorius commented 6 years ago

The SQL module documentation is not as good as I want it to be, and I don't use it myself. I'll get back to you on this after I've confirmed that everything is working as expected.

Rohithzr commented 6 years ago

it would be great if i can pass the 'localpart' multiple times something like

type: 'localpart,localpart'
value: 'SELECT idColumn, displayNameColumn FROM table WHERE displayNameColumn LIKE ? OR idColumn LIKE %?%'
maxidorius commented 6 years ago

This is a subset of #56

maxidorius commented 6 years ago

@Rohithzr After looking into this, there doesn't seem to be an issue. I think the lack of documentation is the real problem, so we'll fix that as part of #56. About the multiple parameters in the query, mxisd already replaces every ? in the query by the search value. There is no notion of "type": the string sent by the client is used.

I'll close this. Please re-open once #56 is completed if you are still having problems.