Apply blocked instance to LD-Signature host (#6355)

This commit is contained in:
MeiMei 2020-05-15 20:50:28 +09:00 committed by GitHub
parent 2170c27b62
commit c5dd9439d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -90,6 +90,12 @@ export default async (job: Bull.Job<InboxJobData>): Promise<string> => {
if (authUser.user.uri !== activity.actor) { if (authUser.user.uri !== activity.actor) {
return `skip: LD-Signature user(${authUser.user.uri}) !== activity.actor(${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 { } else {
throw `skip: http-signature verification failed.`; throw `skip: http-signature verification failed.`;
} }