diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2021-02-19 13:20:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-19 13:20:34 -0500 |
commit | fc8b3d88097d2c985e8eae9779cdb4b23e1a8ef6 (patch) | |
tree | f92ea6fbe63e71f2fc4e01abbb814f129be333b0 /synapse/config | |
parent | Regenerate exact thumbnails if missing (#9438) (diff) | |
download | synapse-fc8b3d88097d2c985e8eae9779cdb4b23e1a8ef6.tar.xz |
Ratelimit cross-user key sharing requests. (#8957)
Diffstat (limited to 'synapse/config')
-rw-r--r-- | synapse/config/ratelimiting.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/config/ratelimiting.py b/synapse/config/ratelimiting.py index def33a60ad..847d25122c 100644 --- a/synapse/config/ratelimiting.py +++ b/synapse/config/ratelimiting.py @@ -102,6 +102,16 @@ class RatelimitConfig(Config): defaults={"per_second": 0.01, "burst_count": 3}, ) + # Ratelimit cross-user key requests: + # * For local requests this is keyed by the sending device. + # * For requests received over federation this is keyed by the origin. + # + # Note that this isn't exposed in the configuration as it is obscure. + self.rc_key_requests = RateLimitConfig( + config.get("rc_key_requests", {}), + defaults={"per_second": 20, "burst_count": 100}, + ) + self.rc_3pid_validation = RateLimitConfig( config.get("rc_3pid_validation") or {}, defaults={"per_second": 0.003, "burst_count": 5}, |