remove unused /api/v1/settings/admin_certificate

This commit is contained in:
Girish Ramakrishnan
2018-01-26 20:47:19 -08:00
parent 44324f4501
commit c2d348fe72
3 changed files with 4 additions and 46 deletions

View File

@@ -17,14 +17,10 @@ exports = module.exports = {
setTimeZone: setTimeZone,
getAppstoreConfig: getAppstoreConfig,
setAppstoreConfig: setAppstoreConfig,
setAdminCertificate: setAdminCertificate
setAppstoreConfig: setAppstoreConfig
};
var assert = require('assert'),
certificates = require('../certificates.js'),
CertificatesError = require('../certificates.js').CertificatesError,
HttpError = require('connect-lastmile').HttpError,
HttpSuccess = require('connect-lastmile').HttpSuccess,
safe = require('safetydance'),
@@ -176,18 +172,3 @@ function setAppstoreConfig(req, res, next) {
});
});
}
// only webadmin cert, until it can be treated just like a normal app
function setAdminCertificate(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
if (!req.body.cert || typeof req.body.cert !== 'string') return next(new HttpError(400, 'cert must be a string'));
if (!req.body.key || typeof req.body.key !== 'string') return next(new HttpError(400, 'key must be a string'));
certificates.setAdminCertificate(req.body.cert, req.body.key, function (error) {
if (error && error.reason === CertificatesError.INVALID_CERT) return next(new HttpError(400, error.message));
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(202, {}));
});
}