summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-12-11 16:33:31 +0000
committerGitHub <noreply@github.com>2020-12-11 16:33:31 +0000
commita8eceb01e59fcbddcea7d19031ed2392772e6d66 (patch)
treef038bfb1db118c655c6515e36f1aadb4cfe8c46d /synapse/api
parentImprove tests for structured logging. (#8916) (diff)
downloadsynapse-a8eceb01e59fcbddcea7d19031ed2392772e6d66.tar.xz
Honour AS ratelimit settings for /login requests (#8920)
Fixes #8846.
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/auth.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index bfcaf68b2a..1951f6e178 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -31,7 +31,9 @@ from synapse.api.errors import (
     MissingClientTokenError,
 )
 from synapse.api.room_versions import KNOWN_ROOM_VERSIONS
+from synapse.appservice import ApplicationService
 from synapse.events import EventBase
+from synapse.http.site import SynapseRequest
 from synapse.logging import opentracing as opentracing
 from synapse.storage.databases.main.registration import TokenLookupResult
 from synapse.types import StateMap, UserID
@@ -474,7 +476,7 @@ class Auth:
         now = self.hs.get_clock().time_msec()
         return now < expiry
 
-    def get_appservice_by_req(self, request):
+    def get_appservice_by_req(self, request: SynapseRequest) -> ApplicationService:
         token = self.get_access_token_from_request(request)
         service = self.store.get_app_service_by_token(token)
         if not service: