]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
API: Mark set-ptr as deprecated 7797/head
authorChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Thu, 9 May 2019 12:08:10 +0000 (14:08 +0200)
committerChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Mon, 13 May 2019 22:51:22 +0000 (00:51 +0200)
docs/common/api/zone.rst
docs/http-api/swagger/authoritative-api-swagger.yaml
pdns/ws-auth.cc

index 0bbda86c50c5fb0722d56760e730871367d54bab..8e26bbe6cb15bcb13c639be3bf8de9e746a2b715 100644 (file)
@@ -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
index 63fcb3c4d65d01a232427a9e8bc7331d2d04bc0c..fa0fe9528bbd319fc024f9c033e762fd49700a79 100644 (file)
@@ -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
index e3f32a5099eb93aea126e64406127e5645db37d2..7f5d1b7cde0554aa521e7329f28268c1ad68dd54 100644 (file)
@@ -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<DNSResourceRecord>& new_records, vector<DNSResourceRecord>& new_ptrs) {
+static void gatherRecords(const string& logprefix, const Json container, const DNSName& qname, const QType qtype, const int ttl, vector<DNSResourceRecord>& new_records, vector<DNSResourceRecord>& 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<<Logger::Warning<<logprefix<<"API call uses deprecated set-ptr feature, please remove it"<<endl;
+
       DNSResourceRecord ptr;
       makePtr(rr, &ptr);
 
@@ -1552,7 +1555,7 @@ static void apiServerZones(HttpRequest* req, HttpResponse* resp) {
         }
         if (rrset["records"].is_array()) {
           int ttl = intFromJson(rrset, "ttl");
-          gatherRecords(rrset, qname, qtype, ttl, new_records, new_ptrs);
+          gatherRecords(req->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;