backups: make id, provider a backend specific setting
the backend can stash whatever values it wants in the config. just like the DNS backends, we make verifyConfig return a sanitized config. added benefit is that extra user fields (via API) are also not dumped into the db.
This commit is contained in:
+7
-3
@@ -17,7 +17,7 @@ exports = module.exports = {
|
||||
teardown,
|
||||
cleanup,
|
||||
|
||||
testConfig,
|
||||
verifyConfig,
|
||||
removePrivateFields,
|
||||
injectPrivateFields
|
||||
};
|
||||
@@ -103,8 +103,12 @@ async function cleanup(apiConfig, progressCallback) {
|
||||
assert.strictEqual(typeof progressCallback, 'function');
|
||||
}
|
||||
|
||||
async function testConfig(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
async function verifyConfig({ id, provider, config }) {
|
||||
assert.strictEqual(typeof id, 'string');
|
||||
assert.strictEqual(typeof provider, 'string');
|
||||
assert.strictEqual(typeof config, 'object');
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
async function setup(apiConfig) {
|
||||
|
||||
Reference in New Issue
Block a user