Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client server/user directory #141

Merged
merged 5 commits into from
Aug 16, 2024
Merged

Conversation

Mathixx
Copy link
Collaborator

@Mathixx Mathixx commented Aug 15, 2024

Implements https://spec.matrix.org/latest/client-server-api/#post_matrixclientv3user_directorysearch

This is not fixed in the spec and could be modified if needed :
- Performs a search for users. The homeserver may determine which subset of users are searched.
- We have decided to consider the users the requesting user shares a room with and those who reside in public rooms (known to the homeserver)

The search MUST consider local users to the homeserver, and SHOULD query remote users as part of the search.
( this problem is currently hidden by the use of specific tables in the MatrixDB database)

WARNING : Following Synapse implementation, we have used many tables (user_directory, user_who_share_private_rooms, users_in_public_rooms) to implement this feature.
These tables are used almost solely for the user_directory feature and are not used elsewhere.
Thus for now these tables are not filled and the feature is not yet usable.

@Mathixx Mathixx requested a review from guimard August 15, 2024 15:45
@@ -9,6 +9,7 @@
* For reference, look at how the capabilities are checked in the `changeDisplayname` function. ( ../profiles/changeProfiles.ts )
*
* TODO : Implement capability checks in the concerned API's for changing password and 3pid changes
* (TODO : Implement capability checks in the concerned API's for user_directory search (not specified in spec))

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
* These tables are used almost solely for the user_directory feature and are not used elsewhere.
* Thus for now these tables are not filled and the feature is not yet usable.
*
* TODO : implement the auto-update and track of these tables

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
clientServer.authenticate(req, res, (data) => {
const userId = data.sub

// ( TODO : could add a check to the capabilities to see if the user has the right to search for users)

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What says the spec for this ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec doesn't specify it, it was just an insight on what more could be done

Copy link
Member

@guimard guimard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase and merge directly

clientServer.authenticate(req, res, (data) => {
const userId = data.sub

// ( TODO : could add a check to the capabilities to see if the user has the right to search for users)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What says the spec for this ?

@Mathixx Mathixx force-pushed the client-server/user-directory branch from 0320f42 to 62e3e96 Compare August 16, 2024 05:28
@Mathixx Mathixx merged commit a0aa4c3 into full-id-service Aug 16, 2024
8 checks passed
@Mathixx Mathixx deleted the client-server/user-directory branch August 16, 2024 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants