fix: immediately fail jobs with invalid signature

This commit is contained in:
ThatOneCalculator 2023-07-03 10:29:52 -07:00
parent 53dedadc58
commit e603745f97
No known key found for this signature in database
GPG key ID: 8703CACD01000000

View file

@ -35,8 +35,11 @@ export default async (job: Bull.Job<InboxJobData>): Promise<string> => {
info["@context"] = undefined; info["@context"] = undefined;
logger.debug(JSON.stringify(info, null, 2)); logger.debug(JSON.stringify(info, null, 2));
if (!signature?.keyId) return `Invalid signature: ${signature}`; if (!signature?.keyId) {
const err = `Invalid signature: ${signature}`;
job.moveToFailed({message: err});
return err;
}
//#endregion //#endregion
const host = toPuny(new URL(signature.keyId).hostname); const host = toPuny(new URL(signature.keyId).hostname);