diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2021-03-16 11:21:26 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-16 11:21:26 +0000 |
commit | dd69110d9588b5fc8cca10cba9509d80f88b84f4 (patch) | |
tree | d425c7b5b9b781ca57bfaf4c987e3e01e061897e /synapse/handlers | |
parent | Clean up config settings for stats (#9604) (diff) | |
download | synapse-dd69110d9588b5fc8cca10cba9509d80f88b84f4.tar.xz |
Add support for stable MSC2858 API (#9617)
The stable format uses different brand identifiers, so we need to support two identifiers for each IdP.
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/cas_handler.py | 1 | ||||
-rw-r--r-- | synapse/handlers/oidc_handler.py | 3 | ||||
-rw-r--r-- | synapse/handlers/saml_handler.py | 1 | ||||
-rw-r--r-- | synapse/handlers/sso.py | 5 |
4 files changed, 10 insertions, 0 deletions
diff --git a/synapse/handlers/cas_handler.py b/synapse/handlers/cas_handler.py index 04972f9cf0..cb67589f7d 100644 --- a/synapse/handlers/cas_handler.py +++ b/synapse/handlers/cas_handler.py @@ -83,6 +83,7 @@ class CasHandler: # the SsoIdentityProvider protocol type. self.idp_icon = None self.idp_brand = None + self.unstable_idp_brand = None self._sso_handler = hs.get_sso_handler() diff --git a/synapse/handlers/oidc_handler.py b/synapse/handlers/oidc_handler.py index f5d1821127..01c91f9d1c 100644 --- a/synapse/handlers/oidc_handler.py +++ b/synapse/handlers/oidc_handler.py @@ -330,6 +330,9 @@ class OidcProvider: # optional brand identifier for this auth provider self.idp_brand = provider.idp_brand + # Optional brand identifier for the unstable API (see MSC2858). + self.unstable_idp_brand = provider.unstable_idp_brand + self._sso_handler = hs.get_sso_handler() self._sso_handler.register_identity_provider(self) diff --git a/synapse/handlers/saml_handler.py b/synapse/handlers/saml_handler.py index a9645b77d8..ec2ba11c75 100644 --- a/synapse/handlers/saml_handler.py +++ b/synapse/handlers/saml_handler.py @@ -81,6 +81,7 @@ class SamlHandler(BaseHandler): # the SsoIdentityProvider protocol type. self.idp_icon = None self.idp_brand = None + self.unstable_idp_brand = None # a map from saml session id to Saml2SessionData object self._outstanding_requests_dict = {} # type: Dict[str, Saml2SessionData] diff --git a/synapse/handlers/sso.py b/synapse/handlers/sso.py index 6ef459acff..415b1c2d17 100644 --- a/synapse/handlers/sso.py +++ b/synapse/handlers/sso.py @@ -98,6 +98,11 @@ class SsoIdentityProvider(Protocol): """Optional branding identifier""" return None + @property + def unstable_idp_brand(self) -> Optional[str]: + """Optional brand identifier for the unstable API (see MSC2858).""" + return None + @abc.abstractmethod async def handle_redirect_request( self, |