From: Christian Hofstaedtler Date: Wed, 13 Apr 2016 20:18:50 +0000 (+0200) Subject: API: actually set SOA-EDIT-API DEFAULT X-Git-Tag: dnsdist-1.0.0~14^2^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9440a9f054923cea54e1cc5d7c5297fdf12c482d;p=thirdparty%2Fpdns.git API: actually set SOA-EDIT-API DEFAULT --- diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index b103a6efb5..3fd11b9673 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -737,6 +737,11 @@ static void apiServerZones(HttpRequest* req, HttpResponse* resp) { if(!B.getDomainInfo(zonename, di)) throw ApiException("Creating domain '"+zonename.toString()+"' failed: lookup of domain ID failed"); + // updateDomainSettingsFromDocument does NOT fill out the default we've established above. + if (!soa_edit_api_kind.empty()) { + di.backend->setDomainMetadataOne(zonename, "SOA-EDIT-API", soa_edit_api_kind); + } + di.backend->startTransaction(zonename, di.id); for(auto rr : new_records) { diff --git a/regression-tests.api/test_Zones.py b/regression-tests.api/test_Zones.py index 8e2fbc0157..c34353f730 100644 --- a/regression-tests.api/test_Zones.py +++ b/regression-tests.api/test_Zones.py @@ -133,6 +133,11 @@ class AuthZones(ApiTestCase, AuthZonesHelperMixin): if k in payload: self.assertEquals(data[k], payload[k]) + def test_create_zone_default_soa_edit_api(self): + name, payload, data = self.create_zone() + print data + self.assertEquals(data['soa_edit_api'], 'DEFAULT') + def test_create_zone_with_records(self): name = unique_zone_name() rrset = {