Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
set type hints for auth header parsing method
Browse files Browse the repository at this point in the history
  • Loading branch information
jcgruenhage committed Nov 27, 2021
1 parent 2cb31e8 commit 8c8d84e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions synapse/federation/transport/server/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8c8d84e

Please sign in to comment.