diff options
author | Chocobozzz <me@florianbigard.com> | 2020-04-23 09:32:53 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-05-04 16:21:39 +0200 |
commit | 8dc8a34ee8428e7657414115d1c137592efa174d (patch) | |
tree | e9b5ef0d7446d1b7766eac18da5a759edc7a9040 /server/middlewares/validators | |
parent | 7fed637506043e4432cbebe041ada0625171cceb (diff) | |
download | PeerTube-8dc8a34ee8428e7657414115d1c137592efa174d.tar.gz PeerTube-8dc8a34ee8428e7657414115d1c137592efa174d.tar.zst PeerTube-8dc8a34ee8428e7657414115d1c137592efa174d.zip |
Avoir some circular dependencies
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r-- | server/middlewares/validators/activitypub/activity.ts | 2 | ||||
-rw-r--r-- | server/middlewares/validators/blocklist.ts | 2 | ||||
-rw-r--r-- | server/middlewares/validators/follows.ts | 2 | ||||
-rw-r--r-- | server/middlewares/validators/videos/videos.ts | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/server/middlewares/validators/activitypub/activity.ts b/server/middlewares/validators/activitypub/activity.ts index 7582f65e7..7350be5d5 100644 --- a/server/middlewares/validators/activitypub/activity.ts +++ b/server/middlewares/validators/activitypub/activity.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { isRootActivityValid } from '../../../helpers/custom-validators/activitypub/activity' | 2 | import { isRootActivityValid } from '../../../helpers/custom-validators/activitypub/activity' |
3 | import { logger } from '../../../helpers/logger' | 3 | import { logger } from '../../../helpers/logger' |
4 | import { getServerActor } from '../../../helpers/utils' | 4 | import { getServerActor } from '@server/models/application/application' |
5 | 5 | ||
6 | async function activityPubValidator (req: express.Request, res: express.Response, next: express.NextFunction) { | 6 | async function activityPubValidator (req: express.Request, res: express.Response, next: express.NextFunction) { |
7 | logger.debug('Checking activity pub parameters') | 7 | logger.debug('Checking activity pub parameters') |
diff --git a/server/middlewares/validators/blocklist.ts b/server/middlewares/validators/blocklist.ts index b2183437c..c00a7e4df 100644 --- a/server/middlewares/validators/blocklist.ts +++ b/server/middlewares/validators/blocklist.ts | |||
@@ -6,9 +6,9 @@ import { AccountBlocklistModel } from '../../models/account/account-blocklist' | |||
6 | import { isHostValid } from '../../helpers/custom-validators/servers' | 6 | import { isHostValid } from '../../helpers/custom-validators/servers' |
7 | import { ServerBlocklistModel } from '../../models/server/server-blocklist' | 7 | import { ServerBlocklistModel } from '../../models/server/server-blocklist' |
8 | import { ServerModel } from '../../models/server/server' | 8 | import { ServerModel } from '../../models/server/server' |
9 | import { getServerActor } from '../../helpers/utils' | ||
10 | import { WEBSERVER } from '../../initializers/constants' | 9 | import { WEBSERVER } from '../../initializers/constants' |
11 | import { doesAccountNameWithHostExist } from '../../helpers/middlewares' | 10 | import { doesAccountNameWithHostExist } from '../../helpers/middlewares' |
11 | import { getServerActor } from '@server/models/application/application' | ||
12 | 12 | ||
13 | const blockAccountValidator = [ | 13 | const blockAccountValidator = [ |
14 | body('accountName').exists().withMessage('Should have an account name with host'), | 14 | body('accountName').exists().withMessage('Should have an account name with host'), |
diff --git a/server/middlewares/validators/follows.ts b/server/middlewares/validators/follows.ts index a98d32d86..7808135f7 100644 --- a/server/middlewares/validators/follows.ts +++ b/server/middlewares/validators/follows.ts | |||
@@ -3,7 +3,6 @@ import { body, param, query } from 'express-validator' | |||
3 | import { isTestInstance } from '../../helpers/core-utils' | 3 | import { isTestInstance } from '../../helpers/core-utils' |
4 | import { isEachUniqueHostValid, isHostValid } from '../../helpers/custom-validators/servers' | 4 | import { isEachUniqueHostValid, isHostValid } from '../../helpers/custom-validators/servers' |
5 | import { logger } from '../../helpers/logger' | 5 | import { logger } from '../../helpers/logger' |
6 | import { getServerActor } from '../../helpers/utils' | ||
7 | import { SERVER_ACTOR_NAME, WEBSERVER } from '../../initializers/constants' | 6 | import { SERVER_ACTOR_NAME, WEBSERVER } from '../../initializers/constants' |
8 | import { ActorFollowModel } from '../../models/activitypub/actor-follow' | 7 | import { ActorFollowModel } from '../../models/activitypub/actor-follow' |
9 | import { areValidationErrors } from './utils' | 8 | import { areValidationErrors } from './utils' |
@@ -12,6 +11,7 @@ import { loadActorUrlOrGetFromWebfinger } from '../../helpers/webfinger' | |||
12 | import { isActorTypeValid, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor' | 11 | import { isActorTypeValid, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor' |
13 | import { MActorFollowActorsDefault } from '@server/typings/models' | 12 | import { MActorFollowActorsDefault } from '@server/typings/models' |
14 | import { isFollowStateValid } from '@server/helpers/custom-validators/follows' | 13 | import { isFollowStateValid } from '@server/helpers/custom-validators/follows' |
14 | import { getServerActor } from '@server/models/application/application' | ||
15 | 15 | ||
16 | const listFollowsValidator = [ | 16 | const listFollowsValidator = [ |
17 | query('state') | 17 | query('state') |
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 3a7869354..867c05fc1 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts | |||
@@ -38,7 +38,6 @@ import { checkUserCanTerminateOwnershipChange, doesChangeVideoOwnershipExist } f | |||
38 | import { VideoChangeOwnershipAccept } from '../../../../shared/models/videos/video-change-ownership-accept.model' | 38 | import { VideoChangeOwnershipAccept } from '../../../../shared/models/videos/video-change-ownership-accept.model' |
39 | import { AccountModel } from '../../../models/account/account' | 39 | import { AccountModel } from '../../../models/account/account' |
40 | import { isNSFWQueryValid, isNumberArray, isStringArray } from '../../../helpers/custom-validators/search' | 40 | import { isNSFWQueryValid, isNumberArray, isStringArray } from '../../../helpers/custom-validators/search' |
41 | import { getServerActor } from '../../../helpers/utils' | ||
42 | import { CONFIG } from '../../../initializers/config' | 41 | import { CONFIG } from '../../../initializers/config' |
43 | import { isLocalVideoAccepted } from '../../../lib/moderation' | 42 | import { isLocalVideoAccepted } from '../../../lib/moderation' |
44 | import { Hooks } from '../../../lib/plugins/hooks' | 43 | import { Hooks } from '../../../lib/plugins/hooks' |
@@ -50,6 +49,7 @@ import { | |||
50 | } from '../../../helpers/middlewares' | 49 | } from '../../../helpers/middlewares' |
51 | import { MVideoFullLight } from '@server/typings/models' | 50 | import { MVideoFullLight } from '@server/typings/models' |
52 | import { getVideoWithAttributes } from '../../../helpers/video' | 51 | import { getVideoWithAttributes } from '../../../helpers/video' |
52 | import { getServerActor } from '@server/models/application/application' | ||
53 | 53 | ||
54 | const videosAddValidator = getCommonVideoEditAttributes().concat([ | 54 | const videosAddValidator = getCommonVideoEditAttributes().concat([ |
55 | body('videofile') | 55 | body('videofile') |