]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/shared/requests.ts
Update angular
[github/Chocobozzz/PeerTube.git] / server / tests / shared / requests.ts
index 7f1acc0e1333cd88f487903a54e5314c931f04e4..0cfeab7b2fd8844d0c084140af0c26c5c04e10b9 100644 (file)
@@ -1,7 +1,4 @@
-import { activityPubContextify } from '@server/helpers/activitypub'
-import { buildDigest } from '@server/helpers/peertube-crypto'
 import { doRequest } from '@server/helpers/requests'
-import { ACTIVITY_PUB, HTTP_SIGNATURE } from '@server/initializers/constants'
 
 export function makePOSTAPRequest (url: string, body: any, httpSignature: any, headers: any) {
   const options = {
@@ -13,29 +10,3 @@ export function makePOSTAPRequest (url: string, body: any, httpSignature: any, h
 
   return doRequest(url, options)
 }
-
-export async function makeFollowRequest (to: { url: string }, by: { url: string, privateKey }) {
-  const follow = {
-    type: 'Follow',
-    id: by.url + '/' + new Date().getTime(),
-    actor: by.url,
-    object: to.url
-  }
-
-  const body = activityPubContextify(follow)
-
-  const httpSignature = {
-    algorithm: HTTP_SIGNATURE.ALGORITHM,
-    authorizationHeaderName: HTTP_SIGNATURE.HEADER_NAME,
-    keyId: by.url,
-    key: by.privateKey,
-    headers: HTTP_SIGNATURE.HEADERS_TO_SIGN
-  }
-  const headers = {
-    'digest': buildDigest(body),
-    'content-type': 'application/activity+json',
-    'accept': ACTIVITY_PUB.ACCEPT_HEADER
-  }
-
-  return makePOSTAPRequest(to.url + '/inbox', body, httpSignature, headers)
-}