Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #23 (for the most part, refer to the exceptions section below). Since the actual logic for rate-limiting is not in place (yet), this simply builds but doesn't actually do anything right now.
Exceptions
The following endpoints belong to
groups
in Matrix, which are not documented very well; based on a discussion on the Matrix spec room, it seems that Matrix will get rid of group endpoints in the future anyways so it's best to ignore these endpoints and their handlers for now.POST _matrix/client/r0/create_group
GET /_matrix/client/r0/joined_groups
GET /_matrix/client/r0/publicised_groups
&POST /_matrix/client/r0/publicised_groups
The following family of endpoints are related to rooms and are defined in
modules/client/rooms/rooms.h
. These endpoints share common GET/PUT/POST handlers. For the purpose of satisfying the general motivation behind rate-limiting (prevent spam/DDoS attacks against the server), it is acceptable to ignore rate-limiting for GETs for rooms, and impose a fairly relaxed rate for PUTs & POSTs.GET /_matrix/client/r0/rooms/{roomId}/aliases
POST /_matrix/client/r0/rooms/{roomId}/invite
POST /_matrix/client/r0/rooms/{roomId}/join
POST /_matrix/client/r0/rooms/{roomId}/leave
POST /_matrix/client/r0/rooms/{roomId}/forget
Handlers for
PUT /_matrix/client/r0/pushrules/*
have been ignored. This is because the specs for rate-limiting vary based on the parameters (path/JSON) passed in. This also complicates the design decision for rate-limiting, since it warrants thought whether to rate-limit such endpoints at the abstract HTTP level, or at the application-logic level.Handlers for Endpoints related to 3pid are ignored since they aren't really implemented right now. This includes the
/_synapse/admin/v1/deactivate/
endpoint defined in the Admin API since it is related to 3pid.The following endpoint:
GET /_matrix/federation/unstable/rooms/
is said to be undocumented in the comments, and as such has been ignored.