diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2022-04-11 12:07:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-11 12:07:23 -0400 |
commit | 4586119f0b0901be64f08655d3aaaef289a51bde (patch) | |
tree | 8150ea6084a6a7a034d272654720333d01b75b9f /synapse/config/tls.py | |
parent | Enable certificate checking during complement tests (#12435) (diff) | |
download | synapse-4586119f0b0901be64f08655d3aaaef289a51bde.tar.xz |
Add missing type hints to config classes. (#12402)
Diffstat (limited to 'synapse/config/tls.py')
-rw-r--r-- | synapse/config/tls.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/synapse/config/tls.py b/synapse/config/tls.py index 6e673d65a7..cb17950d25 100644 --- a/synapse/config/tls.py +++ b/synapse/config/tls.py @@ -14,7 +14,7 @@ import logging import os -from typing import List, Optional, Pattern +from typing import Any, List, Optional, Pattern from matrix_common.regex import glob_to_regex @@ -22,6 +22,7 @@ from OpenSSL import SSL, crypto from twisted.internet._sslverify import Certificate, trustRootFromCertificates from synapse.config._base import Config, ConfigError +from synapse.types import JsonDict logger = logging.getLogger(__name__) @@ -29,7 +30,7 @@ logger = logging.getLogger(__name__) class TlsConfig(Config): section = "tls" - def read_config(self, config: dict, config_dir_path: str, **kwargs): + def read_config(self, config: JsonDict, **kwargs: Any) -> None: self.tls_certificate_file = self.abspath(config.get("tls_certificate_path")) self.tls_private_key_file = self.abspath(config.get("tls_private_key_path")) @@ -142,13 +143,13 @@ class TlsConfig(Config): def generate_config_section( self, - config_dir_path, - server_name, - data_dir_path, - tls_certificate_path, - tls_private_key_path, - **kwargs, - ): + config_dir_path: str, + data_dir_path: str, + server_name: str, + tls_certificate_path: Optional[str], + tls_private_key_path: Optional[str], + **kwargs: Any, + ) -> str: """If the TLS paths are not specified the default will be certs in the config directory""" |