diff options
Diffstat (limited to 'middlewares/reqValidators/remote.js')
-rw-r--r-- | middlewares/reqValidators/remote.js | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/middlewares/reqValidators/remote.js b/middlewares/reqValidators/remote.js deleted file mode 100644 index 88de16b49..000000000 --- a/middlewares/reqValidators/remote.js +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | 'use strict' | ||
2 | |||
3 | var checkErrors = require('./utils').checkErrors | ||
4 | var logger = require('../../helpers/logger') | ||
5 | |||
6 | var reqValidatorsRemote = { | ||
7 | remoteVideosAdd: remoteVideosAdd, | ||
8 | remoteVideosRemove: remoteVideosRemove, | ||
9 | secureRequest: secureRequest | ||
10 | } | ||
11 | |||
12 | function remoteVideosAdd (req, res, next) { | ||
13 | req.checkBody('data').isArray() | ||
14 | req.checkBody('data').eachIsRemoteVideosAddValid() | ||
15 | |||
16 | logger.debug('Checking remoteVideosAdd parameters', { parameters: req.body }) | ||
17 | |||
18 | checkErrors(req, res, next) | ||
19 | } | ||
20 | |||
21 | function remoteVideosRemove (req, res, next) { | ||
22 | req.checkBody('data').isArray() | ||
23 | req.checkBody('data').eachIsRemoteVideosRemoveValid() | ||
24 | |||
25 | logger.debug('Checking remoteVideosRemove parameters', { parameters: req.body }) | ||
26 | |||
27 | checkErrors(req, res, next) | ||
28 | } | ||
29 | |||
30 | function secureRequest (req, res, next) { | ||
31 | req.checkBody('signature.url', 'Should have a signature url').isURL() | ||
32 | req.checkBody('signature.signature', 'Should have a signature').notEmpty() | ||
33 | req.checkBody('key', 'Should have a key').notEmpty() | ||
34 | req.checkBody('data', 'Should have data').notEmpty() | ||
35 | |||
36 | logger.debug('Checking secureRequest parameters', { parameters: { data: req.body.data, keyLength: req.body.key.length } }) | ||
37 | |||
38 | checkErrors(req, res, next) | ||
39 | } | ||
40 | |||
41 | // --------------------------------------------------------------------------- | ||
42 | |||
43 | module.exports = reqValidatorsRemote | ||