diff --git a/synapse/federation/transport/server/_base.py b/synapse/federation/transport/server/_base.py index 1f5b81f1a889..9f0ef43abb1b 100644 --- a/synapse/federation/transport/server/_base.py +++ b/synapse/federation/transport/server/_base.py @@ -16,6 +16,7 @@ import logging import re from http import HTTPStatus +from typing import Optional, Tuple from synapse.api.errors import Codes, FederationDeniedError, SynapseError from synapse.api.urls import FEDERATION_V1_PREFIX @@ -145,14 +146,14 @@ async def _reset_retry_timings(self, origin): logger.exception("Error resetting retry timings on %s", origin) -def _parse_auth_header(header_bytes): +def _parse_auth_header(header_bytes: bytes) -> Tuple[str, str, str, Optional[str]]: """Parse an X-Matrix auth header Args: - header_bytes (bytes): header value + header_bytes: header value Returns: - Tuple[str, str, str, Optional[str]]: origin, key id, signature, destination. + origin, key id, signature, destination. Raises: AuthenticationError if the header could not be parsed