From 76351ae1e9fd40885a263201e703916b7d35e58e Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 8 Jul 2024 11:12:11 +0100 Subject: [PATCH 1/2] Fix /versions requests We need it to work on workers and allow guest access. --- synapse/app/generic_worker.py | 4 ++++ synapse/rest/client/versions.py | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/synapse/app/generic_worker.py b/synapse/app/generic_worker.py index 599f95466b9..248622fa922 100644 --- a/synapse/app/generic_worker.py +++ b/synapse/app/generic_worker.py @@ -74,6 +74,9 @@ 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 e01e5f542a6..a88f1f171a9 100644 --- a/synapse/rest/client/versions.py +++ b/synapse/rest/client/versions.py @@ -66,7 +66,12 @@ async def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]: 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( From 061566d7e0c5b7ded0b3da66945966a8b5131ce6 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 8 Jul 2024 11:14:31 +0100 Subject: [PATCH 2/2] Newsfile --- changelog.d/17410.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/17410.misc diff --git a/changelog.d/17410.misc b/changelog.d/17410.misc new file mode 100644 index 00000000000..76e3976e28f --- /dev/null +++ b/changelog.d/17410.misc @@ -0,0 +1 @@ +Finish up work to allow per-user feature flags.