summary refs log tree commit diff
path: root/synapse/config/sso.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-12-01 07:28:23 -0500
committerGitHub <noreply@github.com>2021-12-01 07:28:23 -0500
commitf44d729d4ccae61bc0cdd5774acb3233eb5f7c13 (patch)
tree03ae2faa020831f8116c79d6cddcf2008dce2cf4 /synapse/config/sso.py
parentRegister the login redirect endpoint for v3. (#11451) (diff)
downloadsynapse-f44d729d4ccae61bc0cdd5774acb3233eb5f7c13.tar.xz
Additional type hints for config module. (#11465)
This adds some misc. type hints to helper methods used
in the `synapse.config` module.
Diffstat (limited to 'synapse/config/sso.py')
-rw-r--r--synapse/config/sso.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/synapse/config/sso.py b/synapse/config/sso.py

index 60aacb13ea..e4a4243261 100644 --- a/synapse/config/sso.py +++ b/synapse/config/sso.py
@@ -1,4 +1,4 @@ -# Copyright 2020 The Matrix.org Foundation C.I.C. +# Copyright 2020-2021 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. @@ -29,13 +29,13 @@ https://matrix-org.github.io/synapse/latest/templates.html ---------------------------------------------------------------------------------------""" -@attr.s(frozen=True) +@attr.s(frozen=True, auto_attribs=True) class SsoAttributeRequirement: """Object describing a single requirement for SSO attributes.""" - attribute = attr.ib(type=str) + attribute: str # If a value is not given, than the attribute must simply exist. - value = attr.ib(type=Optional[str]) + value: Optional[str] JSON_SCHEMA = { "type": "object", @@ -49,7 +49,7 @@ class SSOConfig(Config): section = "sso" - def read_config(self, config, **kwargs): + def read_config(self, config, **kwargs) -> None: sso_config: Dict[str, Any] = config.get("sso") or {} # The sso-specific template_dir @@ -106,7 +106,7 @@ class SSOConfig(Config): ) self.sso_client_whitelist.append(login_fallback_url) - def generate_config_section(self, **kwargs): + def generate_config_section(self, **kwargs) -> str: return """\ # Additional settings to use with single-sign on systems such as OpenID Connect, # SAML2 and CAS.