+ // 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 signAndContextify(signer, body, 'Announce')
+
+ const headers = buildGlobalHeaders(signedBody)
+
+ try {
+ await makePOSTAPRequest(url, signedBody, baseHttpSignature(), headers)
+ expect(true, 'Did not throw').to.be.false
+ } catch (err) {
+ expect(err.statusCode).to.equal(HttpStatusCode.FORBIDDEN_403)
+ }