mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 12:15:02 -04:00
Additional type hints for config module. (#11465)
This adds some misc. type hints to helper methods used in the `synapse.config` module.
This commit is contained in:
parent
a265fbd397
commit
f44d729d4c
15 changed files with 129 additions and 99 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue