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/tokenrefresh.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 'synapse/rest/client/tokenrefresh.py')
-rw-r--r-- | synapse/rest/client/tokenrefresh.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/synapse/rest/client/tokenrefresh.py b/synapse/rest/client/tokenrefresh.py index b2f858545c..c8c3b25bd3 100644 --- a/synapse/rest/client/tokenrefresh.py +++ b/synapse/rest/client/tokenrefresh.py @@ -12,11 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import TYPE_CHECKING + +from twisted.web.server import Request + from synapse.api.errors import AuthError +from synapse.http.server import HttpServer from synapse.http.servlet import RestServlet from ._base import client_patterns +if TYPE_CHECKING: + from synapse.server import HomeServer + class TokenRefreshRestServlet(RestServlet): """ @@ -26,12 +34,12 @@ class TokenRefreshRestServlet(RestServlet): PATTERNS = client_patterns("/tokenrefresh") - def __init__(self, hs): + def __init__(self, hs: "HomeServer"): super().__init__() - async def on_POST(self, request): + async def on_POST(self, request: Request) -> None: raise AuthError(403, "tokenrefresh is no longer supported.") -def register_servlets(hs, http_server): +def register_servlets(hs: "HomeServer", http_server: HttpServer) -> None: TokenRefreshRestServlet(hs).register(http_server) |