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

Add support for /_matrix/client/v3 APIs #11318

Merged
merged 2 commits into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all 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/11318.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for the `/_matrix/client/v3` APIs from Matrix v1.1.
1 change: 1 addition & 0 deletions synapse/app/homeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def _configure_named_resource(
{
"/_matrix/client/api/v1": client_resource,
"/_matrix/client/r0": client_resource,
"/_matrix/client/v3": client_resource,
"/_matrix/client/unstable": client_resource,
"/_matrix/client/v2_alpha": client_resource,
"/_matrix/client/versions": client_resource,
Expand Down
4 changes: 2 additions & 2 deletions synapse/rest/client/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

def client_patterns(
path_regex: str,
releases: Iterable[int] = (0,),
releases: Iterable[str] = ("r0", "v3"),
unstable: bool = True,
v1: bool = False,
) -> Iterable[Pattern]:
Expand All @@ -52,7 +52,7 @@ def client_patterns(
v1_prefix = CLIENT_API_PREFIX + "/api/v1"
patterns.append(re.compile("^" + v1_prefix + path_regex))
for release in releases:
new_prefix = CLIENT_API_PREFIX + "/r%d" % (release,)
new_prefix = CLIENT_API_PREFIX + f"/{release}"
patterns.append(re.compile("^" + new_prefix + path_regex))

return patterns
Expand Down
2 changes: 1 addition & 1 deletion synapse/rest/client/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class SigningKeyUploadServlet(RestServlet):
}
"""

PATTERNS = client_patterns("/keys/device_signing/upload$", releases=())
PATTERNS = client_patterns("/keys/device_signing/upload$", releases=("v3",))

def __init__(self, hs: "HomeServer"):
super().__init__()
Expand Down