diff options
Diffstat (limited to 'server/middlewares/validators/blocklist.ts')
-rw-r--r-- | server/middlewares/validators/blocklist.ts | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/server/middlewares/validators/blocklist.ts b/server/middlewares/validators/blocklist.ts index 3de614522..1bae3764a 100644 --- a/server/middlewares/validators/blocklist.ts +++ b/server/middlewares/validators/blocklist.ts | |||
@@ -5,7 +5,6 @@ import { toArray } from '@server/helpers/custom-validators/misc' | |||
5 | import { getServerActor } from '@server/models/application/application' | 5 | import { getServerActor } from '@server/models/application/application' |
6 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' | 6 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' |
7 | import { isEachUniqueHostValid, isHostValid } from '../../helpers/custom-validators/servers' | 7 | import { isEachUniqueHostValid, isHostValid } from '../../helpers/custom-validators/servers' |
8 | import { logger } from '../../helpers/logger' | ||
9 | import { WEBSERVER } from '../../initializers/constants' | 8 | import { WEBSERVER } from '../../initializers/constants' |
10 | import { AccountBlocklistModel } from '../../models/account/account-blocklist' | 9 | import { AccountBlocklistModel } from '../../models/account/account-blocklist' |
11 | import { ServerModel } from '../../models/server/server' | 10 | import { ServerModel } from '../../models/server/server' |
@@ -17,8 +16,6 @@ const blockAccountValidator = [ | |||
17 | .exists(), | 16 | .exists(), |
18 | 17 | ||
19 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 18 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
20 | logger.debug('Checking blockAccountByAccountValidator parameters', { parameters: req.body }) | ||
21 | |||
22 | if (areValidationErrors(req, res)) return | 19 | if (areValidationErrors(req, res)) return |
23 | if (!await doesAccountNameWithHostExist(req.body.accountName, res)) return | 20 | if (!await doesAccountNameWithHostExist(req.body.accountName, res)) return |
24 | 21 | ||
@@ -42,8 +39,6 @@ const unblockAccountByAccountValidator = [ | |||
42 | .exists(), | 39 | .exists(), |
43 | 40 | ||
44 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 41 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
45 | logger.debug('Checking unblockAccountByAccountValidator parameters', { parameters: req.params }) | ||
46 | |||
47 | if (areValidationErrors(req, res)) return | 42 | if (areValidationErrors(req, res)) return |
48 | if (!await doesAccountNameWithHostExist(req.params.accountName, res)) return | 43 | if (!await doesAccountNameWithHostExist(req.params.accountName, res)) return |
49 | 44 | ||
@@ -60,8 +55,6 @@ const unblockAccountByServerValidator = [ | |||
60 | .exists(), | 55 | .exists(), |
61 | 56 | ||
62 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 57 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
63 | logger.debug('Checking unblockAccountByServerValidator parameters', { parameters: req.params }) | ||
64 | |||
65 | if (areValidationErrors(req, res)) return | 58 | if (areValidationErrors(req, res)) return |
66 | if (!await doesAccountNameWithHostExist(req.params.accountName, res)) return | 59 | if (!await doesAccountNameWithHostExist(req.params.accountName, res)) return |
67 | 60 | ||
@@ -78,8 +71,6 @@ const blockServerValidator = [ | |||
78 | .custom(isHostValid), | 71 | .custom(isHostValid), |
79 | 72 | ||
80 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 73 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
81 | logger.debug('Checking serverGetValidator parameters', { parameters: req.body }) | ||
82 | |||
83 | if (areValidationErrors(req, res)) return | 74 | if (areValidationErrors(req, res)) return |
84 | 75 | ||
85 | const host: string = req.body.host | 76 | const host: string = req.body.host |
@@ -104,8 +95,6 @@ const unblockServerByAccountValidator = [ | |||
104 | .custom(isHostValid), | 95 | .custom(isHostValid), |
105 | 96 | ||
106 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 97 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
107 | logger.debug('Checking unblockServerByAccountValidator parameters', { parameters: req.params }) | ||
108 | |||
109 | if (areValidationErrors(req, res)) return | 98 | if (areValidationErrors(req, res)) return |
110 | 99 | ||
111 | const user = res.locals.oauth.token.User | 100 | const user = res.locals.oauth.token.User |
@@ -120,8 +109,6 @@ const unblockServerByServerValidator = [ | |||
120 | .custom(isHostValid), | 109 | .custom(isHostValid), |
121 | 110 | ||
122 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 111 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
123 | logger.debug('Checking unblockServerByServerValidator parameters', { parameters: req.params }) | ||
124 | |||
125 | if (areValidationErrors(req, res)) return | 112 | if (areValidationErrors(req, res)) return |
126 | 113 | ||
127 | const serverActor = await getServerActor() | 114 | const serverActor = await getServerActor() |
@@ -143,8 +130,6 @@ const blocklistStatusValidator = [ | |||
143 | .custom(areValidActorHandles).withMessage('Should have a valid accounts array'), | 130 | .custom(areValidActorHandles).withMessage('Should have a valid accounts array'), |
144 | 131 | ||
145 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 132 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
146 | logger.debug('Checking blocklistStatusValidator parameters', { query: req.query }) | ||
147 | |||
148 | if (areValidationErrors(req, res)) return | 133 | if (areValidationErrors(req, res)) return |
149 | 134 | ||
150 | return next() | 135 | return next() |