]>
Commit | Line | Data |
---|---|---|
69818c93 C |
1 | import 'express-validator' |
2 | import * as express from 'express' | |
3 | ||
65fcc311 C |
4 | import { logger } from '../../../helpers' |
5 | import { checkErrors } from '../utils' | |
34ca3b52 | 6 | |
69818c93 | 7 | function signatureValidator (req: express.Request, res: express.Response, next: express.NextFunction) { |
49abbbbe | 8 | req.checkBody('signature.host', 'Should have a signature host').isURL() |
9f10b292 | 9 | req.checkBody('signature.signature', 'Should have a signature').notEmpty() |
c45f7f84 | 10 | |
bdfbd4f1 | 11 | logger.debug('Checking signature parameters', { parameters: { signature: req.body.signature } }) |
c45f7f84 | 12 | |
9f10b292 C |
13 | checkErrors(req, res, next) |
14 | } | |
c45f7f84 | 15 | |
9f10b292 | 16 | // --------------------------------------------------------------------------- |
c45f7f84 | 17 | |
65fcc311 C |
18 | export { |
19 | signatureValidator | |
20 | } |