diff options
author | David Robertson <davidr@element.io> | 2023-10-30 14:34:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-30 14:34:37 +0000 |
commit | fdce83ee60b3b5ffd0c41d112873a4de52b1e640 (patch) | |
tree | f25decfeeb127373476ec32798cea295b12506b2 /synapse/handlers | |
parent | Bump setuptools-rust from 1.7.0 to 1.8.0 (#16574) (diff) | |
download | synapse-fdce83ee60b3b5ffd0c41d112873a4de52b1e640.tar.xz |
Claim fallback keys in bulk (#16570)
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/e2e_keys.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/handlers/e2e_keys.py b/synapse/handlers/e2e_keys.py index 8c6432035d..91c5fe007d 100644 --- a/synapse/handlers/e2e_keys.py +++ b/synapse/handlers/e2e_keys.py @@ -659,6 +659,20 @@ class E2eKeysHandler: timeout: Optional[int], always_include_fallback_keys: bool, ) -> JsonDict: + """ + Args: + query: A chain of maps from (user_id, device_id, algorithm) to the requested + number of keys to claim. + user: The user who is claiming these keys. + timeout: How long to wait for any federation key claim requests before + giving up. + always_include_fallback_keys: always include a fallback key for local users' + devices, even if we managed to claim a one-time-key. + + Returns: a heterogeneous dict with two keys: + one_time_keys: chain of maps user ID -> device ID -> key ID -> key. + failures: map from remote destination to a JsonDict describing the error. + """ local_query: List[Tuple[str, str, str, int]] = [] remote_queries: Dict[str, Dict[str, Dict[str, Dict[str, int]]]] = {} |