In order to verify the signature, we need to have the signature.

This commit is contained in:
Andrew Pietila 2023-04-11 23:24:37 -05:00
parent 35c029b124
commit 340244cdab

View file

@ -35,7 +35,7 @@ module.exports = {
}
}).join('\n');
// ... then lets dump this in the queue for now.
await db("queue").insert({task: "verify_inbox", data: JSON.stringify({signed_block, body: req.body, date: (new Date()).toISOString()})});
await db("queue").insert({task: "verify_inbox", data: JSON.stringify({sig_header: req.header("signature"), signed_block, body: req.body, date: (new Date()).toISOString()})});
res.status(204);
return res.end();
}
@ -44,7 +44,7 @@ module.exports = {
if ( !take_at_face_value ) {
// 2. If the signature is not valid, or non-existant, then we fetch the resource manually.
var bodyParsed = await jsonld.compact(req.body, 'https://www.w3.org/ns/activitystreams');
await db("queue").insert({task: "fetch_object", data: JSON.stringify({id: bodyParsed.id})});
await db("queue").insert({task: "fetch_object", data: bodyParsed.id});
res.status(204);
return res.end();
}