comparison sat/plugins/plugin_comp_ap_gateway/http_server.py @ 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 cd0943ceb326
comparison
equal deleted inserted replaced
3982:74f7c10a48bc 3983:31c3d6652115
1037 http.BAD_REQUEST, 1037 http.BAD_REQUEST,
1038 f"invalid json in inbox request: {e}" 1038 f"invalid json in inbox request: {e}"
1039 ) 1039 )
1040 request.finish() 1040 request.finish()
1041 return 1041 return
1042 try:
1043 if data["type"] == "Delete" and data["actor"] == data["object"]:
1044 # we don't handle actor deletion
1045 request.setResponseCode(http.ACCEPTED)
1046 log.debug(f"ignoring actor deletion ({data['actor']})")
1047 # TODO: clean data in cache coming from this actor, maybe with a tombstone
1048 request.finish()
1049 return
1050 except KeyError:
1051 pass
1052
1042 try: 1053 try:
1043 signing_actor = await self.checkSignature(request) 1054 signing_actor = await self.checkSignature(request)
1044 except exceptions.EncryptionError as e: 1055 except exceptions.EncryptionError as e:
1045 self.responseCode( 1056 self.responseCode(
1046 request, 1057 request,