reverseproxy: move renew and trusted ip routes
This commit is contained in:
@@ -4,9 +4,6 @@ exports = module.exports = {
|
||||
getBlocklist,
|
||||
setBlocklist,
|
||||
|
||||
getTrustedIps,
|
||||
setTrustedIps,
|
||||
|
||||
getDynamicDns,
|
||||
setDynamicDns,
|
||||
|
||||
@@ -49,24 +46,6 @@ async function setBlocklist(req, res, next) {
|
||||
next(new HttpSuccess(200, {}));
|
||||
}
|
||||
|
||||
async function getTrustedIps(req, res, next) {
|
||||
const [error, trustedIps] = await safe(reverseProxy.getTrustedIps());
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, { trustedIps }));
|
||||
}
|
||||
|
||||
async function setTrustedIps(req, res, next) {
|
||||
assert.strictEqual(typeof req.body, 'object');
|
||||
|
||||
if (typeof req.body.trustedIps !== 'string') return next(new HttpError(400, 'trustedIps must be a string'));
|
||||
|
||||
const [error] = await safe(reverseProxy.setTrustedIps(req.body.trustedIps, AuditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, {}));
|
||||
}
|
||||
|
||||
async function getDynamicDns(req, res, next) {
|
||||
const [error, enabled] = await safe(network.getDynamicDns());
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
Reference in New Issue
Block a user