aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/plugins.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-17 14:58:40 +0200
committerChocobozzz <me@florianbigard.com>2022-08-17 14:58:40 +0200
commita85d530384761a0af833caac9b38b9834517c9fa (patch)
tree5407dbcc32b6324067632d4c99f25a6b7d851230 /server/middlewares/validators/plugins.ts
parent2ec349aa857b0bd8f26de5cd78981d60c9b98a69 (diff)
downloadPeerTube-a85d530384761a0af833caac9b38b9834517c9fa.tar.gz
PeerTube-a85d530384761a0af833caac9b38b9834517c9fa.tar.zst
PeerTube-a85d530384761a0af833caac9b38b9834517c9fa.zip
Remove unnecessary logs
Diffstat (limited to 'server/middlewares/validators/plugins.ts')
-rw-r--r--server/middlewares/validators/plugins.ts19
1 files changed, 0 insertions, 19 deletions
diff --git a/server/middlewares/validators/plugins.ts b/server/middlewares/validators/plugins.ts
index dc80469c3..78c030333 100644
--- a/server/middlewares/validators/plugins.ts
+++ b/server/middlewares/validators/plugins.ts
@@ -5,7 +5,6 @@ import { PluginType } from '../../../shared/models/plugins/plugin.type'
5import { InstallOrUpdatePlugin } from '../../../shared/models/plugins/server/api/install-plugin.model' 5import { InstallOrUpdatePlugin } from '../../../shared/models/plugins/server/api/install-plugin.model'
6import { exists, isBooleanValid, isSafePath, toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc' 6import { exists, isBooleanValid, isSafePath, toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc'
7import { isNpmPluginNameValid, isPluginNameValid, isPluginTypeValid, isPluginVersionValid } from '../../helpers/custom-validators/plugins' 7import { isNpmPluginNameValid, isPluginNameValid, isPluginTypeValid, isPluginVersionValid } from '../../helpers/custom-validators/plugins'
8import { logger } from '../../helpers/logger'
9import { CONFIG } from '../../initializers/config' 8import { CONFIG } from '../../initializers/config'
10import { PluginManager } from '../../lib/plugins/plugin-manager' 9import { PluginManager } from '../../lib/plugins/plugin-manager'
11import { PluginModel } from '../../models/server/plugin' 10import { PluginModel } from '../../models/server/plugin'
@@ -26,8 +25,6 @@ const getPluginValidator = (pluginType: PluginType, withVersion = true) => {
26 25
27 return validators.concat([ 26 return validators.concat([
28 (req: express.Request, res: express.Response, next: express.NextFunction) => { 27 (req: express.Request, res: express.Response, next: express.NextFunction) => {
29 logger.debug('Checking getPluginValidator parameters', { parameters: req.params })
30
31 if (areValidationErrors(req, res)) return 28 if (areValidationErrors(req, res)) return
32 29
33 const npmName = PluginModel.buildNpmName(req.params.pluginName, pluginType) 30 const npmName = PluginModel.buildNpmName(req.params.pluginName, pluginType)
@@ -58,8 +55,6 @@ const getExternalAuthValidator = [
58 .custom(exists), 55 .custom(exists),
59 56
60 (req: express.Request, res: express.Response, next: express.NextFunction) => { 57 (req: express.Request, res: express.Response, next: express.NextFunction) => {
61 logger.debug('Checking getExternalAuthValidator parameters', { parameters: req.params })
62
63 if (areValidationErrors(req, res)) return 58 if (areValidationErrors(req, res)) return
64 59
65 const plugin = res.locals.registeredPlugin 60 const plugin = res.locals.registeredPlugin
@@ -89,8 +84,6 @@ const pluginStaticDirectoryValidator = [
89 .custom(isSafePath), 84 .custom(isSafePath),
90 85
91 (req: express.Request, res: express.Response, next: express.NextFunction) => { 86 (req: express.Request, res: express.Response, next: express.NextFunction) => {
92 logger.debug('Checking pluginStaticDirectoryValidator parameters', { parameters: req.params })
93
94 if (areValidationErrors(req, res)) return 87 if (areValidationErrors(req, res)) return
95 88
96 return next() 89 return next()
@@ -108,8 +101,6 @@ const listPluginsValidator = [
108 .custom(isBooleanValid), 101 .custom(isBooleanValid),
109 102
110 (req: express.Request, res: express.Response, next: express.NextFunction) => { 103 (req: express.Request, res: express.Response, next: express.NextFunction) => {
111 logger.debug('Checking listPluginsValidator parameters', { parameters: req.query })
112
113 if (areValidationErrors(req, res)) return 104 if (areValidationErrors(req, res)) return
114 105
115 return next() 106 return next()
@@ -128,8 +119,6 @@ const installOrUpdatePluginValidator = [
128 .custom(isSafePath), 119 .custom(isSafePath),
129 120
130 (req: express.Request, res: express.Response, next: express.NextFunction) => { 121 (req: express.Request, res: express.Response, next: express.NextFunction) => {
131 logger.debug('Checking installOrUpdatePluginValidator parameters', { parameters: req.body })
132
133 if (areValidationErrors(req, res)) return 122 if (areValidationErrors(req, res)) return
134 123
135 const body: InstallOrUpdatePlugin = req.body 124 const body: InstallOrUpdatePlugin = req.body
@@ -149,8 +138,6 @@ const uninstallPluginValidator = [
149 .custom(isNpmPluginNameValid), 138 .custom(isNpmPluginNameValid),
150 139
151 (req: express.Request, res: express.Response, next: express.NextFunction) => { 140 (req: express.Request, res: express.Response, next: express.NextFunction) => {
152 logger.debug('Checking uninstallPluginValidator parameters', { parameters: req.body })
153
154 if (areValidationErrors(req, res)) return 141 if (areValidationErrors(req, res)) return
155 142
156 return next() 143 return next()
@@ -162,8 +149,6 @@ const existingPluginValidator = [
162 .custom(isNpmPluginNameValid), 149 .custom(isNpmPluginNameValid),
163 150
164 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 151 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
165 logger.debug('Checking enabledPluginValidator parameters', { parameters: req.params })
166
167 if (areValidationErrors(req, res)) return 152 if (areValidationErrors(req, res)) return
168 153
169 const plugin = await PluginModel.loadByNpmName(req.params.npmName) 154 const plugin = await PluginModel.loadByNpmName(req.params.npmName)
@@ -184,8 +169,6 @@ const updatePluginSettingsValidator = [
184 .exists(), 169 .exists(),
185 170
186 (req: express.Request, res: express.Response, next: express.NextFunction) => { 171 (req: express.Request, res: express.Response, next: express.NextFunction) => {
187 logger.debug('Checking enabledPluginValidator parameters', { parameters: req.body })
188
189 if (areValidationErrors(req, res)) return 172 if (areValidationErrors(req, res)) return
190 173
191 return next() 174 return next()
@@ -205,8 +188,6 @@ const listAvailablePluginsValidator = [
205 .custom(isPluginVersionValid), 188 .custom(isPluginVersionValid),
206 189
207 (req: express.Request, res: express.Response, next: express.NextFunction) => { 190 (req: express.Request, res: express.Response, next: express.NextFunction) => {
208 logger.debug('Checking enabledPluginValidator parameters', { parameters: req.query })
209
210 if (areValidationErrors(req, res)) return 191 if (areValidationErrors(req, res)) return
211 192
212 if (CONFIG.PLUGINS.INDEX.ENABLED === false) { 193 if (CONFIG.PLUGINS.INDEX.ENABLED === false) {