Add backups.testProviderConfig

fields like format/retention won't be validated here since it's only
testing the access credentials
This commit is contained in:
Girish Ramakrishnan
2019-12-05 11:55:51 -08:00
parent d57681ff21
commit a44a82083e
3 changed files with 13 additions and 2 deletions

View File

@@ -406,7 +406,6 @@ function importApp(req, res, next) {
if (req.body.backupConfig) {
if (typeof backupConfig.provider !== 'string') return next(new HttpError(400, 'provider is required'));
if ('key' in backupConfig && typeof backupConfig.key !== 'string') return next(new HttpError(400, 'key must be a string'));
if (typeof backupConfig.format !== 'string') return next(new HttpError(400, 'format must be a string'));
if ('acceptSelfSignedCerts' in backupConfig && typeof backupConfig.acceptSelfSignedCerts !== 'boolean') return next(new HttpError(400, 'format must be a boolean'));
// testing backup config can take sometime