Skip to content

Commit

Permalink
Apply blocked instance to LD-Signature host
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed May 14, 2020
1 parent c47dac6 commit d05d247
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/queue/processors/inbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.`;
}
Expand Down

0 comments on commit d05d247

Please sign in to comment.