Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

User Admin API: Ability to exclude user types #15720

Closed
weeman1337 opened this issue Jun 5, 2023 · 4 comments · Fixed by #15844
Closed

User Admin API: Ability to exclude user types #15720

weeman1337 opened this issue Jun 5, 2023 · 4 comments · Fixed by #15844
Labels
A-Admin-API O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Blocks non-critical functionality, workarounds exist. T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.

Comments

@weeman1337
Copy link
Contributor

weeman1337 commented Jun 5, 2023

Story

As an admin I want to be able to exclude user types when fetching the user list from the admin API,
so that I can exclude bot or service users.

Proposal

Add a new query param not_user_types to GET /_synapse/admin/v2/users: user type to exclude. Can be provided multiple times. Returns only users, that do not match any of them. "empty string" should be possible to exclude users without a type.

The design is similar to https://spec.matrix.org/v1.7/client-server-api/#get_matrixclientv3useruseridfilterfilterid

@weeman1337
Copy link
Contributor Author

I am happy to contribute a pull request.

@H-Shay H-Shay added T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Blocks non-critical functionality, workarounds exist. labels Jun 6, 2023
@erikjohnston
Copy link
Member

I think this would be fine, so long as we ensure:

  1. This matches how we do filtering elsewhere in the (admin) API
  2. Check what the performance of such APIs are like, i.e. we might need to add an index.

@Bhupi2508
Copy link

Hi @weeman1337 , @erikjohnston , @H-Shay.

I'm interested in contributing to the repository. Could you provide more details about the issue, specifically :

  1. How does the current user list fetching work?
  2. What is the expected behavior with the new query parameters, 'user_types' and 'without_user_types'?
  3. Are there any specific implementation guidelines or considerations?

@weeman1337
Copy link
Contributor Author

@Bhupi2508 thank you for your offer. Unfortunately I am already working on it.

@weeman1337 weeman1337 changed the title User Admin API: Ability to include or exclude user types User Admin API: Ability to exclude user types Jun 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Admin-API O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Blocks non-critical functionality, workarounds exist. T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants