aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/activitypub/security.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-09 15:37:43 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit9293139fde7091e9badcafa9b570b83cea9a10ad (patch)
tree9728412f02af4aa59d2c016db47624251e8f6be6 /server/tests/api/activitypub/security.ts
parent078f17e6d90376050f43ce639e88e11869b49ee7 (diff)
downloadPeerTube-9293139fde7091e9badcafa9b570b83cea9a10ad.tar.gz
PeerTube-9293139fde7091e9badcafa9b570b83cea9a10ad.tar.zst
PeerTube-9293139fde7091e9badcafa9b570b83cea9a10ad.zip
Introduce sql command
Diffstat (limited to 'server/tests/api/activitypub/security.ts')
-rw-r--r--server/tests/api/activitypub/security.ts14
1 files changed, 5 insertions, 9 deletions
diff --git a/server/tests/api/activitypub/security.ts b/server/tests/api/activitypub/security.ts
index 61db272f6..c32940070 100644
--- a/server/tests/api/activitypub/security.ts
+++ b/server/tests/api/activitypub/security.ts
@@ -7,12 +7,10 @@ import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-c
7import { 7import {
8 buildAbsoluteFixturePath, 8 buildAbsoluteFixturePath,
9 cleanupTests, 9 cleanupTests,
10 closeAllSequelize,
11 flushAndRunMultipleServers, 10 flushAndRunMultipleServers,
12 killallServers, 11 killallServers,
13 reRunServer, 12 reRunServer,
14 ServerInfo, 13 ServerInfo,
15 setActorField,
16 wait 14 wait
17} from '../../../../shared/extra-utils' 15} from '../../../../shared/extra-utils'
18import { makeFollowRequest, makePOSTAPRequest } from '../../../../shared/extra-utils/requests/activitypub' 16import { makeFollowRequest, makePOSTAPRequest } from '../../../../shared/extra-utils/requests/activitypub'
@@ -26,8 +24,8 @@ function setKeysOfServer (onServer: ServerInfo, ofServer: ServerInfo, publicKey:
26 const url = 'http://localhost:' + ofServer.port + '/accounts/peertube' 24 const url = 'http://localhost:' + ofServer.port + '/accounts/peertube'
27 25
28 return Promise.all([ 26 return Promise.all([
29 setActorField(onServer.internalServerNumber, url, 'publicKey', publicKey), 27 onServer.sqlCommand.setActorField(url, 'publicKey', publicKey),
30 setActorField(onServer.internalServerNumber, url, 'privateKey', privateKey) 28 onServer.sqlCommand.setActorField(url, 'privateKey', privateKey)
31 ]) 29 ])
32} 30}
33 31
@@ -35,8 +33,8 @@ function setUpdatedAtOfServer (onServer: ServerInfo, ofServer: ServerInfo, updat
35 const url = 'http://localhost:' + ofServer.port + '/accounts/peertube' 33 const url = 'http://localhost:' + ofServer.port + '/accounts/peertube'
36 34
37 return Promise.all([ 35 return Promise.all([
38 setActorField(onServer.internalServerNumber, url, 'createdAt', updatedAt), 36 onServer.sqlCommand.setActorField(url, 'createdAt', updatedAt),
39 setActorField(onServer.internalServerNumber, url, 'updatedAt', updatedAt) 37 onServer.sqlCommand.setActorField(url, 'updatedAt', updatedAt)
40 ]) 38 ])
41} 39}
42 40
@@ -173,7 +171,7 @@ describe('Test ActivityPub security', function () {
173 await setUpdatedAtOfServer(servers[0], servers[1], '2015-07-17 22:00:00+00') 171 await setUpdatedAtOfServer(servers[0], servers[1], '2015-07-17 22:00:00+00')
174 172
175 // Invalid peertube actor cache 173 // Invalid peertube actor cache
176 killallServers([ servers[1] ]) 174 await killallServers([ servers[1] ])
177 await reRunServer(servers[1]) 175 await reRunServer(servers[1])
178 176
179 const body = activityPubContextify(getAnnounceWithoutContext(servers[1])) 177 const body = activityPubContextify(getAnnounceWithoutContext(servers[1]))
@@ -294,7 +292,5 @@ describe('Test ActivityPub security', function () {
294 this.timeout(10000) 292 this.timeout(10000)
295 293
296 await cleanupTests(servers) 294 await cleanupTests(servers)
297
298 await closeAllSequelize(servers)
299 }) 295 })
300}) 296})