diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-03 17:33:44 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-03 18:03:36 +0200 |
commit | 10363c74c1d869f0e0c7bc4d0367b1f34d1bb6a4 (patch) | |
tree | 008f8dad8032684f46105a261b27b2d6f05b36eb /server/middlewares/validators/activitypub | |
parent | 5e08989ede1a340b9edb94465a11b1e04bf24094 (diff) | |
download | PeerTube-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.ts | 4 | ||||
-rw-r--r-- | server/middlewares/validators/activitypub/signature.ts | 5 |
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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { query } from 'express-validator' | 2 | import { query } from 'express-validator' |
3 | import { logger } from '../../../helpers/logger' | ||
4 | import { areValidationErrors } from '../utils' | ||
5 | import { PAGINATION } from '@server/initializers/constants' | 3 | import { PAGINATION } from '@server/initializers/constants' |
4 | import { logger } from '../../../helpers/logger' | ||
5 | import { areValidationErrors } from '../shared' | ||
6 | 6 | ||
7 | const apPaginationValidator = [ | 7 | const 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { body } from 'express-validator' | 2 | import { body } from 'express-validator' |
3 | import { | 3 | import { |
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' |
7 | import { isDateValid } from '../../../helpers/custom-validators/misc' | 8 | import { isDateValid } from '../../../helpers/custom-validators/misc' |
8 | import { logger } from '../../../helpers/logger' | 9 | import { logger } from '../../../helpers/logger' |
9 | import { areValidationErrors } from '../utils' | 10 | import { areValidationErrors } from '../shared' |
10 | 11 | ||
11 | const signatureValidator = [ | 12 | const signatureValidator = [ |
12 | body('signature.type') | 13 | body('signature.type') |