1 import 'express-validator'
2 import * as express from 'express'
4 import { logger } from '../../../helpers'
5 import { checkErrors } from '../utils'
7 function signatureValidator (req: express.Request, res: express.Response, next: express.NextFunction) {
8 req.checkBody('signature.host', 'Should have a signature host').isURL()
9 req.checkBody('signature.signature', 'Should have a signature').notEmpty()
11 logger.debug('Checking signature parameters', { parameters: { signature: req.body.signature } })
13 checkErrors(req, res, next)
16 // ---------------------------------------------------------------------------