From a265fbd397ae72b2d3ea4c9310591ff1d0f3e05c Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Wed, 1 Dec 2021 07:25:58 -0500 Subject: [PATCH] Register the login redirect endpoint for v3. (#11451) As specified for Matrix v1.1. --- changelog.d/11451.bugfix | 1 + synapse/rest/client/login.py | 2 +- synapse/rest/client/room.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 changelog.d/11451.bugfix diff --git a/changelog.d/11451.bugfix b/changelog.d/11451.bugfix new file mode 100644 index 000000000..960714d0f --- /dev/null +++ b/changelog.d/11451.bugfix @@ -0,0 +1 @@ +Add support for the `/_matrix/client/v3/login/sso/redirect/{idpId}` API from Matrix v1.1. This endpoint was overlooked when support for v3 endpoints was added in v1.48.0rc1. diff --git a/synapse/rest/client/login.py b/synapse/rest/client/login.py index 09f378f91..a66ee4fb3 100644 --- a/synapse/rest/client/login.py +++ b/synapse/rest/client/login.py @@ -513,7 +513,7 @@ class SsoRedirectServlet(RestServlet): re.compile( "^" + CLIENT_API_PREFIX - + "/r0/login/sso/redirect/(?P[A-Za-z0-9_.~-]+)$" + + "/(r0|v3)/login/sso/redirect/(?P[A-Za-z0-9_.~-]+)$" ) ] diff --git a/synapse/rest/client/room.py b/synapse/rest/client/room.py index 73d0f7c95..99f303c88 100644 --- a/synapse/rest/client/room.py +++ b/synapse/rest/client/room.py @@ -1138,12 +1138,12 @@ class RoomSpaceSummaryRestServlet(RestServlet): class RoomHierarchyRestServlet(RestServlet): - PATTERNS = [ + PATTERNS = ( re.compile( "^/_matrix/client/(v1|unstable/org.matrix.msc2946)" "/rooms/(?P[^/]*)/hierarchy$" ), - ] + ) def __init__(self, hs: "HomeServer"): super().__init__()