summary refs log tree commit diff
path: root/synapse/config
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2019-06-11 00:03:57 +0100
committerRichard van der Hoff <richard@matrix.org>2019-06-11 00:03:57 +0100
commit426049247b271543a3a01e934851aefa727ba204 (patch)
tree58ff195c6afc92fded65c89d48c888bc22ad3853 /synapse/config
parentMerge remote-tracking branch 'origin/develop' into rav/saml2_client (diff)
downloadsynapse-426049247b271543a3a01e934851aefa727ba204.tar.xz
Code cleanups and simplifications.
Also: share the saml client between redirect and response handlers.
Diffstat (limited to 'synapse/config')
-rw-r--r--synapse/config/saml2_config.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/config/saml2_config.py b/synapse/config/saml2_config.py
index 60384d33ff..a6ff62df09 100644
--- a/synapse/config/saml2_config.py
+++ b/synapse/config/saml2_config.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+from synapse.python_dependencies import DependencyException, check_requirements
 
 from ._base import Config, ConfigError
 
@@ -25,6 +26,11 @@ class SAML2Config(Config):
         if not saml2_config or not saml2_config.get("enabled", True):
             return
 
+        try:
+            check_requirements('saml2')
+        except DependencyException as e:
+            raise ConfigError(e.message)
+
         self.saml2_enabled = True
 
         import saml2.config
@@ -75,7 +81,6 @@ class SAML2Config(Config):
         # override them.
         #
         #saml2_config:
-        #  enabled: true
         #  sp_config:
         #    # point this to the IdP's metadata. You can use either a local file or
         #    # (preferably) a URL.