From 3a0f6fddb5152bbb3b6b065ac9791c04dbfedc0f Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Thu, 9 May 2019 14:08:10 +0200 Subject: [PATCH] API: Mark set-ptr as deprecated --- docs/common/api/zone.rst | 1 + docs/http-api/swagger/authoritative-api-swagger.yaml | 2 +- pdns/ws-auth.cc | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/common/api/zone.rst b/docs/common/api/zone.rst index 0bbda86c5..8e26bbe6c 100644 --- a/docs/common/api/zone.rst +++ b/docs/common/api/zone.rst @@ -22,6 +22,7 @@ RREntry :property string content: The content of this record :property bool disabled: Whether or not this record is disabled :property bool set-ptr: If set to true, the server will find the matching reverse zone and create a PTR there. Existing PTR records are replaced. If no matching reverse :json:object:`Zone`, an error is thrown. Only valid in client bodies, only valid for A and AAAA types. Not returned by the server. + This feature (set-ptr) is deprecated and will be removed in 4.3.0. Comment diff --git a/docs/http-api/swagger/authoritative-api-swagger.yaml b/docs/http-api/swagger/authoritative-api-swagger.yaml index 63fcb3c4d..fa0fe9528 100644 --- a/docs/http-api/swagger/authoritative-api-swagger.yaml +++ b/docs/http-api/swagger/authoritative-api-swagger.yaml @@ -1024,7 +1024,7 @@ definitions: description: 'Whether or not this record is disabled' set-ptr: type: boolean - description: 'If set to true, the server will find the matching reverse zone and create a PTR there. Existing PTR records are replaced. If no matching reverse Zone, an error is thrown. Only valid in client bodies, only valid for A and AAAA types. Not returned by the server.' + description: 'If set to true, the server will find the matching reverse zone and create a PTR there. Existing PTR records are replaced. If no matching reverse Zone, an error is thrown. Only valid in client bodies, only valid for A and AAAA types. Not returned by the server. This feature is deprecated and will be removed in 4.3.0.' Comment: title: Comment diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index e3f32a509..7f5d1b7cd 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -522,7 +522,7 @@ static void validateGatheredRRType(const DNSResourceRecord& rr) { } } -static void gatherRecords(const Json container, const DNSName& qname, const QType qtype, const int ttl, vector& new_records, vector& new_ptrs) { +static void gatherRecords(const string& logprefix, const Json container, const DNSName& qname, const QType qtype, const int ttl, vector& new_records, vector& new_ptrs) { UeberBackend B; DNSResourceRecord rr; rr.qname = qname; @@ -558,6 +558,9 @@ static void gatherRecords(const Json container, const DNSName& qname, const QTyp if ((rr.qtype.getCode() == QType::A || rr.qtype.getCode() == QType::AAAA) && boolFromJson(record, "set-ptr", false) == true) { + + g_log<logprefix, rrset, qname, qtype, ttl, new_records, new_ptrs); } if (rrset["comments"].is_array()) { gatherComments(rrset, qname, qtype, new_comments); @@ -1983,7 +1986,7 @@ static void patchZone(HttpRequest* req, HttpResponse* resp) { // ttl shouldn't be part of DELETE, and it shouldn't be required if we don't get new records. int ttl = intFromJson(rrset, "ttl"); // new_ptrs is merged. - gatherRecords(rrset, qname, qtype, ttl, new_records, new_ptrs); + gatherRecords(req->logprefix, rrset, qname, qtype, ttl, new_records, new_ptrs); for(DNSResourceRecord& rr : new_records) { rr.domain_id = di.id; -- 2.40.0