]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
API Remove api-readonly from TSIG endpoints
authorPieter Lexis <pieter.lexis@powerdns.com>
Tue, 21 Aug 2018 13:13:42 +0000 (15:13 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Tue, 21 Aug 2018 13:13:42 +0000 (15:13 +0200)
pdns/ws-auth.cc

index 52b52ff3e6c82e011020491fed4a21f0a36bce4c..741a88860885d0f5f302dcfd522a9338c75242ce 100644 (file)
@@ -1345,7 +1345,7 @@ static void apiServerTSIGKeys(HttpRequest* req, HttpResponse* resp) {
       doc.push_back(makeJSONTSIGKey(key, false));
     }
     resp->setBody(doc);
-  } else if (req->method == "POST" && !::arg().mustDo("api-readonly")) {
+  } else if (req->method == "POST") {
     auto document = req->json();
     DNSName keyname(stringFromJson(document, "name"));
     DNSName algo(stringFromJson(document, "algorithm"));
@@ -1396,7 +1396,7 @@ static void apiServerTSIGKeyDetail(HttpRequest* req, HttpResponse* resp) {
 
   if (req->method == "GET") {
     resp->setBody(makeJSONTSIGKey(tsk));
-  } else if (req->method == "PUT" && !::arg().mustDo("api-readonly")) {
+  } else if (req->method == "PUT") {
     json11::Json document;
     if (!req->body.empty()) {
       document = req->json();
@@ -1430,7 +1430,7 @@ static void apiServerTSIGKeyDetail(HttpRequest* req, HttpResponse* resp) {
       }
     }
     resp->setBody(makeJSONTSIGKey(tsk));
-  } else if (req->method == "DELETE" && !::arg().mustDo("api-readonly")) {
+  } else if (req->method == "DELETE") {
     if (!B.deleteTSIGKey(keyname)) {
       throw HttpInternalServerErrorException("Unable to remove TSIG key '" + keyname.toStringNoDot() + "'");
     } else {