diff options
author | Chocobozzz <me@florianbigard.com> | 2018-11-14 15:01:28 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-11-14 16:32:27 +0100 |
commit | 5c6d985faeef1d6793d3f44ca6374f1a9b722806 (patch) | |
tree | 567e31a84e721bf762189582f92ac2ec5c402bcc /server/tests/api | |
parent | df66d81583e07ce049daeeef1edc6a87b57b3684 (diff) | |
download | PeerTube-5c6d985faeef1d6793d3f44ca6374f1a9b722806.tar.gz PeerTube-5c6d985faeef1d6793d3f44ca6374f1a9b722806.tar.zst PeerTube-5c6d985faeef1d6793d3f44ca6374f1a9b722806.zip |
Check activities host
Diffstat (limited to 'server/tests/api')
-rw-r--r-- | server/tests/api/activitypub/security.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/server/tests/api/activitypub/security.ts b/server/tests/api/activitypub/security.ts index c5428abbb..e7899bb14 100644 --- a/server/tests/api/activitypub/security.ts +++ b/server/tests/api/activitypub/security.ts | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | 4 | ||
5 | import { flushAndRunMultipleServers, flushTests, killallServers, makeAPRequest, makeFollowRequest, ServerInfo } from '../../utils' | 5 | import { flushAndRunMultipleServers, flushTests, killallServers, makePOSTAPRequest, makeFollowRequest, ServerInfo } from '../../utils' |
6 | import { HTTP_SIGNATURE } from '../../../initializers' | 6 | import { HTTP_SIGNATURE } from '../../../initializers' |
7 | import { buildDigest, buildGlobalHeaders } from '../../../lib/job-queue/handlers/utils/activitypub-http-utils' | 7 | import { buildDigest, buildGlobalHeaders } from '../../../lib/job-queue/handlers/utils/activitypub-http-utils' |
8 | import * as chai from 'chai' | 8 | import * as chai from 'chai' |
@@ -63,7 +63,7 @@ describe('Test ActivityPub security', function () { | |||
63 | Digest: buildDigest({ hello: 'coucou' }) | 63 | Digest: buildDigest({ hello: 'coucou' }) |
64 | } | 64 | } |
65 | 65 | ||
66 | const { response } = await makeAPRequest(url, body, baseHttpSignature, headers) | 66 | const { response } = await makePOSTAPRequest(url, body, baseHttpSignature, headers) |
67 | 67 | ||
68 | expect(response.statusCode).to.equal(403) | 68 | expect(response.statusCode).to.equal(403) |
69 | }) | 69 | }) |
@@ -73,7 +73,7 @@ describe('Test ActivityPub security', function () { | |||
73 | const headers = buildGlobalHeaders(body) | 73 | const headers = buildGlobalHeaders(body) |
74 | headers['date'] = 'Wed, 21 Oct 2015 07:28:00 GMT' | 74 | headers['date'] = 'Wed, 21 Oct 2015 07:28:00 GMT' |
75 | 75 | ||
76 | const { response } = await makeAPRequest(url, body, baseHttpSignature, headers) | 76 | const { response } = await makePOSTAPRequest(url, body, baseHttpSignature, headers) |
77 | 77 | ||
78 | expect(response.statusCode).to.equal(403) | 78 | expect(response.statusCode).to.equal(403) |
79 | }) | 79 | }) |
@@ -85,7 +85,7 @@ describe('Test ActivityPub security', function () { | |||
85 | const body = activityPubContextify(require('./json/peertube/announce-without-context.json')) | 85 | const body = activityPubContextify(require('./json/peertube/announce-without-context.json')) |
86 | const headers = buildGlobalHeaders(body) | 86 | const headers = buildGlobalHeaders(body) |
87 | 87 | ||
88 | const { response } = await makeAPRequest(url, body, baseHttpSignature, headers) | 88 | const { response } = await makePOSTAPRequest(url, body, baseHttpSignature, headers) |
89 | 89 | ||
90 | expect(response.statusCode).to.equal(403) | 90 | expect(response.statusCode).to.equal(403) |
91 | }) | 91 | }) |
@@ -97,7 +97,7 @@ describe('Test ActivityPub security', function () { | |||
97 | const body = activityPubContextify(require('./json/peertube/announce-without-context.json')) | 97 | const body = activityPubContextify(require('./json/peertube/announce-without-context.json')) |
98 | const headers = buildGlobalHeaders(body) | 98 | const headers = buildGlobalHeaders(body) |
99 | 99 | ||
100 | const { response } = await makeAPRequest(url, body, baseHttpSignature, headers) | 100 | const { response } = await makePOSTAPRequest(url, body, baseHttpSignature, headers) |
101 | 101 | ||
102 | expect(response.statusCode).to.equal(204) | 102 | expect(response.statusCode).to.equal(204) |
103 | }) | 103 | }) |
@@ -126,7 +126,7 @@ describe('Test ActivityPub security', function () { | |||
126 | 126 | ||
127 | const headers = buildGlobalHeaders(signedBody) | 127 | const headers = buildGlobalHeaders(signedBody) |
128 | 128 | ||
129 | const { response } = await makeAPRequest(url, signedBody, baseHttpSignature, headers) | 129 | const { response } = await makePOSTAPRequest(url, signedBody, baseHttpSignature, headers) |
130 | 130 | ||
131 | expect(response.statusCode).to.equal(403) | 131 | expect(response.statusCode).to.equal(403) |
132 | }) | 132 | }) |
@@ -147,7 +147,7 @@ describe('Test ActivityPub security', function () { | |||
147 | 147 | ||
148 | const headers = buildGlobalHeaders(signedBody) | 148 | const headers = buildGlobalHeaders(signedBody) |
149 | 149 | ||
150 | const { response } = await makeAPRequest(url, signedBody, baseHttpSignature, headers) | 150 | const { response } = await makePOSTAPRequest(url, signedBody, baseHttpSignature, headers) |
151 | 151 | ||
152 | expect(response.statusCode).to.equal(403) | 152 | expect(response.statusCode).to.equal(403) |
153 | }) | 153 | }) |
@@ -163,7 +163,7 @@ describe('Test ActivityPub security', function () { | |||
163 | 163 | ||
164 | const headers = buildGlobalHeaders(signedBody) | 164 | const headers = buildGlobalHeaders(signedBody) |
165 | 165 | ||
166 | const { response } = await makeAPRequest(url, signedBody, baseHttpSignature, headers) | 166 | const { response } = await makePOSTAPRequest(url, signedBody, baseHttpSignature, headers) |
167 | 167 | ||
168 | expect(response.statusCode).to.equal(204) | 168 | expect(response.statusCode).to.equal(204) |
169 | }) | 169 | }) |