mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-30 17:16:15 -05:00
Make registration ratelimiter separate from the main events one
This commit is contained in:
parent
f4195f4118
commit
6f3cde8b25
@ -61,7 +61,7 @@ class RegistrationHandler(BaseHandler):
|
|||||||
self.user_directory_handler = hs.get_user_directory_handler()
|
self.user_directory_handler = hs.get_user_directory_handler()
|
||||||
self.captcha_client = CaptchaServerHttpClient(hs)
|
self.captcha_client = CaptchaServerHttpClient(hs)
|
||||||
self.identity_handler = self.hs.get_handlers().identity_handler
|
self.identity_handler = self.hs.get_handlers().identity_handler
|
||||||
self.ratelimiter = hs.get_ratelimiter()
|
self.ratelimiter = hs.get_registration_ratelimiter()
|
||||||
|
|
||||||
self._next_generated_user_id = None
|
self._next_generated_user_id = None
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ class RegisterRestServlet(RestServlet):
|
|||||||
self.identity_handler = hs.get_handlers().identity_handler
|
self.identity_handler = hs.get_handlers().identity_handler
|
||||||
self.room_member_handler = hs.get_room_member_handler()
|
self.room_member_handler = hs.get_room_member_handler()
|
||||||
self.macaroon_gen = hs.get_macaroon_generator()
|
self.macaroon_gen = hs.get_macaroon_generator()
|
||||||
self.ratelimiter = hs.get_ratelimiter()
|
self.ratelimiter = hs.get_registration_ratelimiter()
|
||||||
self.clock = hs.get_clock()
|
self.clock = hs.get_clock()
|
||||||
|
|
||||||
@interactive_auth_handler
|
@interactive_auth_handler
|
||||||
|
@ -206,6 +206,7 @@ class HomeServer(object):
|
|||||||
self.clock = Clock(reactor)
|
self.clock = Clock(reactor)
|
||||||
self.distributor = Distributor()
|
self.distributor = Distributor()
|
||||||
self.ratelimiter = Ratelimiter()
|
self.ratelimiter = Ratelimiter()
|
||||||
|
self.registration_ratelimiter = Ratelimiter()
|
||||||
|
|
||||||
self.datastore = None
|
self.datastore = None
|
||||||
|
|
||||||
@ -251,6 +252,9 @@ class HomeServer(object):
|
|||||||
def get_ratelimiter(self):
|
def get_ratelimiter(self):
|
||||||
return self.ratelimiter
|
return self.ratelimiter
|
||||||
|
|
||||||
|
def get_registration_ratelimiter(self):
|
||||||
|
return self.registration_ratelimiter
|
||||||
|
|
||||||
def build_federation_client(self):
|
def build_federation_client(self):
|
||||||
return FederationClient(self)
|
return FederationClient(self)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user