summary refs log tree commit diff
path: root/synapse/rest/client/auth.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-08-26 07:53:52 -0400
committerGitHub <noreply@github.com>2021-08-26 11:53:52 +0000
commit1aa0dad02187c3b972187f5952cfbce336b0ca5c (patch)
tree6c948ed89be836c765e27bf1a4c109d5df1426d2 /synapse/rest/client/auth.py
parentCache the result of fetching the room hierarchy over federation. (#10647) (diff)
downloadsynapse-1aa0dad02187c3b972187f5952cfbce336b0ca5c.tar.xz
Additional type hints for REST servlets (part 2). (#10674)
Applies the changes from #10665 to additional modules.
Diffstat (limited to 'synapse/rest/client/auth.py')
-rw-r--r--synapse/rest/client/auth.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/synapse/rest/client/auth.py b/synapse/rest/client/auth.py
index 91800c0278..df8cc4ac7a 100644
--- a/synapse/rest/client/auth.py
+++ b/synapse/rest/client/auth.py
@@ -15,11 +15,14 @@
 import logging
 from typing import TYPE_CHECKING
 
+from twisted.web.server import Request
+
 from synapse.api.constants import LoginType
 from synapse.api.errors import LoginError, SynapseError
 from synapse.api.urls import CLIENT_API_PREFIX
-from synapse.http.server import respond_with_html
+from synapse.http.server import HttpServer, respond_with_html
 from synapse.http.servlet import RestServlet, parse_string
+from synapse.http.site import SynapseRequest
 
 from ._base import client_patterns
 
@@ -49,7 +52,7 @@ class AuthRestServlet(RestServlet):
         self.registration_token_template = hs.config.registration_token_template
         self.success_template = hs.config.fallback_success_template
 
-    async def on_GET(self, request, stagetype):
+    async def on_GET(self, request: SynapseRequest, stagetype: str) -> None:
         session = parse_string(request, "session")
         if not session:
             raise SynapseError(400, "No session supplied")
@@ -88,7 +91,7 @@ class AuthRestServlet(RestServlet):
         respond_with_html(request, 200, html)
         return None
 
-    async def on_POST(self, request, stagetype):
+    async def on_POST(self, request: Request, stagetype: str) -> None:
 
         session = parse_string(request, "session")
         if not session:
@@ -172,5 +175,5 @@ class AuthRestServlet(RestServlet):
         return None
 
 
-def register_servlets(hs, http_server):
+def register_servlets(hs: "HomeServer", http_server: HttpServer) -> None:
     AuthRestServlet(hs).register(http_server)