diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2020-05-15 20:50:28 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-15 20:50:28 +0900 |
| commit | c5dd9439d5a02d0ec021104ec647f25ad1cba8d2 (patch) | |
| tree | 3a88ee21611f7201c95921c19ce0bb3915cfa6ae /src/queue | |
| parent | リレーのHTTP-Signatureは投稿者の鍵でするように (#6357) (diff) | |
| download | sharkey-c5dd9439d5a02d0ec021104ec647f25ad1cba8d2.tar.gz sharkey-c5dd9439d5a02d0ec021104ec647f25ad1cba8d2.tar.bz2 sharkey-c5dd9439d5a02d0ec021104ec647f25ad1cba8d2.zip | |
Apply blocked instance to LD-Signature host (#6355)
Diffstat (limited to 'src/queue')
| -rw-r--r-- | src/queue/processors/inbox.ts | 6 |
1 files changed, 6 insertions, 0 deletions
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<InboxJobData>): Promise<string> => { 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.`; } |