- const { response } = await makePOSTAPRequest(url, signedBody, baseHttpSignature, headers)
+ const { statusCode } = await makePOSTAPRequest(url, signedBody, baseHttpSignature(), headers)
+ expect(statusCode).to.equal(HttpStatusCode.NO_CONTENT_204)
+ })
+
+ it('Should refresh the actor keys', async function () {
+ this.timeout(20000)
+
+ // Wait refresh invalidation
+ await wait(10000)
+
+ // Update keys of server 3 to invalid keys
+ // Server 1 should refresh the actor and fail
+ await setKeysOfServer(servers[2], servers[2], invalidKeys.publicKey, invalidKeys.privateKey)
+
+ const body = getAnnounceWithoutContext(servers[1])
+ body.actor = 'http://localhost:' + servers[2].port + '/accounts/peertube'
+
+ const signer: any = { privateKey: keys.privateKey, url: 'http://localhost:' + servers[2].port + '/accounts/peertube' }
+ const signedBody = await buildSignedActivity(signer, body)
+
+ const headers = buildGlobalHeaders(signedBody)