AP Actorの修正 (#7573)

* AP Actorの修正

* Add ActivityPub test

* Fix person

* Test

* ap test

* Revert "Test"

This reverts commit 3c493eff4e89f94fd33f25189ba3bc96ef4366b3.

* Test comment

* fix

* fix

* Update inbox

* indent

* nl

* indent

* TODO

* Fix inbox

* Update test
This commit is contained in:
MeiMei
2021-07-10 23:14:57 +09:00
committed by GitHub
parent cb42f94d9c
commit 1772af9583
7 changed files with 169 additions and 70 deletions

View File

@@ -65,6 +65,11 @@ export default async (job: Bull.Job<InboxJobData>): Promise<string> => {
return `skip: failed to resolve user`;
}
// publicKey がなくても終了
if (authUser.key == null) {
return `skip: failed to resolve user publicKey`;
}
// HTTP-Signatureの検証
const httpSignatureValidated = httpSignature.verifySignature(signature, authUser.key.keyPem);
@@ -89,6 +94,10 @@ export default async (job: Bull.Job<InboxJobData>): Promise<string> => {
return `skip: LD-Signatureのユーザーが取得できませんでした`;
}
if (authUser.key == null) {
return `skip: LD-SignatureのユーザーはpublicKeyを持っていませんでした`;
}
// LD-Signature検証
const ldSignature = new LdSignature();
const verified = await ldSignature.verifyRsaSignature2017(activity, authUser.key.keyPem).catch(() => false);