mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-24 10:35:46 +03:00
Remove incorrect attestations
This commit is contained in:
parent
d8dde19f04
commit
195abfe7a5
2 changed files with 19 additions and 0 deletions
|
@ -139,6 +139,7 @@ class GroupAttestionRenewer(object):
|
||||||
"Incorrectly trying to do attestations for user: %r in %r",
|
"Incorrectly trying to do attestations for user: %r in %r",
|
||||||
user_id, group_id,
|
user_id, group_id,
|
||||||
)
|
)
|
||||||
|
yield self.store.remove_attestation_renewal(group_id, user_id)
|
||||||
return
|
return
|
||||||
|
|
||||||
yield self.transport_client.renew_group_attestation(
|
yield self.transport_client.renew_group_attestation(
|
||||||
|
|
|
@ -1086,6 +1086,24 @@ class GroupServerStore(SQLBaseStore):
|
||||||
desc="update_remote_attestion",
|
desc="update_remote_attestion",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def remove_attestation_renewal(self, group_id, user_id):
|
||||||
|
"""Remove an attestation that we thought we should renew, but actually
|
||||||
|
shouldn't. Ideally this would never get called as we would never
|
||||||
|
incorrectly try and do attestations for local users on local groups.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
group_id (str)
|
||||||
|
user_id (str)
|
||||||
|
"""
|
||||||
|
return self._simple_update_one(
|
||||||
|
table="_simple_delete",
|
||||||
|
keyvalues={
|
||||||
|
"group_id": group_id,
|
||||||
|
"user_id": user_id,
|
||||||
|
},
|
||||||
|
desc="remove_attestation_renewal",
|
||||||
|
)
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def get_remote_attestation(self, group_id, user_id):
|
def get_remote_attestation(self, group_id, user_id):
|
||||||
"""Get the attestation that proves the remote agrees that the user is
|
"""Get the attestation that proves the remote agrees that the user is
|
||||||
|
|
Loading…
Reference in a new issue