diff options
author | Chocobozzz <me@florianbigard.com> | 2022-05-06 15:11:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-05-06 15:13:59 +0200 |
commit | e08ec7a723724c247d9bbcdbf157da08d3ba31a7 (patch) | |
tree | bfa3fdc9b3a57a9ac40b8cf900f396c1ccde0215 /server/tests/api | |
parent | 822f50fa814e945d136b8bb5a7e14e3c84889d42 (diff) | |
download | PeerTube-e08ec7a723724c247d9bbcdbf157da08d3ba31a7.tar.gz PeerTube-e08ec7a723724c247d9bbcdbf157da08d3ba31a7.tar.zst PeerTube-e08ec7a723724c247d9bbcdbf157da08d3ba31a7.zip |
Handle HTTP signature draft 11
Diffstat (limited to 'server/tests/api')
-rw-r--r-- | server/tests/api/activitypub/security.ts | 11 |
1 files changed, 11 insertions, 0 deletions
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 () { | |||
147 | } | 147 | } |
148 | }) | 148 | }) |
149 | 149 | ||
150 | it('Should succeed with a valid HTTP signature draft 11 (without date but with (created))', async function () { | ||
151 | const body = activityPubContextify(getAnnounceWithoutContext(servers[1]), 'Announce') | ||
152 | const headers = buildGlobalHeaders(body) | ||
153 | |||
154 | const signatureOptions = baseHttpSignature() | ||
155 | signatureOptions.headers = [ '(request-target)', '(created)', 'host', 'digest' ] | ||
156 | |||
157 | const { statusCode } = await makePOSTAPRequest(url, body, signatureOptions, headers) | ||
158 | expect(statusCode).to.equal(HttpStatusCode.NO_CONTENT_204) | ||
159 | }) | ||
160 | |||
150 | it('Should succeed with a valid HTTP signature', async function () { | 161 | it('Should succeed with a valid HTTP signature', async function () { |
151 | const body = activityPubContextify(getAnnounceWithoutContext(servers[1]), 'Announce') | 162 | const body = activityPubContextify(getAnnounceWithoutContext(servers[1]), 'Announce') |
152 | const headers = buildGlobalHeaders(body) | 163 | const headers = buildGlobalHeaders(body) |