From faf5e43527f9414754ac2b9b5b0b0247daa065d2 Mon Sep 17 00:00:00 2001 From: Goffi Date: Tue, 15 Nov 2022 18:15:16 +0100 Subject: [PATCH] component AP gateway: ignore actor delection notifications: When a `Delete` activity was received and the object was the emitting actor itself, the signature checking was failing if the actor was unknown (due to the impossibility to retrieve the actor public key, as it is no more accessible). To avoid that, those notifications are ignored for now. In the future they should clean the cache linked to this actor. --- sat/plugins/plugin_comp_ap_gateway/http_server.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sat/plugins/plugin_comp_ap_gateway/http_server.py b/sat/plugins/plugin_comp_ap_gateway/http_server.py index 2899d54f..5c891b16 100644 --- a/sat/plugins/plugin_comp_ap_gateway/http_server.py +++ b/sat/plugins/plugin_comp_ap_gateway/http_server.py @@ -1039,6 +1039,17 @@ class HTTPAPGServer(web_resource.Resource): ) request.finish() return + try: + if data["type"] == "Delete" and data["actor"] == data["object"]: + # we don't handle actor deletion + request.setResponseCode(http.ACCEPTED) + log.debug(f"ignoring actor deletion ({data['actor']})") + # TODO: clean data in cache coming from this actor, maybe with a tombstone + request.finish() + return + except KeyError: + pass + try: signing_actor = await self.checkSignature(request) except exceptions.EncryptionError as e: