From c5dd9439d5a02d0ec021104ec647f25ad1cba8d2 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Fri, 15 May 2020 20:50:28 +0900 Subject: [PATCH] Apply blocked instance to LD-Signature host (#6355) --- src/queue/processors/inbox.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/queue/processors/inbox.ts b/src/queue/processors/inbox.ts index 3a0bdbe28a..e0419cad28 100644 --- a/src/queue/processors/inbox.ts +++ b/src/queue/processors/inbox.ts @@ -90,6 +90,12 @@ export default async (job: Bull.Job): Promise => { if (authUser.user.uri !== activity.actor) { return `skip: LD-Signature user(${authUser.user.uri}) !== activity.actor(${activity.actor})`; } + + // ブロックしてたら中断 + const ldHost = extractDbHost(authUser.user.uri); + if (meta.blockedHosts.includes(ldHost)) { + return `Blocked request: ${ldHost}`; + } } else { throw `skip: http-signature verification failed.`; }