From: Pieter Lexis Date: Tue, 21 Aug 2018 13:13:42 +0000 (+0200) Subject: API Remove api-readonly from TSIG endpoints X-Git-Tag: auth-4.2.0-alpha1~17^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c69eb3fe7911dcca00cfcb8c158cded9f4a9917;p=thirdparty%2Fpdns.git API Remove api-readonly from TSIG endpoints --- diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index 52b52ff3e6..741a888608 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -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 {