From a64f1c55b1666dd9155b691e534a0fafc5cfde1c Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Mon, 26 Jul 2021 13:09:36 +0300 Subject: [PATCH 1/2] Fix saml.DefaultSamlMappingProvider import Not sure from when, but trying to import the default configured SAML mapping provider crashes with circular imports. Removed the imports `synapse.state` and `synapse.storage` which were caising the circular, and seem to have only been used for type hints, which were removed in https://github.com/matrix-org/synapse/commit/98aec1cc9da2bd6b8e34ffb282c85abf9b8b42ca Signed-off-by: Jason Robinson --- changelog.d/10477.bugfix | 1 + synapse/handlers/_base.py | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) create mode 100644 changelog.d/10477.bugfix diff --git a/changelog.d/10477.bugfix b/changelog.d/10477.bugfix new file mode 100644 index 000000000000..bb794d1f3504 --- /dev/null +++ b/changelog.d/10477.bugfix @@ -0,0 +1 @@ +Fix circular import with the default SAML mapping handler. diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py index 525f3d39b1ee..6a05a6530599 100644 --- a/synapse/handlers/_base.py +++ b/synapse/handlers/_base.py @@ -15,8 +15,6 @@ import logging from typing import TYPE_CHECKING, Optional -import synapse.state -import synapse.storage import synapse.types from synapse.api.constants import EventTypes, Membership from synapse.api.ratelimiting import Ratelimiter From befcb04dac39dffc1b4e3ae69bac989b67a9e3a2 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Tue, 27 Jul 2021 15:39:26 +0300 Subject: [PATCH 2/2] Update changelog.d/10477.bugfix Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- changelog.d/10477.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/10477.bugfix b/changelog.d/10477.bugfix index bb794d1f3504..bcc92de43427 100644 --- a/changelog.d/10477.bugfix +++ b/changelog.d/10477.bugfix @@ -1 +1 @@ -Fix circular import with the default SAML mapping handler. +Fix bug introduced in Synapse 1.38 which caused an exception at startup when SAML authentication was enabled.