ldap: add provider field

This commit is contained in:
Girish Ramakrishnan
2019-10-25 15:40:22 -07:00
parent a478134759
commit 1a21423401
3 changed files with 16 additions and 13 deletions

View File

@@ -198,7 +198,8 @@ function getExternalLdapConfig(req, res, next) {
function setExternalLdapConfig(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
if (typeof req.body.enabled !== 'boolean') return next(new HttpError(400, 'enabled must be a boolean'));
if (!req.body.provider || typeof req.body.provider !== 'string') return next(new HttpError(400, 'provider must be a string'));
if (typeof req.body.provider !== 'string' || req.body.provider === '') return next(new HttpError(400, 'provider must be non-empty string'));
if (typeof req.body.url !== 'string' || req.body.url === '') return next(new HttpError(400, 'url must be a non empty string'));
if (typeof req.body.baseDn !== 'string' || req.body.baseDn === '') return next(new HttpError(400, 'baseDn must be a non empty string'));
if (typeof req.body.filter !== 'string' || req.body.filter === '') return next(new HttpError(400, 'filter must be a non empty string'));