diff options
Diffstat (limited to 'server/middlewares/validators/remote/signature.js')
-rw-r--r-- | server/middlewares/validators/remote/signature.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/server/middlewares/validators/remote/signature.js b/server/middlewares/validators/remote/signature.js new file mode 100644 index 000000000..5880a2c2c --- /dev/null +++ b/server/middlewares/validators/remote/signature.js | |||
@@ -0,0 +1,21 @@ | |||
1 | 'use strict' | ||
2 | |||
3 | const checkErrors = require('../utils').checkErrors | ||
4 | const logger = require('../../../helpers/logger') | ||
5 | |||
6 | const validatorsRemoteSignature = { | ||
7 | signature | ||
8 | } | ||
9 | |||
10 | function signature (req, res, next) { | ||
11 | req.checkBody('signature.host', 'Should have a signature host').isURL() | ||
12 | req.checkBody('signature.signature', 'Should have a signature').notEmpty() | ||
13 | |||
14 | logger.debug('Checking signature parameters', { parameters: { signatureHost: req.body.signature.host } }) | ||
15 | |||
16 | checkErrors(req, res, next) | ||
17 | } | ||
18 | |||
19 | // --------------------------------------------------------------------------- | ||
20 | |||
21 | module.exports = validatorsRemoteSignature | ||