]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - middlewares/reqValidators/remote.js
4 var checkErrors
= require('./utils').checkErrors
5 var logger
= require('../../src/logger')
9 remote
.secureRequest = function (req
, res
, next
) {
10 req
.checkBody('signature.url', 'Should have a signature url').isURL()
11 req
.checkBody('signature.signature', 'Should have a signature').notEmpty()
12 req
.checkBody('key', 'Should have a key').notEmpty()
13 req
.checkBody('data', 'Should have data').notEmpty()
15 logger
.debug('Checking secureRequest parameters', { parameters: req
.body
})
17 checkErrors(req
, res
, next
)
20 remote
.remoteVideosAdd = function (req
, res
, next
) {
21 req
.checkBody('data').isArray()
22 req
.checkBody('data').eachIsRemoteVideosAddValid()
24 logger
.debug('Checking remoteVideosAdd parameters', { parameters: req
.body
})
26 checkErrors(req
, res
, next
)
29 remote
.remoteVideosRemove = function (req
, res
, next
) {
30 req
.checkBody('data').isArray()
31 req
.checkBody('data').eachIsRemoteVideosRemoveValid()
33 logger
.debug('Checking remoteVideosRemove parameters', { parameters: req
.body
})
35 checkErrors(req
, res
, next
)
38 module
.exports
= remote