aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/activitypub.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-03 17:33:44 +0200
committerChocobozzz <me@florianbigard.com>2021-06-03 18:03:36 +0200
commit10363c74c1d869f0e0c7bc4d0367b1f34d1bb6a4 (patch)
tree008f8dad8032684f46105a261b27b2d6f05b36eb /server/middlewares/activitypub.ts
parent5e08989ede1a340b9edb94465a11b1e04bf24094 (diff)
downloadPeerTube-10363c74c1d869f0e0c7bc4d0367b1f34d1bb6a4.tar.gz
PeerTube-10363c74c1d869f0e0c7bc4d0367b1f34d1bb6a4.tar.zst
PeerTube-10363c74c1d869f0e0c7bc4d0367b1f34d1bb6a4.zip
Move middleware utils in middlewares
helpers modules should not import models
Diffstat (limited to 'server/middlewares/activitypub.ts')
-rw-r--r--server/middlewares/activitypub.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/server/middlewares/activitypub.ts b/server/middlewares/activitypub.ts
index a1fdfafcf..6b43b7764 100644
--- a/server/middlewares/activitypub.ts
+++ b/server/middlewares/activitypub.ts
@@ -1,13 +1,12 @@
1import { NextFunction, Request, Response } from 'express' 1import { NextFunction, Request, Response } from 'express'
2import { getAPId } from '@server/helpers/activitypub'
3import { isActorDeleteActivityValid } from '@server/helpers/custom-validators/activitypub/actor'
2import { ActivityDelete, ActivityPubSignature } from '../../shared' 4import { ActivityDelete, ActivityPubSignature } from '../../shared'
5import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes'
3import { logger } from '../helpers/logger' 6import { logger } from '../helpers/logger'
4import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../helpers/peertube-crypto' 7import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../helpers/peertube-crypto'
5import { ACCEPT_HEADERS, ACTIVITY_PUB, HTTP_SIGNATURE } from '../initializers/constants' 8import { ACCEPT_HEADERS, ACTIVITY_PUB, HTTP_SIGNATURE } from '../initializers/constants'
6import { getOrCreateAPActor } from '../lib/activitypub/actors' 9import { getOrCreateAPActor, loadActorUrlOrGetFromWebfinger } from '../lib/activitypub/actors'
7import { loadActorUrlOrGetFromWebfinger } from '../helpers/webfinger'
8import { isActorDeleteActivityValid } from '@server/helpers/custom-validators/activitypub/actor'
9import { getAPId } from '@server/helpers/activitypub'
10import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes'
11 10
12async function checkSignature (req: Request, res: Response, next: NextFunction) { 11async function checkSignature (req: Request, res: Response, next: NextFunction) {
13 try { 12 try {