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, 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, "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, domains.catalog 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, "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, 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 records.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, domains.catalog 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 records.disabled=?");
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, "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, 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, "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, domains.catalog 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, "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, 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, "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, domains.catalog 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)");
SSqlStatement::row_t row;
while (d_getAllDomainsQuery_stmt->hasNextRow()) {
d_getAllDomainsQuery_stmt->nextRow(row);
- ASSERT_ROW_COLUMNS("get-all-domains-query", row, 8);
+ ASSERT_ROW_COLUMNS("get-all-domains-query", row, 9);
DomainInfo di;
pdns::checked_stoi_into(di.id, row[0]);
try {
di.zone = DNSName(row[1]);
+ di.catalog = (!row[8].empty() ? DNSName(row[8]) : DNSName());
} catch (...) {
continue;
}
print(example_com)
required_fields = ['id', 'url', 'name', 'kind']
if is_auth():
- required_fields = required_fields + ['masters', 'last_check', 'notified_serial', 'serial', 'account']
+ required_fields = required_fields + ['masters', 'last_check', 'notified_serial', 'serial', 'account', 'catalog']
if dnssec:
required_fields = required_fields = ['dnssec', 'edited_serial']
self.assertNotEqual(example_com['serial'], 0)
if k in payload:
self.assertEqual(data[k], payload[k])
+ # check that the catalog is reflected in the /zones output (#13633)
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones"))
+ self.assert_success_json(r)
+ domains = r.json()
+ domain = [domain for domain in domains if domain['name'] == name]
+ self.assertEqual(len(domain), 1)
+ domain = domain[0]
+ self.assertEqual(domain["catalog"], "catalog.invalid.")
+
def test_create_zone_with_account(self):
# soa_edit_api wins over serial
name, payload, data = self.create_zone(account='anaccount', serial=10, kind='Master')
godbc-delete-tsig-key-query=delete from tsigkeys where name=?
godbc-delete-zone-query=delete from records where domain_id=?
godbc-get-all-domain-metadata-query=select kind,content from domains, domainmetadata where domainmetadata.domain_id=domains.id and name=?
-godbc-get-all-domains-query=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 ?
+godbc-get-all-domains-query=select domains.id, domains.name, records.content, domains.type, domains.master, domains.notified_serial, domains.last_check, domains.account, domains.catalog 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 ?
godbc-get-domain-metadata-query=select content from domains, domainmetadata where domainmetadata.domain_id=domains.id and name=? and domainmetadata.kind=?
godbc-get-last-inserted-key-id-query=select last_insert_rowid()
godbc-get-order-after-query=select min(ordername) from records where disabled=0 and ordername > ? and domain_id=? and ordername is not null