Skip to content

Add memberships admin API#19260

Merged
anoadragon453 merged 5 commits into
element-hq:developfrom
tchapgouv:admin-left-rooms
Dec 12, 2025
Merged

Add memberships admin API#19260
anoadragon453 merged 5 commits into
element-hq:developfrom
tchapgouv:admin-left-rooms

Conversation

@MatMaul
Copy link
Copy Markdown
Contributor

@MatMaul MatMaul commented Dec 2, 2025

Add memberships endpoint to the admin API. This is useful for forensics and T&S purpose.

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

@MatMaul MatMaul force-pushed the admin-left-rooms branch 2 times, most recently from b5263c3 to f845b3f Compare December 2, 2025 12:59
@MatMaul MatMaul changed the title Add left_rooms admin API Add memberships admin API Dec 2, 2025
@github-actions github-actions Bot deployed to PR Documentation Preview December 2, 2025 13:17 Active
Comment thread synapse/storage/databases/main/roommember.py
Comment thread synapse/storage/databases/main/roommember.py
@MatMaul MatMaul marked this pull request as ready for review December 2, 2025 13:38
@MatMaul MatMaul requested a review from a team as a code owner December 2, 2025 13:38
Copy link
Copy Markdown
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

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

I think this is mostly good to go. Useful functionality, thanks!

Mostly wording changes and a slight change to the response body below.

Comment thread docs/admin_api/user_admin_api.md Outdated
Comment thread docs/admin_api/user_admin_api.md Outdated
Comment thread docs/admin_api/user_admin_api.md
Comment thread synapse/rest/admin/users.py Outdated
Comment thread synapse/storage/databases/main/roommember.py
Comment thread docs/admin_api/user_admin_api.md Outdated
Comment thread tests/rest/admin/test_room.py
MatMaul and others added 4 commits December 11, 2025 21:50
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
Copy link
Copy Markdown
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

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

This now LGTM. Thank you for helping improve T&S! 💯

are returned.
which is a list of room membership states for the given user. This endpoint can
be used with both local and remote users, with the caveat that the homeserver will
only be aware of the memberships for rooms one of its local users has joined.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
only be aware of the memberships for rooms one of its local users has joined.
only be aware of the memberships for rooms that one of its local users has joined.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Done manually at 048629d as I wasn't able to edit your branch.

@anoadragon453
Copy link
Copy Markdown
Member

CI failures are due to Complement test flakes. Merging manually.

@anoadragon453 anoadragon453 merged commit 7347cc4 into element-hq:develop Dec 12, 2025
79 of 85 checks passed
anoadragon453 added a commit that referenced this pull request Dec 12, 2025
FrenchGithubUser added a commit to famedly/synapse that referenced this pull request Jan 19, 2026
# Famedly Synapse Release v1.145.0_1

### Famedly Additions for v1.145.0_1
- fix: typo in changelog (FrenchGithubUser)
- chore: remove dependabot config as we use renovate instead
(FrenchGithubUser)
- chore: bump Github actions versions in Famedly workflows
([\#229](#229)) (jason-famedly)

Checklist:
- depends on: famedly/complement#9

### Notes for Famedly:

- **Add memberships endpoint to the admin API. This is useful for
forensics and T&S purposes.
(element-hq/synapse#19260
- **Server admins can bypass the quarantine media check when downloading
media by setting the admin_unsafely_bypass_quarantine query parameter to
true on Client-Server API media download requests.
(element-hq/synapse#19275
- **Admin API: add worker support to GET
/_synapse/admin/v2/users/<user_id>.
(element-hq/synapse#19281
- **Add rate limit conf to user directory endpoint
(element-hq/synapse#19291
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants