summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2020-12-10 12:42:55 +0000
committerGitHub <noreply@github.com>2020-12-10 12:42:55 +0000
commit1821f7cc265ab01cfee4055cfddb90563b61ce5b (patch)
tree56dfbf4d1cb7874115de4ad717dc5e661cf3387b
parentDeprecate Shutdown Room and Purge Room Admin API (#8829) (diff)
downloadsynapse-1821f7cc265ab01cfee4055cfddb90563b61ce5b.tar.xz
Fix buglet in DirectRenderJsonResource (#8897)
this was using `canonical_json` without setting it, so when you used it as a
standalone class, you would get exceptions.
-rw-r--r--changelog.d/8897.feature1
-rw-r--r--synapse/http/server.py8
2 files changed, 6 insertions, 3 deletions
diff --git a/changelog.d/8897.feature b/changelog.d/8897.feature
new file mode 100644
index 0000000000..d450ef4998
--- /dev/null
+++ b/changelog.d/8897.feature
@@ -0,0 +1 @@
+Add support for allowing users to pick their own user ID during a single-sign-on login.
diff --git a/synapse/http/server.py b/synapse/http/server.py
index 6a4e429a6c..e464bfe6c7 100644
--- a/synapse/http/server.py
+++ b/synapse/http/server.py
@@ -275,6 +275,10 @@ class DirectServeJsonResource(_AsyncResource):
     formatting responses and errors as JSON.
     """
 
+    def __init__(self, canonical_json=False, extract_context=False):
+        super().__init__(extract_context)
+        self.canonical_json = canonical_json
+
     def _send_response(
         self, request: Request, code: int, response_object: Any,
     ):
@@ -318,9 +322,7 @@ class JsonResource(DirectServeJsonResource):
     )
 
     def __init__(self, hs, canonical_json=True, extract_context=False):
-        super().__init__(extract_context)
-
-        self.canonical_json = canonical_json
+        super().__init__(canonical_json, extract_context)
         self.clock = hs.get_clock()
         self.path_regexs = {}
         self.hs = hs