From e08ec7a723724c247d9bbcdbf157da08d3ba31a7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 6 May 2022 15:11:54 +0200 Subject: Handle HTTP signature draft 11 --- server/tests/api/activitypub/security.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'server/tests/api/activitypub/security.ts') diff --git a/server/tests/api/activitypub/security.ts b/server/tests/api/activitypub/security.ts index a070517b8..95e2aebb4 100644 --- a/server/tests/api/activitypub/security.ts +++ b/server/tests/api/activitypub/security.ts @@ -147,6 +147,17 @@ describe('Test ActivityPub security', function () { } }) + it('Should succeed with a valid HTTP signature draft 11 (without date but with (created))', async function () { + const body = activityPubContextify(getAnnounceWithoutContext(servers[1]), 'Announce') + const headers = buildGlobalHeaders(body) + + const signatureOptions = baseHttpSignature() + signatureOptions.headers = [ '(request-target)', '(created)', 'host', 'digest' ] + + const { statusCode } = await makePOSTAPRequest(url, body, signatureOptions, headers) + expect(statusCode).to.equal(HttpStatusCode.NO_CONTENT_204) + }) + it('Should succeed with a valid HTTP signature', async function () { const body = activityPubContextify(getAnnounceWithoutContext(servers[1]), 'Announce') const headers = buildGlobalHeaders(body) -- cgit v1.2.3