MatrixSynapse/tests
Grant McLean 5c24d7b9eb
Check required power levels earlier in createRoom handler. (#15695)
* Check required power levels earlier in createRoom handler.

- If a server was configured to reject the creation of rooms with E2EE
  enabled (by specifying an unattainably high power level for
  "m.room.encryption" in default_power_level_content_override), the 403
  error was not being triggered until after the room was created and
  before the "m.room.power_levels" was sent.  This allowed a user to
  access the partially-configured room and complete the setup of E2EE
  and power levels manually.

- This change causes the power level overrides to be checked earlier and
  the request to be rejected before the user gains access to the room.

- A new `_validate_room_config` method is added to contain checks that
  should be run before a room is created.

- The new test case confirms that a user request is rejected by the new
  validation method.

Signed-off-by: Grant McLean <grant@catalyst.net.nz>

* Add a changelog file.

* Formatting fix for black.

* Remove unneeded line from test.

---------

Signed-off-by: Grant McLean <grant@catalyst.net.nz>
2023-06-07 16:21:25 +01:00
..
api `N + 3`: Read from column `full_user_id` rather than `user_id` of tables `profiles` and `user_filters` (#15649) 2023-06-02 17:24:13 -07:00
app Merge branch 'master' into develop 2023-05-26 17:16:15 +01:00
appservice Improve type hints for cached decorator. (#15658) 2023-05-24 12:59:31 +00:00
config Implement stable support for MSC3882 to allow an existing device/session to generate a login token for use on a new device/session (#15388) 2023-06-01 08:52:51 -04:00
crypto
events Properly parse event_fields in filters (#15607) 2023-05-22 11:31:22 -04:00
federation Rename blacklist/whitelist internally. (#15620) 2023-05-19 12:25:25 +00:00
handlers `N + 3`: Read from column `full_user_id` rather than `user_id` of tables `profiles` and `user_filters` (#15649) 2023-06-02 17:24:13 -07:00
http Rename blacklist/whitelist internally. (#15620) 2023-05-19 12:25:25 +00:00
logging Trace functions which return `Awaitable` (#15650) 2023-06-06 17:39:22 -05:00
media Add stubs package for lxml. (#15697) 2023-05-31 17:06:57 +00:00
metrics
module_api `N + 3`: Read from column `full_user_id` rather than `user_id` of tables `profiles` and `user_filters` (#15649) 2023-06-02 17:24:13 -07:00
push Stabilize support for MSC3952: Intentional mentions. (#15520) 2023-06-06 09:11:07 +01:00
replication Merge branch 'master' into develop 2023-05-26 17:16:15 +01:00
rest Check required power levels earlier in createRoom handler. (#15695) 2023-06-07 16:21:25 +01:00
scripts
server_notices
state
storage `N + 3`: Read from column `full_user_id` rather than `user_id` of tables `profiles` and `user_filters` (#15649) 2023-06-02 17:24:13 -07:00
test_utils Log when events are (unexpectedly) filtered out of responses in tests (#14213) 2023-06-01 21:27:18 -05:00
types
util Add type hints to test_descriptors. (#15659) 2023-05-24 14:18:52 +00:00
__init__.py
server.py Add stricter mypy options (#15694) 2023-05-31 07:18:29 -04:00
test_distributor.py
test_event_auth.py
test_federation.py
test_mau.py
test_phone_home.py
test_rust.py
test_server.py
test_state.py Make the api.auth.Auth a Protocol 2023-05-30 09:43:06 -04:00
test_terms_auth.py
test_test_utils.py
test_types.py
test_visibility.py
unittest.py Limit the size of the `HomeServerConfig` cache in trial test runs (#15646) 2023-05-22 13:25:39 +01:00
utils.py