diff options
author | Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> | 2021-08-17 12:56:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-17 11:56:11 +0100 |
commit | 3bcd525b46678ff228c4275acad47c12974c9a33 (patch) | |
tree | eef582d7b2f39c83757b90514f820acc5f3d2f62 /synapse/storage/databases/main | |
parent | update links to schema doc (#10620) (diff) | |
download | synapse-3bcd525b46678ff228c4275acad47c12974c9a33.tar.xz |
Allow to edit `external_ids` by Edit User admin API (#10598)
Signed-off-by: Dirk Klimpel dirk@klimpel.org
Diffstat (limited to 'synapse/storage/databases/main')
-rw-r--r-- | synapse/storage/databases/main/registration.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/synapse/storage/databases/main/registration.py b/synapse/storage/databases/main/registration.py index 14670c2881..c67bea81c6 100644 --- a/synapse/storage/databases/main/registration.py +++ b/synapse/storage/databases/main/registration.py @@ -599,6 +599,28 @@ class RegistrationWorkerStore(CacheInvalidationWorkerStore): desc="record_user_external_id", ) + async def remove_user_external_id( + self, auth_provider: str, external_id: str, user_id: str + ) -> None: + """Remove a mapping from an external user id to a mxid + + If the mapping is not found, this method does nothing. + + Args: + auth_provider: identifier for the remote auth provider + external_id: id on that system + user_id: complete mxid that it is mapped to + """ + await self.db_pool.simple_delete( + table="user_external_ids", + keyvalues={ + "auth_provider": auth_provider, + "external_id": external_id, + "user_id": user_id, + }, + desc="remove_user_external_id", + ) + async def get_user_by_external_id( self, auth_provider: str, external_id: str ) -> Optional[str]: |