Remove the experimental flag for knocking and use stable prefixes / endpoints. (#10167)

* Room version 7 for knocking.
* Stable prefixes and endpoints (both client and federation) for knocking.
* Removes the experimental configuration flag.
This commit is contained in:
Patrick Cloke 2021-06-15 07:45:14 -04:00 committed by GitHub
parent aac2c49b9b
commit 9e5ab6dd58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 33 additions and 96 deletions

View file

@ -25,9 +25,6 @@ from synapse.types import RoomAlias
from tests.test_utils import event_injection
from tests.unittest import FederatingHomeserverTestCase, TestCase, override_config
# An identifier to use while MSC2304 is not in a stable release of the spec
KNOCK_UNSTABLE_IDENTIFIER = "xyz.amorgan.knock"
class KnockingStrippedStateEventHelperMixin(TestCase):
def send_example_state_events_to_room(
@ -61,7 +58,7 @@ class KnockingStrippedStateEventHelperMixin(TestCase):
self.get_success(
event_injection.inject_event(
hs,
room_version=RoomVersions.MSC2403.identifier,
room_version=RoomVersions.V7.identifier,
room_id=room_id,
sender=sender,
type="com.example.secret",
@ -121,7 +118,7 @@ class KnockingStrippedStateEventHelperMixin(TestCase):
self.get_success(
event_injection.inject_event(
hs,
room_version=RoomVersions.MSC2403.identifier,
room_version=RoomVersions.V7.identifier,
room_id=room_id,
sender=sender,
type=event_type,
@ -135,7 +132,7 @@ class KnockingStrippedStateEventHelperMixin(TestCase):
room_state[EventTypes.Create] = {
"content": {
"creator": sender,
"room_version": RoomVersions.MSC2403.identifier,
"room_version": RoomVersions.V7.identifier,
},
"state_key": "",
}
@ -232,7 +229,7 @@ class FederationKnockingTestCase(
room_id = self.helper.create_room_as(
"u1",
is_public=False,
room_version=RoomVersions.MSC2403.identifier,
room_version=RoomVersions.V7.identifier,
tok=user_token,
)
@ -243,14 +240,13 @@ class FederationKnockingTestCase(
channel = self.make_request(
"GET",
"/_matrix/federation/unstable/%s/make_knock/%s/%s?ver=%s"
"/_matrix/federation/v1/make_knock/%s/%s?ver=%s"
% (
KNOCK_UNSTABLE_IDENTIFIER,
room_id,
fake_knocking_user_id,
# Inform the remote that we support the room version of the room we're
# knocking on
RoomVersions.MSC2403.identifier,
RoomVersions.V7.identifier,
),
)
self.assertEquals(200, channel.code, channel.result)
@ -275,7 +271,7 @@ class FederationKnockingTestCase(
self.clock,
self.hs.hostname,
self.hs.signing_key,
room_version=RoomVersions.MSC2403,
room_version=RoomVersions.V7,
event_dict=knock_event,
)
@ -287,8 +283,8 @@ class FederationKnockingTestCase(
# Send the signed knock event into the room
channel = self.make_request(
"PUT",
"/_matrix/federation/unstable/%s/send_knock/%s/%s"
% (KNOCK_UNSTABLE_IDENTIFIER, room_id, signed_knock_event.event_id),
"/_matrix/federation/v1/send_knock/%s/%s"
% (room_id, signed_knock_event.event_id),
signed_knock_event_json,
)
self.assertEquals(200, channel.code, channel.result)