Add support for restricted certs as part of dns setup
This commit is contained in:
@@ -43,8 +43,11 @@ function add(req, res, next) {
|
||||
|
||||
if ('zoneName' in req.body && typeof req.body.zoneName !== 'string') return next(new HttpError(400, 'zoneName must be a string'));
|
||||
if ('fallbackCertificate' in req.body && typeof req.body.fallbackCertificate !== 'object') return next(new HttpError(400, 'fallbackCertificate must be a object with cert and key strings'));
|
||||
if (req.body.fallbackCertificate && (!req.body.cert || typeof req.body.cert !== 'string')) return next(new HttpError(400, 'fallbackCertificate.cert must be a string'));
|
||||
if (req.body.fallbackCertificate && (!req.body.key || typeof req.body.key !== 'string')) return next(new HttpError(400, 'fallbackCertificate.key must be a string'));
|
||||
if (req.body.fallbackCertificate) {
|
||||
if (!req.body.cert || typeof req.body.cert !== 'string') return next(new HttpError(400, 'fallbackCertificate.cert must be a string'));
|
||||
if (!req.body.key || typeof req.body.key !== 'string') return next(new HttpError(400, 'fallbackCertificate.key must be a string'));
|
||||
if ('restricted' in req.body && typeof req.body.fallbackCertificate.restricted !== 'boolean') return next(new HttpError(400, 'fallbackCertificate.restricted must be a boolean'));
|
||||
}
|
||||
|
||||
if ('tlsConfig' in req.body) {
|
||||
if (!req.body.tlsConfig || typeof req.body.tlsConfig !== 'object') return next(new HttpError(400, 'tlsConfig must be a object with a provider string property'));
|
||||
|
||||
Reference in New Issue
Block a user