1 import { body } from 'express-validator/check'
2 import * as express from 'express'
4 import { logger, isHostValid } from '../../../helpers'
5 import { checkErrors } from '../utils'
7 const signatureValidator = [
8 body('signature.host').custom(isHostValid).withMessage('Should have a signature host'),
9 body('signature.signature').not().isEmpty().withMessage('Should have a signature'),
11 (req: express.Request, res: express.Response, next: express.NextFunction) => {
12 logger.debug('Checking signature parameters', { parameters: { signature: req.body.signature } })
14 checkErrors(req, res, next)
18 // ---------------------------------------------------------------------------