Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Note that /spaces & /hierarchy can be routed to workers #10648

Merged
merged 8 commits into from
Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/10648.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update the documentation to note that the `/spaces` and `/hierarchy` endpoints can be routed to workers.
5 changes: 5 additions & 0 deletions docs/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ This may affect you if you make use of custom HTML templates for the
The template is now provided an `error` variable if the authentication
process failed. See the default templates linked above for an example.

## The spaces summary APIs can now be handled by workers

The [available worker applications documentation](https://matrix-org.github.io/synapse/latest/workers.html#available-worker-applications)
has been updated to reflect that calls to the `/spaces` and `/hierarchy` endpoints
can now go to workers for both clients API and federation requests.

# Upgrading to v1.41.0

Expand Down
4 changes: 4 additions & 0 deletions docs/workers.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ expressions:
^/_matrix/federation/v1/user/devices/
^/_matrix/federation/v1/get_groups_publicised$
^/_matrix/key/v2/query
^/_matrix/federation/unstable/org.matrix.msc2946/spaces/
^/_matrix/federation/unstable/org.matrix.msc2946/hierarchy/

# Inbound federation transaction request
^/_matrix/federation/v1/send/
Expand All @@ -220,6 +222,7 @@ expressions:
^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/context/.*$
^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/members$
^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/state$
^/_matrix/client/unstable/org.matrix.msc2946/rooms/.*/spaces$
^/_matrix/client/(api/v1|r0|unstable)/account/3pid$
^/_matrix/client/(api/v1|r0|unstable)/devices$
^/_matrix/client/(api/v1|r0|unstable)/keys/query$
Expand Down Expand Up @@ -256,6 +259,7 @@ ensure that the purge history admin API is not used while pagination requests
for the room are in flight:

^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/messages$
^/_matrix/client/unstable/org.matrix.msc2946/rooms/.*/hierarchy$
clokep marked this conversation as resolved.
Show resolved Hide resolved

Additionally, the following endpoints should be included if Synapse is configured
to use SSO (you only need to include the ones for whichever SSO provider you're
Expand Down
42 changes: 18 additions & 24 deletions synapse/app/generic_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,36 +69,31 @@
account_data,
events,
groups,
initial_sync,
login,
presence,
profile,
push_rule,
read_marker,
receipts,
room,
room_keys,
sendtodevice,
sync,
tags,
user_directory,
versions,
voip,
)
from synapse.rest.client._base import client_patterns
from synapse.rest.client.account import ThreepidRestServlet
from synapse.rest.client.account_data import AccountDataServlet, RoomAccountDataServlet
from synapse.rest.client.devices import DevicesRestServlet
from synapse.rest.client.initial_sync import InitialSyncRestServlet
from synapse.rest.client.keys import (
KeyChangesServlet,
KeyQueryServlet,
OneTimeKeyServlet,
)
from synapse.rest.client.profile import (
ProfileAvatarURLRestServlet,
ProfileDisplaynameRestServlet,
ProfileRestServlet,
)
from synapse.rest.client.push_rule import PushRuleRestServlet
from synapse.rest.client.register import RegisterRestServlet
from synapse.rest.client.sendtodevice import SendToDeviceRestServlet
from synapse.rest.client.versions import VersionsRestServlet
from synapse.rest.client.voip import VoipRestServlet
from synapse.rest.health import HealthResource
from synapse.rest.key.v2 import KeyApiV2Resource
from synapse.rest.synapse.client import build_synapse_client_resource_tree
Expand Down Expand Up @@ -282,32 +277,31 @@ def _listen_http(self, listener_config: ListenerConfig):
login.register_servlets(self, resource)
ThreepidRestServlet(self).register(resource)
DevicesRestServlet(self).register(resource)

# Read-only
KeyUploadServlet(self).register(resource)
KeyQueryServlet(self).register(resource)
OneTimeKeyServlet(self).register(resource)
KeyChangesServlet(self).register(resource)
VoipRestServlet(self).register(resource)
PushRuleRestServlet(self).register(resource)
VersionsRestServlet(self).register(resource)
OneTimeKeyServlet(self).register(resource)

ProfileAvatarURLRestServlet(self).register(resource)
ProfileDisplaynameRestServlet(self).register(resource)
ProfileRestServlet(self).register(resource)
KeyUploadServlet(self).register(resource)
AccountDataServlet(self).register(resource)
RoomAccountDataServlet(self).register(resource)
voip.register_servlets(self, resource)
push_rule.register_servlets(self, resource)
versions.register_servlets(self, resource)

profile.register_servlets(self, resource)

sync.register_servlets(self, resource)
events.register_servlets(self, resource)
room.register_servlets(self, resource, True)
room.register_servlets(self, resource, is_worker=True)
room.register_deprecated_servlets(self, resource)
InitialSyncRestServlet(self).register(resource)
initial_sync.register_servlets(self, resource)
room_keys.register_servlets(self, resource)
tags.register_servlets(self, resource)
account_data.register_servlets(self, resource)
receipts.register_servlets(self, resource)
read_marker.register_servlets(self, resource)

SendToDeviceRestServlet(self).register(resource)
sendtodevice.register_servlets(self, resource)

user_directory.register_servlets(self, resource)

Expand Down