changeset 3983:31c3d6652115

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.
author Goffi <goffi@goffi.org>
date Tue, 15 Nov 2022 18:15:16 +0100
parents 74f7c10a48bc
children 425d809a505b
files sat/plugins/plugin_comp_ap_gateway/http_server.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sat/plugins/plugin_comp_ap_gateway/http_server.py	Tue Nov 15 18:10:33 2022 +0100
+++ b/sat/plugins/plugin_comp_ap_gateway/http_server.py	Tue Nov 15 18:15:16 2022 +0100
@@ -1040,6 +1040,17 @@
             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:
             self.responseCode(