summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-16 15:06:06 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-16 15:06:06 +0100
commit22927d6ee8b1133928772924b69333ef2a1347af (patch)
tree487fd2645522980b4c181e22945f34eef4154967
parentMerge commit 'f14428b25' into anoa/dinsic_release_1_31_0 (diff)
downloadsynapse-22927d6ee8b1133928772924b69333ef2a1347af.tar.xz
lint
-rw-r--r--synapse/events/spamcheck.py8
-rw-r--r--synapse/server.py20
-rw-r--r--tests/handlers/test_register.py4
3 files changed, 8 insertions, 24 deletions
diff --git a/synapse/events/spamcheck.py b/synapse/events/spamcheck.py

index 593ca70e92..f3322af499 100644 --- a/synapse/events/spamcheck.py +++ b/synapse/events/spamcheck.py
@@ -65,7 +65,7 @@ class SpamChecker: async def user_may_invite( self, inviter_userid: str, - invitee_userid: str, + invitee_userid: Optional[str], third_party_invite: Optional[Dict], room_id: str, new_room: bool, @@ -104,7 +104,8 @@ class SpamChecker: new_room, published_room, ) - ) is False + ) + is False ): return False @@ -139,7 +140,8 @@ class SpamChecker: spam_checker.user_may_create_room( userid, invite_list, third_party_invite_list, cloning ) - ) is False + ) + is False ): return False diff --git a/synapse/server.py b/synapse/server.py
index 2574f6786e..bd8ee0e34a 100644 --- a/synapse/server.py +++ b/synapse/server.py
@@ -365,26 +365,6 @@ class HomeServer(metaclass=abc.ABCMeta): def get_proxied_blacklisted_http_client(self) -> SimpleHttpClient: """ An HTTP client that uses configured HTTP(S) proxies and blacklists IPs - based on the IP range blacklist. - """ - return SimpleHttpClient( - self, ip_blacklist=self.config.ip_range_blacklist, use_proxy=True, - ) - - @cache_in_self - def get_federation_http_client(self) -> MatrixFederationHttpClient: - """ - An HTTP client for federation. - """ - tls_client_options_factory = context_factory.FederationPolicyForHTTPS( - self.config - ) - return MatrixFederationHttpClient(self, tls_client_options_factory) - - @cache_in_self - def get_proxied_blacklisted_http_client(self) -> SimpleHttpClient: - """ - An HTTP client that uses configured HTTP(S) proxies and blacklists IPs based on the IP range blacklist/whitelist. """ return SimpleHttpClient( diff --git a/tests/handlers/test_register.py b/tests/handlers/test_register.py
index 0535592b60..9c39b140a1 100644 --- a/tests/handlers/test_register.py +++ b/tests/handlers/test_register.py
@@ -580,7 +580,9 @@ class RegistrationTestCase(unittest.HomeserverTestCase): # Mock Synapse's http json post method to check for the internal bind call post_json_get_json = Mock(return_value=make_awaitable(None)) - self.hs.get_identity_handler().http_client.post_json_get_json = post_json_get_json + self.hs.get_identity_handler().http_client.post_json_get_json = ( + post_json_get_json + ) # Retrieve a UIA session ID channel = self.uia_register(