mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 13:46:02 -04:00
Pass through room version to event auth
This commit is contained in:
parent
b6dce9b9fd
commit
ae2a957dba
10 changed files with 69 additions and 27 deletions
|
@ -16,6 +16,7 @@
|
|||
import unittest
|
||||
|
||||
from synapse import event_auth
|
||||
from synapse.api.constants import RoomVersions
|
||||
from synapse.api.errors import AuthError
|
||||
from synapse.events import FrozenEvent
|
||||
|
||||
|
@ -35,12 +36,16 @@ class EventAuthTestCase(unittest.TestCase):
|
|||
}
|
||||
|
||||
# creator should be able to send state
|
||||
event_auth.check(_random_state_event(creator), auth_events, do_sig_check=False)
|
||||
event_auth.check(
|
||||
RoomVersions.V1, _random_state_event(creator), auth_events,
|
||||
do_sig_check=False,
|
||||
)
|
||||
|
||||
# joiner should not be able to send state
|
||||
self.assertRaises(
|
||||
AuthError,
|
||||
event_auth.check,
|
||||
RoomVersions.V1,
|
||||
_random_state_event(joiner),
|
||||
auth_events,
|
||||
do_sig_check=False,
|
||||
|
@ -69,13 +74,17 @@ class EventAuthTestCase(unittest.TestCase):
|
|||
self.assertRaises(
|
||||
AuthError,
|
||||
event_auth.check,
|
||||
RoomVersions.V1,
|
||||
_random_state_event(pleb),
|
||||
auth_events,
|
||||
do_sig_check=False,
|
||||
),
|
||||
|
||||
# king should be able to send state
|
||||
event_auth.check(_random_state_event(king), auth_events, do_sig_check=False)
|
||||
event_auth.check(
|
||||
RoomVersions.V1, _random_state_event(king), auth_events,
|
||||
do_sig_check=False,
|
||||
)
|
||||
|
||||
|
||||
# helpers for making events
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue