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

Commit 7cebaf9

Browse files
H-Shayreivilibre
andauthored
Remove code invalidated by deprecated config flag 'trust_identity_servers_for_password_resets' (#11395)
* remove background update code related to deprecated config flag * changelog entry * update changelog * Delete 11394.removal Duplicate, wrong number * add no-op background update and change newfragment so it will be consolidated with associated work * remove unused code * Remove code associated with deprecated flag from legacy docker dynamic config file Co-authored-by: reivilibre <oliverw@matrix.org>
1 parent 454c3d7 commit 7cebaf9

File tree

4 files changed

+4
-41
lines changed

4 files changed

+4
-41
lines changed

changelog.d/11395.removal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove deprecated `trust_identity_server_for_password_resets` configuration flag.

docker/conf/homeserver.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,6 @@ bcrypt_rounds: 12
148148
allow_guest_access: {{ "True" if SYNAPSE_ALLOW_GUEST else "False" }}
149149
enable_group_creation: true
150150

151-
# The list of identity servers trusted to verify third party
152-
# identifiers by this server.
153-
#
154-
# Also defines the ID server which will be called when an account is
155-
# deactivated (one will be picked arbitrarily).
156-
trusted_third_party_id_servers:
157-
- matrix.org
158-
- vector.im
159151

160152
## Metrics ###
161153

synapse/storage/databases/main/registration.py

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,11 +1728,11 @@ def __init__(
17281728
)
17291729

17301730
self.db_pool.updates.register_background_update_handler(
1731-
"user_threepids_grandfather", self._bg_user_threepids_grandfather
1731+
"users_set_deactivated_flag", self._background_update_set_deactivated_flag
17321732
)
17331733

1734-
self.db_pool.updates.register_background_update_handler(
1735-
"users_set_deactivated_flag", self._background_update_set_deactivated_flag
1734+
self.db_pool.updates.register_noop_background_update(
1735+
"user_threepids_grandfather"
17361736
)
17371737

17381738
self.db_pool.updates.register_background_index_update(
@@ -1805,35 +1805,6 @@ def _background_update_set_deactivated_flag_txn(txn):
18051805

18061806
return nb_processed
18071807

1808-
async def _bg_user_threepids_grandfather(self, progress, batch_size):
1809-
"""We now track which identity servers a user binds their 3PID to, so
1810-
we need to handle the case of existing bindings where we didn't track
1811-
this.
1812-
1813-
We do this by grandfathering in existing user threepids assuming that
1814-
they used one of the server configured trusted identity servers.
1815-
"""
1816-
id_servers = set(self.config.registration.trusted_third_party_id_servers)
1817-
1818-
def _bg_user_threepids_grandfather_txn(txn):
1819-
sql = """
1820-
INSERT INTO user_threepid_id_server
1821-
(user_id, medium, address, id_server)
1822-
SELECT user_id, medium, address, ?
1823-
FROM user_threepids
1824-
"""
1825-
1826-
txn.execute_batch(sql, [(id_server,) for id_server in id_servers])
1827-
1828-
if id_servers:
1829-
await self.db_pool.runInteraction(
1830-
"_bg_user_threepids_grandfather", _bg_user_threepids_grandfather_txn
1831-
)
1832-
1833-
await self.db_pool.updates._end_background_update("user_threepids_grandfather")
1834-
1835-
return 1
1836-
18371808
async def set_user_deactivated_status(
18381809
self, user_id: str, deactivated: bool
18391810
) -> None:

tests/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ def default_config(name, parse=False):
119119
"enable_registration": True,
120120
"enable_registration_captcha": False,
121121
"macaroon_secret_key": "not even a little secret",
122-
"trusted_third_party_id_servers": [],
123122
"password_providers": [],
124123
"worker_replication_url": "",
125124
"worker_app": None,

0 commit comments

Comments
 (0)