summary refs log tree commit diff
path: root/synapse/config/jwt.py
diff options
context:
space:
mode:
authorJacek KuĊ›nierz <jacek.kusnierz@tum.de>2022-06-30 19:48:04 +0200
committerGitHub <noreply@github.com>2022-06-30 19:48:04 +0200
commit50f0e4028b334566a067b671d15246a9b05e8498 (patch)
treeb2fee0ce8dc2b1f81a73cf87167c8c747092ecda /synapse/config/jwt.py
parentMerge remote-tracking branch 'origin/release-v1.62' into develop (diff)
downloadsynapse-50f0e4028b334566a067b671d15246a9b05e8498.tar.xz
Allow dependency errors to pass through (#13113)
Signed-off-by: Jacek Kusnierz <jacek.kusnierz@tum.de>
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
Diffstat (limited to 'synapse/config/jwt.py')
-rw-r--r--synapse/config/jwt.py17
1 files changed, 3 insertions, 14 deletions
diff --git a/synapse/config/jwt.py b/synapse/config/jwt.py

index 49aaca7cf6..a973bb5080 100644 --- a/synapse/config/jwt.py +++ b/synapse/config/jwt.py
@@ -15,14 +15,9 @@ from typing import Any from synapse.types import JsonDict +from synapse.util.check_dependencies import check_requirements -from ._base import Config, ConfigError - -MISSING_AUTHLIB = """Missing authlib library. This is required for jwt login. - - Install by running: - pip install synapse[jwt] - """ +from ._base import Config class JWTConfig(Config): @@ -41,13 +36,7 @@ class JWTConfig(Config): # that the claims exist on the JWT. self.jwt_issuer = jwt_config.get("issuer") self.jwt_audiences = jwt_config.get("audiences") - - try: - from authlib.jose import JsonWebToken - - JsonWebToken # To stop unused lint. - except ImportError: - raise ConfigError(MISSING_AUTHLIB) + check_requirements("jwt") else: self.jwt_enabled = False self.jwt_secret = None