externalldap: add eventlog

This commit is contained in:
Girish Ramakrishnan
2024-01-13 13:02:43 +01:00
parent 4f9e43859c
commit 4136272382
7 changed files with 42 additions and 24 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ exports = module.exports = {
};
const assert = require('assert'),
AuditSource = require('../auditsource.js'),
BoxError = require('../boxerror.js'),
externalLdap = require('../externalldap.js'),
HttpError = require('connect-lastmile').HttpError,
@@ -39,7 +40,7 @@ async function setConfig(req, res, next) {
if ('bindDn' in req.body && typeof req.body.bindDn !== 'string') return next(new HttpError(400, 'bindDn must be a non empty string'));
if ('bindPassword' in req.body && typeof req.body.bindPassword !== 'string') return next(new HttpError(400, 'bindPassword must be a string'));
const [error] = await safe(externalLdap.setConfig(req.body));
const [error] = await safe(externalLdap.setConfig(req.body, AuditSource.fromRequest(req)));
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, {}));