move wellKnownJson to domains

after some more thought:
* If app moves to another location, user has to remember to move all this config
* It's not really associated with an app. It's to do with the domain info
* We can put some hints in the UI if app is missing.

part of #703
This commit is contained in:
Girish Ramakrishnan
2020-12-23 15:34:23 -08:00
parent 8a17e13ec4
commit 663e0952fc
24 changed files with 100 additions and 98 deletions

View File

@@ -32,7 +32,6 @@ exports = module.exports = {
setLocation,
setDataDir,
setMounts,
setWellKnown,
stop,
start,
@@ -797,19 +796,3 @@ function setMounts(req, res, next) {
next(new HttpSuccess(202, { taskId: result.taskId }));
});
}
function setWellKnown(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
assert.strictEqual(typeof req.resource, 'object');
if (typeof req.body.wellKnown !== 'object') return next(new HttpError(400, 'wellKnown must be an object'));
if (req.body.wellKnown) {
if (Object.keys(req.body.wellKnown).some(k => typeof req.body.wellKnown[k] !== 'string')) return next(new HttpError(400, 'wellKnown is a map of strings'));
}
apps.setWellKnown(req.resource, req.body.wellKnown, auditSource.fromRequest(req), function (error, result) {
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, {}));
});
}