diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2021-08-23 08:14:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-23 08:14:17 -0400 |
commit | 2af6d31b78109a989e27128ac655990c35b29d62 (patch) | |
tree | de461f67cf18f7bce536407e07b1eab15deee56a /synapse/rest/client/voip.py | |
parent | Do not include stack traces for known exceptions when trying multiple federat... (diff) | |
download | synapse-2af6d31b78109a989e27128ac655990c35b29d62.tar.xz |
Addtional type hints for the REST servlets. (#10665)
Diffstat (limited to '')
-rw-r--r-- | synapse/rest/client/voip.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/synapse/rest/client/voip.py b/synapse/rest/client/voip.py index f53020520d..9d46ed3af3 100644 --- a/synapse/rest/client/voip.py +++ b/synapse/rest/client/voip.py @@ -15,20 +15,27 @@ import base64 import hashlib import hmac +from typing import TYPE_CHECKING, Tuple +from synapse.http.server import HttpServer from synapse.http.servlet import RestServlet +from synapse.http.site import SynapseRequest from synapse.rest.client._base import client_patterns +from synapse.types import JsonDict + +if TYPE_CHECKING: + from synapse.server import HomeServer class VoipRestServlet(RestServlet): PATTERNS = client_patterns("/voip/turnServer$", v1=True) - def __init__(self, hs): + def __init__(self, hs: "HomeServer"): super().__init__() self.hs = hs self.auth = hs.get_auth() - async def on_GET(self, request): + async def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]: requester = await self.auth.get_user_by_req( request, self.hs.config.turn_allow_guests ) @@ -69,5 +76,5 @@ class VoipRestServlet(RestServlet): ) -def register_servlets(hs, http_server): +def register_servlets(hs: "HomeServer", http_server: HttpServer) -> None: VoipRestServlet(hs).register(http_server) |