Files
cloudron-box/src/dns/noop.js
T

67 lines
1.8 KiB
JavaScript
Raw Normal View History

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
function removePrivateFields(domainObject) {
return domainObject;
}
2019-10-23 10:02:04 -07:00
// eslint-disable-next-line no-unused-vars
function injectPrivateFields(newConfig, currentConfig) {
}
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
return;
2016-10-07 13:14:27 -07: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');
return []; // returning ip confuses apptask into thinking the entry already exists
2016-10-07 13:14:27 -07: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
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');
assert(options && typeof options === 'object'); // { interval: 5000, times: 50000 }
2022-02-03 16:15:14 -08:00
// do nothing
}
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
return {};
2017-01-10 11:13:33 +01:00
}