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

Commit

Permalink
Remove support for unstable MSC3882
Browse files Browse the repository at this point in the history
  • Loading branch information
hughns committed May 25, 2023
1 parent 77a6ee6 commit 7ed8983
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 42 deletions.
1 change: 1 addition & 0 deletions changelog.d/15670.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove support for unstable revisions of [MSC3882](https://github.com/matrix-org/matrix-spec-proposals/pull/3882).
6 changes: 0 additions & 6 deletions synapse/rest/client/login_token_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ class LoginTokenRequestServlet(RestServlet):
*client_patterns(
"/login/get_token$", releases=["v1"], v1=False, unstable=False
),
# TODO: this is no longer needed once unstable MSC3882 does not need to be supported:
*client_patterns(
"/org.matrix.msc3882/login/token$", releases=[], v1=False, unstable=True
),
]

def __init__(self, hs: "HomeServer"):
Expand Down Expand Up @@ -101,8 +97,6 @@ async def on_POST(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
200,
{
"login_token": login_token,
# TODO: this is no longer needed once unstable MSC3882 does not need to be supported:
"expires_in": self.token_timeout // 1000,
"expires_in_ms": self.token_timeout,
},
)
Expand Down
2 changes: 0 additions & 2 deletions synapse/rest/client/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ def on_GET(self, request: Request) -> Tuple[int, JsonDict]:
"fi.mau.msc2815": self.config.experimental.msc2815_enabled,
# Adds a ping endpoint for appservices to check HS->AS connection
"fi.mau.msc2659.stable": True, # TODO: remove when "v1.7" is added above
# TODO: this is no longer needed once unstable MSC3882 does not need to be supported:
"org.matrix.msc3882": self.config.auth.login_via_existing_enabled,
# Adds support for remotely enabling/disabling pushers, as per MSC3881
"org.matrix.msc3881": self.config.experimental.msc3881_enabled,
# Adds support for filtering /messages by event relation.
Expand Down
34 changes: 0 additions & 34 deletions tests/rest/client/test_login_token_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,37 +132,3 @@ def test_expires_in(self) -> None:
channel = self.make_request("POST", GET_TOKEN_ENDPOINT, {}, access_token=token)
self.assertEqual(channel.code, 200)
self.assertEqual(channel.json_body["expires_in_ms"], 15000)

@override_config(
{
"login_via_existing_session": {
"enabled": True,
"require_ui_auth": False,
"token_timeout": "15s",
}
}
)
def test_unstable_support(self) -> None:
# TODO: remove support for unstable MSC3882 is no longer needed

# check feature is advertised in versions response:
channel = self.make_request(
"GET", "/_matrix/client/versions", {}, access_token=None
)
self.assertEqual(channel.code, 200)
self.assertEqual(
channel.json_body["unstable_features"]["org.matrix.msc3882"], True
)

self.register_user(self.user, self.password)
token = self.login(self.user, self.password)

# check feature is available via the unstable endpoint and returns an expires_in value in seconds
channel = self.make_request(
"POST",
"/_matrix/client/unstable/org.matrix.msc3882/login/token",
{},
access_token=token,
)
self.assertEqual(channel.code, 200)
self.assertEqual(channel.json_body["expires_in"], 15)

0 comments on commit 7ed8983

Please sign in to comment.