mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 14:03:54 +01:00
Fix /versions
requests (#17410)
We need it to work on workers and allow guest access. Broke by #17392
This commit is contained in:
parent
1353fb3347
commit
0ed1c64c83
3 changed files with 11 additions and 1 deletions
1
changelog.d/17410.misc
Normal file
1
changelog.d/17410.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Finish up work to allow per-user feature flags.
|
|
@ -74,6 +74,9 @@ from synapse.storage.databases.main.event_push_actions import (
|
||||||
EventPushActionsWorkerStore,
|
EventPushActionsWorkerStore,
|
||||||
)
|
)
|
||||||
from synapse.storage.databases.main.events_worker import EventsWorkerStore
|
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.filtering import FilteringWorkerStore
|
||||||
from synapse.storage.databases.main.keys import KeyStore
|
from synapse.storage.databases.main.keys import KeyStore
|
||||||
from synapse.storage.databases.main.lock import LockStore
|
from synapse.storage.databases.main.lock import LockStore
|
||||||
|
@ -155,6 +158,7 @@ class GenericWorkerStore(
|
||||||
LockStore,
|
LockStore,
|
||||||
SessionStore,
|
SessionStore,
|
||||||
TaskSchedulerWorkerStore,
|
TaskSchedulerWorkerStore,
|
||||||
|
ExperimentalFeaturesStore,
|
||||||
):
|
):
|
||||||
# Properties that multiple storage classes define. Tell mypy what the
|
# Properties that multiple storage classes define. Tell mypy what the
|
||||||
# expected type is.
|
# expected type is.
|
||||||
|
|
|
@ -66,7 +66,12 @@ class VersionsRestServlet(RestServlet):
|
||||||
msc3881_enabled = self.config.experimental.msc3881_enabled
|
msc3881_enabled = self.config.experimental.msc3881_enabled
|
||||||
|
|
||||||
if self.auth.has_access_token(request):
|
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()
|
user_id = requester.user.to_string()
|
||||||
|
|
||||||
msc3881_enabled = await self.store.is_feature_enabled(
|
msc3881_enabled = await self.store.is_feature_enabled(
|
||||||
|
|
Loading…
Reference in a new issue