]> granicus.if.org Git - pdns/commitdiff
auth API: make disabled optional for Record
authorPieter Lexis <pieter.lexis@powerdns.com>
Fri, 20 Sep 2019 13:21:47 +0000 (15:21 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Fri, 20 Sep 2019 13:23:53 +0000 (15:23 +0200)
`disabled` defaults to false.

docs/http-api/swagger/authoritative-api-swagger.yaml
pdns/ws-auth.cc

index 1d037c5f72091a1931cc309256778d4e2a672dc8..574eebd67e88f5f1cfebc8ca15929d3e650102a1 100644 (file)
@@ -1017,14 +1017,13 @@ definitions:
     description: The RREntry object represents a single record.
     required:
       - content
-      - disabled # PatchZone endpoint complains if this is missing
     properties:
       content:
         type: string
         description: 'The content of this record'
       disabled:
         type: boolean
-        description: 'Whether or not this record is disabled'
+        description: 'Whether or not this record is disabled. When unset, the record is not 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. This feature is deprecated and will be removed in 4.3.0.'
index 32d6fd66f92900a712d0458ad47e37b61b902aa0..c7d1a6e371dd9c781e98d4483a67566ac3552c65 100644 (file)
@@ -537,7 +537,10 @@ static void gatherRecords(const string& logprefix, const Json container, const D
   const auto& items = container["records"].array_items();
   for(const auto& record : items) {
     string content = stringFromJson(record, "content");
-    rr.disabled = boolFromJson(record, "disabled");
+    rr.disabled = false;
+    if(!record["disabled"].is_null()) {
+      rr.disabled = boolFromJson(record, "disabled");
+    }
 
     // validate that the client sent something we can actually parse, and require that data to be dotted.
     try {