diff options
Diffstat (limited to 'synapse/config/saml2.py')
-rw-r--r-- | synapse/config/saml2.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/synapse/config/saml2.py b/synapse/config/saml2.py index ec9d9f65e7..ba2b0905ff 100644 --- a/synapse/config/saml2.py +++ b/synapse/config/saml2.py @@ -1,5 +1,5 @@ # Copyright 2018 New Vector Ltd -# Copyright 2019-2021 The Matrix.org Foundation C.I.C. +# Copyright 2019 The Matrix.org Foundation C.I.C. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,11 +14,10 @@ # limitations under the License. import logging -from typing import Any, List, Set +from typing import Any, List from synapse.config.sso import SsoAttributeRequirement from synapse.python_dependencies import DependencyException, check_requirements -from synapse.types import JsonDict from synapse.util.module_loader import load_module, load_python_module from ._base import Config, ConfigError @@ -34,7 +33,7 @@ LEGACY_USER_MAPPING_PROVIDER = ( ) -def _dict_merge(merge_dict: dict, into_dict: dict) -> None: +def _dict_merge(merge_dict, into_dict): """Do a deep merge of two dicts Recursively merges `merge_dict` into `into_dict`: @@ -44,8 +43,8 @@ def _dict_merge(merge_dict: dict, into_dict: dict) -> None: the value from `merge_dict`. Args: - merge_dict: dict to merge - into_dict: target dict to be modified + merge_dict (dict): dict to merge + into_dict (dict): target dict """ for k, v in merge_dict.items(): if k not in into_dict: @@ -65,7 +64,7 @@ def _dict_merge(merge_dict: dict, into_dict: dict) -> None: class SAML2Config(Config): section = "saml2" - def read_config(self, config, **kwargs) -> None: + def read_config(self, config, **kwargs): self.saml2_enabled = False saml2_config = config.get("saml2_config") @@ -184,8 +183,8 @@ class SAML2Config(Config): ) def _default_saml_config_dict( - self, required_attributes: Set[str], optional_attributes: Set[str] - ) -> JsonDict: + self, required_attributes: set, optional_attributes: set + ): """Generate a configuration dictionary with required and optional attributes that will be needed to process new user registration @@ -196,7 +195,7 @@ class SAML2Config(Config): additional information to Synapse user accounts, but are not required Returns: - A SAML configuration dictionary + dict: A SAML configuration dictionary """ import saml2 @@ -223,7 +222,7 @@ class SAML2Config(Config): }, } - def generate_config_section(self, config_dir_path, server_name, **kwargs) -> str: + def generate_config_section(self, config_dir_path, server_name, **kwargs): return """\ ## Single sign-on integration ## |