summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erikj@element.io>2024-07-09 10:25:44 +0100
committerGitHub <noreply@github.com>2024-07-09 10:25:44 +0100
commit0ed1c64c835eb0354930d53f8c19a3dbacb68869 (patch)
tree9843f01315dfd053425272fd3625cd9f5f3ff96c
parentBump ijson from 3.2.3 to 3.3.0 (#17413) (diff)
downloadsynapse-0ed1c64c835eb0354930d53f8c19a3dbacb68869.tar.xz
Fix `/versions` requests (#17410)
We need it to work on workers and allow guest access.

Broke by #17392
-rw-r--r--changelog.d/17410.misc1
-rw-r--r--synapse/app/generic_worker.py4
-rw-r--r--synapse/rest/client/versions.py7
3 files changed, 11 insertions, 1 deletions
diff --git a/changelog.d/17410.misc b/changelog.d/17410.misc
new file mode 100644
index 0000000000..76e3976e28
--- /dev/null
+++ b/changelog.d/17410.misc
@@ -0,0 +1 @@
+Finish up work to allow per-user feature flags.
diff --git a/synapse/app/generic_worker.py b/synapse/app/generic_worker.py
index 599f95466b..248622fa92 100644
--- a/synapse/app/generic_worker.py
+++ b/synapse/app/generic_worker.py
@@ -74,6 +74,9 @@ from synapse.storage.databases.main.event_push_actions import (
     EventPushActionsWorkerStore,
 )
 from synapse.storage.databases.main.events_worker import EventsWorkerStore
+from synapse.storage.databases.main.experimental_features import (
+    ExperimentalFeaturesStore,
+)
 from synapse.storage.databases.main.filtering import FilteringWorkerStore
 from synapse.storage.databases.main.keys import KeyStore
 from synapse.storage.databases.main.lock import LockStore
@@ -155,6 +158,7 @@ class GenericWorkerStore(
     LockStore,
     SessionStore,
     TaskSchedulerWorkerStore,
+    ExperimentalFeaturesStore,
 ):
     # Properties that multiple storage classes define. Tell mypy what the
     # expected type is.
diff --git a/synapse/rest/client/versions.py b/synapse/rest/client/versions.py
index 84cf388bd4..75df684416 100644
--- a/synapse/rest/client/versions.py
+++ b/synapse/rest/client/versions.py
@@ -66,7 +66,12 @@ class VersionsRestServlet(RestServlet):
         msc3881_enabled = self.config.experimental.msc3881_enabled
 
         if self.auth.has_access_token(request):
-            requester = await self.auth.get_user_by_req(request)
+            requester = await self.auth.get_user_by_req(
+                request,
+                allow_guest=True,
+                allow_locked=True,
+                allow_expired=True,
+            )
             user_id = requester.user.to_string()
 
             msc3881_enabled = await self.store.is_feature_enabled(