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

Admin API for requesting events for a room that are waiting to be processed after inbound federation (ie events in federation_inbound_events_staging) #12086

Open
Gnuxie opened this issue Feb 25, 2022 · 2 comments
Labels
A-Admin-API A-Moderation Tools for moderating HSes: event redaction, media removal, purge admin API, reports from users, ... T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.

Comments

@Gnuxie
Copy link

Gnuxie commented Feb 25, 2022

Description:

We would like an admin api to view events that are waiting in federation_inbound_events_staging for a specific room.

The reason being we want this is so that during a heavy spam attack we can have better viability about what is happening in a room by cutting out some of the latency where we would have to wait for Synapse to process inbound events. Though, I understand that this will not give us a complete picture and the events can be rejected.

What I am imagining is something like this:

Check for inbound events

GET /_synapse/admin/v1/rooms/<room_id>/federation_inbound_events

The response that will be returned

{
  "events": [
    {
      "content": {
        "body": "This is an example text message",
        "msgtype": "m.text",
        "format": "org.matrix.custom.html",
        "formatted_body": "<b>This is an example text message</b>"
      },
      "type": "m.room.message",
      "event_id": "$143273582443PhrSn:example.org",
      "room_id": "!636q39766251:example.com",
      "sender": "@example:example.org",
      "origin_server_ts": 1432735824653,
      "unsigned": {
        "age": 1234
      }
    }
  ]
}

Things I am assuming in the above

  1. The events will be relatively recent and will not have been through authorization before. (If this isn't true, then at the least there probably needs to be some information about what the previous events were for each event).

  2. The events will be returned in chronological order

  3. That there will not be enough events in the response to warrant mimicking https://spec.matrix.org/v1.2/client-server-api/#get_matrixclientv3roomsroomidmessages but that's not a problem for me if there could be.

  4. That there will be no penalty for repeatedly calling this endpoint for updates

  5. That the sender matches the origin of the event

@erikjohnston erikjohnston added the T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. label Feb 28, 2022
@erikjohnston
Copy link
Member

@Gnuxie how useful would this be to you and your team? Just working out the prioritisation.

@Gnuxie
Copy link
Author

Gnuxie commented Mar 1, 2022

Hi @erikjohnston, It's something we ideally want to have within the next couple of months (though sooner than later).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Admin-API A-Moderation Tools for moderating HSes: event redaction, media removal, purge admin API, reports from users, ... T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
Development

No branches or pull requests

3 participants