Prune one time keys based on reasonable configured limit.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk committed 2025-09-11 04:27:33 +00:00
1 parent 19dc5fafd4
commit 11eeca7e01
4 files changed
+52 -1

No files matched your search

+5 -1
View File
@@ -40,7 +40,11 @@ pub(crate) async fn upload_keys_route(
) -> Result<upload_keys::v3::Response> {
let (sender_user, sender_device) = body.sender();
for (key_id, one_time_key) in &body.one_time_keys {
for (key_id, one_time_key) in body
.one_time_keys
.iter()
.take(services.config.one_time_key_limit)
{
if one_time_key
.deserialize()
.inspect_err(|e| {