diff --git a/box.js b/box.js index 0f68493a5..50f3f463e 100755 --- a/box.js +++ b/box.js @@ -4,7 +4,7 @@ const constants = require('./src/constants.js'), fs = require('fs'), - ldap = require('./src/ldap.js'), + ldapServer = require('./src/ldapserver.js'), oidc = require('./src/oidc.js'), paths = require('./src/paths.js'), proxyAuth = require('./src/proxyauth.js'), @@ -37,7 +37,7 @@ async function startServers() { await setupLogging(); await server.start(); // do this first since it also inits the database await proxyAuth.start(); - await ldap.start(); + await ldapServer.start(); const conf = await directoryServer.getConfig(); if (conf.enabled) await directoryServer.start(); @@ -62,7 +62,7 @@ async function main() { await proxyAuth.stop(); await server.stop(); await directoryServer.stop(); - await ldap.stop(); + await ldapServer.stop(); await oidc.stop(); setTimeout(process.exit.bind(process), 3000); }); @@ -73,7 +73,7 @@ async function main() { await proxyAuth.stop(); await server.stop(); await directoryServer.stop(); - await ldap.stop(); + await ldapServer.stop(); await oidc.stop(); setTimeout(process.exit.bind(process), 3000); }); diff --git a/src/ldap.js b/src/ldapserver.js similarity index 99% rename from src/ldap.js rename to src/ldapserver.js index 8f733ecdb..8f668f9e7 100644 --- a/src/ldap.js +++ b/src/ldapserver.js @@ -53,6 +53,7 @@ async function userAuthInternal(appId, req, res, next) { const commonName = req.dn.rdns[0].attrs[attributeName].value; if (!commonName) return next(new ldap.NoSuchObjectError('Missing CN')); + // this code here is only for completeness. none of the apps send totptoken const TOTPTOKEN_ATTRIBUTE_NAME = 'totptoken'; const totpToken = req.dn.rdns[0].attrs[TOTPTOKEN_ATTRIBUTE_NAME] ? req.dn.rdns[0].attrs[TOTPTOKEN_ATTRIBUTE_NAME].value : null; diff --git a/src/routes/test/apps-test.js b/src/routes/test/apps-test.js index bf70db437..f0e9e81f0 100644 --- a/src/routes/test/apps-test.js +++ b/src/routes/test/apps-test.js @@ -16,7 +16,7 @@ const apps = require('../../apps.js'), hat = require('../../hat.js'), hock = require('hock'), http = require('http'), - ldap = require('../../ldap.js'), + ldapServer = require('../../ldapserver.js'), net = require('net'), nock = require('nock'), path = require('path'), @@ -139,7 +139,7 @@ function startBox(done) { database.initialize, database._clear, server.start, - ldap.start, + ldapServer.start, settings._setApiServerOrigin.bind(null, 'http://localhost:6060'), function (callback) { @@ -223,7 +223,7 @@ function stopBox(done) { async.series([ database._clear, server.stop, - ldap.stop, + ldapServer.stop, ], done); } diff --git a/src/test/ldap-test.js b/src/test/ldapserver-test.js similarity index 99% rename from src/test/ldap-test.js rename to src/test/ldapserver-test.js index 7caf92521..928bf7d8d 100644 --- a/src/test/ldap-test.js +++ b/src/test/ldapserver-test.js @@ -13,7 +13,7 @@ const addonConfigs = require('../addonconfigs.js'), expect = require('expect.js'), groups = require('../groups.js'), ldap = require('ldapjs'), - ldapServer = require('../ldap.js'), + ldapServer = require('../ldapserver.js'), mail = require('../mail.js'), safe = require('safetydance');