Skip to content

Commit

Permalink
Merged in bug/jj/ltiImportAdminjs_2021.08.08 (pull request elastic#181)
Browse files Browse the repository at this point in the history
MPC-2467: fix for lti

* MPC-2467: fix for lti (and saml, but not sure if this would affect saml,
depends on how deep the object goes); for importing from directory, merge
of common and local yml data was not complete; ended up with missing properties
for lti.admin.prefix and lti.class.prefix if these settings were default (ie only set in common.yml)

* Merged master into bug/jj/ltiImportAdminjs_2021.08.08

Approved-by: Alan Nuchnoi
  • Loading branch information
Jennifer Joh committed Aug 9, 2021
1 parent 676215c commit 3cd7c8b
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions admin-tools/admin.js
Expand Up @@ -12,6 +12,7 @@ const validators = require("./backend-shared/express/lib/validators");
const utils = require("./utils");
const config = require("./backend-shared/express/lib/config");
const yaml_config = require("node-yaml-config");
const object = require("lodash/object");

async function listTenants () {
for (const tenant of await dbAdmin.listTenants()) {
Expand Down Expand Up @@ -284,11 +285,8 @@ async function importSamlConfig (file, folder) {
} else if (!fs.existsSync(localFile)) {
throw new Error("local.yml file not found");
}

conf = {
...yaml_config.load(commonFile),
...yaml_config.load(localFile),
};
conf = yaml_config.load(commonFile);
object.merge(conf, yaml_config.load(localFile));

if (!conf.saml) {
throw new Error("saml key not found");
Expand Down Expand Up @@ -341,11 +339,8 @@ async function importLtiConfig (file, folder) {
} else if (!fs.existsSync(localFile)) {
throw new Error("local.yml file not found");
}

conf = {
...yaml_config.load(commonFile),
...yaml_config.load(localFile),
};
conf = yaml_config.load(commonFile);
object.merge(conf, yaml_config.load(localFile));

if (!conf.lti) {
throw new Error("lti key not found");
Expand Down

0 comments on commit 3cd7c8b

Please sign in to comment.