2016-10-07 13:14:27 -07:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
exports = module.exports = {
|
2021-08-13 17:22:28 -07:00
|
|
|
removePrivateFields,
|
|
|
|
|
injectPrivateFields,
|
|
|
|
|
upsert,
|
|
|
|
|
get,
|
|
|
|
|
del,
|
|
|
|
|
wait,
|
2022-01-05 22:41:41 -08:00
|
|
|
verifyDomainConfig
|
2016-10-07 13:14:27 -07:00
|
|
|
};
|
|
|
|
|
|
2021-08-13 17:22:28 -07:00
|
|
|
const assert = require('assert'),
|
|
|
|
|
debug = require('debug')('box:dns/noop');
|
2016-10-07 13:14:27 -07:00
|
|
|
|
2019-02-08 11:11:49 +01:00
|
|
|
function removePrivateFields(domainObject) {
|
|
|
|
|
return domainObject;
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-23 10:02:04 -07:00
|
|
|
// eslint-disable-next-line no-unused-vars
|
2019-02-09 19:08:15 +01:00
|
|
|
function injectPrivateFields(newConfig, currentConfig) {
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-04 13:58:29 -08:00
|
|
|
async function upsert(domainObject, location, type, values) {
|
2019-01-04 18:44:54 -08:00
|
|
|
assert.strictEqual(typeof domainObject, 'object');
|
|
|
|
|
assert.strictEqual(typeof location, 'string');
|
2016-10-07 13:14:27 -07:00
|
|
|
assert.strictEqual(typeof type, 'string');
|
2021-05-02 11:26:08 -07:00
|
|
|
assert(Array.isArray(values));
|
2016-10-07 13:14:27 -07:00
|
|
|
|
2019-01-04 18:44:54 -08:00
|
|
|
debug('upsert: %s for zone %s of type %s with values %j', location, domainObject.zoneName, type, values);
|
2016-10-07 13:14:27 -07:00
|
|
|
|
2022-02-04 13:58:29 -08:00
|
|
|
return;
|
2016-10-07 13:14:27 -07:00
|
|
|
}
|
|
|
|
|
|
2022-02-04 13:58:29 -08:00
|
|
|
async function get(domainObject, location, type) {
|
2019-01-04 18:44:54 -08:00
|
|
|
assert.strictEqual(typeof domainObject, 'object');
|
|
|
|
|
assert.strictEqual(typeof location, 'string');
|
2016-10-07 13:14:27 -07:00
|
|
|
assert.strictEqual(typeof type, 'string');
|
|
|
|
|
|
2022-02-04 13:58:29 -08:00
|
|
|
return []; // returning ip confuses apptask into thinking the entry already exists
|
2016-10-07 13:14:27 -07:00
|
|
|
}
|
|
|
|
|
|
2022-02-04 13:58:29 -08:00
|
|
|
async function del(domainObject, location, type, values) {
|
2019-01-04 18:44:54 -08:00
|
|
|
assert.strictEqual(typeof domainObject, 'object');
|
|
|
|
|
assert.strictEqual(typeof location, 'string');
|
2016-10-07 13:14:27 -07:00
|
|
|
assert.strictEqual(typeof type, 'string');
|
2021-05-02 11:26:08 -07:00
|
|
|
assert(Array.isArray(values));
|
2016-10-07 13:14:27 -07:00
|
|
|
|
2022-02-04 13:58:29 -08:00
|
|
|
return;
|
2016-10-07 13:14:27 -07:00
|
|
|
}
|
|
|
|
|
|
2022-02-03 16:15:14 -08:00
|
|
|
async function wait(domainObject, location, type, value, options) {
|
2019-01-04 18:44:54 -08:00
|
|
|
assert.strictEqual(typeof domainObject, 'object');
|
|
|
|
|
assert.strictEqual(typeof location, 'string');
|
2018-09-11 19:09:30 -07:00
|
|
|
assert.strictEqual(typeof type, 'string');
|
2018-02-08 14:19:14 -08:00
|
|
|
assert.strictEqual(typeof value, 'string');
|
2016-12-14 13:22:54 -08:00
|
|
|
assert(options && typeof options === 'object'); // { interval: 5000, times: 50000 }
|
|
|
|
|
|
2022-02-03 16:15:14 -08:00
|
|
|
// do nothing
|
2016-12-14 13:22:54 -08:00
|
|
|
}
|
|
|
|
|
|
2022-02-04 13:58:29 -08:00
|
|
|
async function verifyDomainConfig(domainObject) {
|
2019-01-04 18:44:54 -08:00
|
|
|
assert.strictEqual(typeof domainObject, 'object');
|
2017-01-10 11:13:33 +01:00
|
|
|
|
2022-02-04 13:58:29 -08:00
|
|
|
return {};
|
2017-01-10 11:13:33 +01:00
|
|
|
}
|