aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/activitypub
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/validators/activitypub
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/validators/activitypub')
-rw-r--r--server/middlewares/validators/activitypub/pagination.ts4
-rw-r--r--server/middlewares/validators/activitypub/signature.ts5
2 files changed, 5 insertions, 4 deletions
diff --git a/server/middlewares/validators/activitypub/pagination.ts b/server/middlewares/validators/activitypub/pagination.ts
index fa21f063d..c8ec34eb6 100644
--- a/server/middlewares/validators/activitypub/pagination.ts
+++ b/server/middlewares/validators/activitypub/pagination.ts
@@ -1,8 +1,8 @@
1import * as express from 'express' 1import * as express from 'express'
2import { query } from 'express-validator' 2import { query } from 'express-validator'
3import { logger } from '../../../helpers/logger'
4import { areValidationErrors } from '../utils'
5import { PAGINATION } from '@server/initializers/constants' 3import { PAGINATION } from '@server/initializers/constants'
4import { logger } from '../../../helpers/logger'
5import { areValidationErrors } from '../shared'
6 6
7const apPaginationValidator = [ 7const apPaginationValidator = [
8 query('page') 8 query('page')
diff --git a/server/middlewares/validators/activitypub/signature.ts b/server/middlewares/validators/activitypub/signature.ts
index 7896a6128..f2f7d5848 100644
--- a/server/middlewares/validators/activitypub/signature.ts
+++ b/server/middlewares/validators/activitypub/signature.ts
@@ -1,12 +1,13 @@
1import * as express from 'express' 1import * as express from 'express'
2import { body } from 'express-validator' 2import { body } from 'express-validator'
3import { 3import {
4 isSignatureCreatorValid, isSignatureTypeValid, 4 isSignatureCreatorValid,
5 isSignatureTypeValid,
5 isSignatureValueValid 6 isSignatureValueValid
6} from '../../../helpers/custom-validators/activitypub/signature' 7} from '../../../helpers/custom-validators/activitypub/signature'
7import { isDateValid } from '../../../helpers/custom-validators/misc' 8import { isDateValid } from '../../../helpers/custom-validators/misc'
8import { logger } from '../../../helpers/logger' 9import { logger } from '../../../helpers/logger'
9import { areValidationErrors } from '../utils' 10import { areValidationErrors } from '../shared'
10 11
11const signatureValidator = [ 12const signatureValidator = [
12 body('signature.type') 13 body('signature.type')