mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-16 07:00:18 -04:00
Strip "join_authorised_via_users_server" from join events which do not need it. (#10933)
This fixes a "Event not signed by authorising server" error when transition room member from join -> join, e.g. when updating a display name or avatar URL for restricted rooms.
This commit is contained in:
parent
3412f5c8d8
commit
32072dcdac
11 changed files with 46 additions and 25 deletions
|
@ -16,6 +16,7 @@ import unittest
|
|||
from typing import Optional
|
||||
|
||||
from synapse import event_auth
|
||||
from synapse.api.constants import EventContentFields
|
||||
from synapse.api.errors import AuthError
|
||||
from synapse.api.room_versions import RoomVersions
|
||||
from synapse.events import EventBase, make_event_from_dict
|
||||
|
@ -380,7 +381,7 @@ class EventAuthTestCase(unittest.TestCase):
|
|||
authorised_join_event = _join_event(
|
||||
pleb,
|
||||
additional_content={
|
||||
"join_authorised_via_users_server": "@creator:example.com"
|
||||
EventContentFields.AUTHORISING_USER: "@creator:example.com"
|
||||
},
|
||||
)
|
||||
event_auth.check(
|
||||
|
@ -404,7 +405,7 @@ class EventAuthTestCase(unittest.TestCase):
|
|||
_join_event(
|
||||
pleb,
|
||||
additional_content={
|
||||
"join_authorised_via_users_server": "@inviter:foo.test"
|
||||
EventContentFields.AUTHORISING_USER: "@inviter:foo.test"
|
||||
},
|
||||
),
|
||||
pl_auth_events,
|
||||
|
@ -431,7 +432,7 @@ class EventAuthTestCase(unittest.TestCase):
|
|||
_join_event(
|
||||
pleb,
|
||||
additional_content={
|
||||
"join_authorised_via_users_server": "@other:example.com"
|
||||
EventContentFields.AUTHORISING_USER: "@other:example.com"
|
||||
},
|
||||
),
|
||||
auth_events,
|
||||
|
@ -448,7 +449,7 @@ class EventAuthTestCase(unittest.TestCase):
|
|||
"join",
|
||||
sender=creator,
|
||||
additional_content={
|
||||
"join_authorised_via_users_server": "@inviter:foo.test"
|
||||
EventContentFields.AUTHORISING_USER: "@inviter:foo.test"
|
||||
},
|
||||
),
|
||||
auth_events,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue