"presigned": <bool>,
"soa_edit": "<string>",
"soa_edit_api": "<string>",
+ "account": "<string>",
"nameservers": ["<string>", ...],
"servers": ["<string>", ...],
"recursion_desired": <bool>,
the SOA-EDIT-API rules. (Which are the same as the SOA-EDIT rules.)
**Note**: Authoritative only.
+* `account` MAY be set. It's value is defined by local policy.
+ **Note**: Authoritative only.
+
* `notified_serial`, `serial` MUST NOT be sent in client bodies.
**Note**: Authoritative only.
declare(suffix,"master-zone-query","Data", "select master from domains where name=? and type='SLAVE'");
- declare(suffix,"info-zone-query","","select id,name,master,last_check,notified_serial,type from domains where name=?");
+ declare(suffix,"info-zone-query","","select id,name,master,last_check,notified_serial,type,account from domains where name=?");
declare(suffix,"info-all-slaves-query","","select id,name,master,last_check,type from domains where type='SLAVE'");
declare(suffix,"supermaster-query","", "select account from supermasters where ip=? and nameserver=?");
declare(suffix,"delete-tsig-key-query","", "delete from tsigkeys where name=?");
declare(suffix,"get-tsig-keys-query","", "select name,algorithm, secret from tsigkeys");
- declare(suffix, "get-all-domains-query", "Retrieve all domains", "select domains.id, domains.name, records.content, domains.type, domains.master, domains.notified_serial, domains.last_check from domains LEFT JOIN records ON records.domain_id=domains.id AND records.type='SOA' AND records.name=domains.name WHERE records.disabled=0 OR ?");
+ declare(suffix, "get-all-domains-query", "Retrieve all domains", "select domains.id, domains.name, records.content, domains.type, domains.master, domains.notified_serial, domains.last_check, domains.account from domains LEFT JOIN records ON records.domain_id=domains.id AND records.type='SOA' AND records.name=domains.name WHERE records.disabled=0 OR ?");
declare(suffix, "list-comments-query", "", "SELECT domain_id,name,type,modified_at,account,comment FROM comments WHERE domain_id=?");
declare(suffix, "insert-comment-query", "", "INSERT INTO comments (domain_id, name, type, modified_at, account, comment) VALUES (?, ?, ?, ?, ?, ?)");
declare(suffix,"master-zone-query","Data", "select master from domains where name=$1 and type='SLAVE'");
- declare(suffix,"info-zone-query","","select id,name,master,last_check,notified_serial,type from domains where name=$1");
+ declare(suffix,"info-zone-query","","select id,name,master,last_check,notified_serial,type,account from domains where name=$1");
declare(suffix,"info-all-slaves-query","","select id,name,master,last_check,type from domains where type='SLAVE'");
declare(suffix,"supermaster-query","", "select account from supermasters where ip=$1 and nameserver=$2");
declare(suffix,"delete-tsig-key-query","", "delete from tsigkeys where name=$1");
declare(suffix,"get-tsig-keys-query","", "select name,algorithm, secret from tsigkeys");
- declare(suffix, "get-all-domains-query", "Retrieve all domains", "select domains.id, domains.name, records.content, domains.type, domains.master, domains.notified_serial, domains.last_check from domains LEFT JOIN records ON records.domain_id=domains.id AND records.type='SOA' AND records.name=domains.name WHERE records.disabled=false OR $1");
+ declare(suffix, "get-all-domains-query", "Retrieve all domains", "select domains.id, domains.name, records.content, domains.type, domains.master, domains.notified_serial, domains.last_check, domains.account from domains LEFT JOIN records ON records.domain_id=domains.id AND records.type='SOA' AND records.name=domains.name WHERE records.disabled=false OR $1");
declare(suffix, "list-comments-query", "", "SELECT domain_id,name,type,modified_at,account,comment FROM comments WHERE domain_id=$1");
declare(suffix, "insert-comment-query", "", "INSERT INTO comments (domain_id, name, type, modified_at, account, comment) VALUES ($1, $2, $3, $4, $5, $6)");
declare(suffix, "master-zone-query", "Data", "select master from domains where name=:domain and type='SLAVE'");
- declare(suffix, "info-zone-query", "","select id,name,master,last_check,notified_serial,type from domains where name=:domain");
+ declare(suffix, "info-zone-query", "","select id,name,master,last_check,notified_serial,type,account from domains where name=:domain");
declare(suffix, "info-all-slaves-query", "","select id,name,master,last_check,type from domains where type='SLAVE'");
declare(suffix, "supermaster-query", "", "select account from supermasters where ip=:ip and nameserver=:nameserver");
declare(suffix, "delete-tsig-key-query","", "delete from tsigkeys where name=:key_name");
declare(suffix, "get-tsig-keys-query","", "select name,algorithm, secret from tsigkeys");
- declare(suffix, "get-all-domains-query", "Retrieve all domains", "select domains.id, domains.name, records.content, domains.type, domains.master, domains.notified_serial, domains.last_check from domains LEFT JOIN records ON records.domain_id=domains.id AND records.type='SOA' AND records.name=domains.name WHERE records.disabled=0 OR :include_disabled");
+ declare(suffix, "get-all-domains-query", "Retrieve all domains", "select domains.id, domains.name, records.content, domains.type, domains.master, domains.notified_serial, domains.last_check, domains.account from domains LEFT JOIN records ON records.domain_id=domains.id AND records.type='SOA' AND records.name=domains.name WHERE records.disabled=0 OR :include_disabled");
declare(suffix, "list-comments-query", "", "SELECT domain_id,name,type,modified_at,account,comment FROM comments WHERE domain_id=:domain_id");
declare(suffix, "insert-comment-query", "", "INSERT INTO comments (domain_id, name, type, modified_at, account, comment) VALUES (:domain_id, :qname, :qtype, :modified_at, :account, :content)");
bool GSQLBackend::getDomainInfo(const string &domain, DomainInfo &di)
{
/* fill DomainInfo from database info:
- id,name,master IP(s),last_check,notified_serial,type */
+ id,name,master IP(s),last_check,notified_serial,type,account */
try {
d_InfoOfDomainsZoneQuery_stmt->
bind("domain", toLower(domain))->
di.last_check=atol(d_result[0][3].c_str());
di.notified_serial = atol(d_result[0][4].c_str());
string type=d_result[0][5];
+ di.account=d_result[0][6];
di.backend=this;
di.serial = 0;
if (!row[4].empty()) {
stringtok(di.masters, row[4], " ,\t");
}
- di.last_check=atol(row[6].c_str());
-
+
SOAData sd;
fillSOAData(row[2], sd);
di.serial = sd.serial;
if (!row[5].empty()) {
di.notified_serial = atol(row[5].c_str());
}
-
+ di.last_check = atol(row[6].c_str());
+ di.account = row[7];
+
if (pdns_iequals(row[3], "MASTER"))
di.kind = DomainInfo::Master;
else if (pdns_iequals(row[3], "SLAVE"))
uint32_t notified_serial;
uint32_t serial;
time_t last_check;
+ string account;
enum DomainKind { Master, Slave, Native } kind;
DNSBackend *backend;
doc.AddMember("type", "Zone", doc.GetAllocator());
doc.AddMember("kind", di.getKindString(), doc.GetAllocator());
doc.AddMember("dnssec", dk.isSecuredZone(di.zone), doc.GetAllocator());
+ doc.AddMember("account", di.account.c_str(), doc.GetAllocator());
string soa_edit_api;
di.backend->getDomainMetadataOne(zonename, "SOA-EDIT-API", soa_edit_api);
doc.AddMember("soa_edit_api", soa_edit_api.c_str(), doc.GetAllocator());
def test_create_zone(self):
payload, data = self.create_zone(serial=22)
- for k in ('id', 'url', 'name', 'masters', 'kind', 'last_check', 'notified_serial', 'serial', 'soa_edit_api', 'soa_edit'):
+ for k in ('id', 'url', 'name', 'masters', 'kind', 'last_check', 'notified_serial', 'serial', 'soa_edit_api', 'soa_edit', 'account'):
self.assertIn(k, data)
if k in payload:
self.assertEquals(data[k], payload[k])