From: Pieter Lexis Date: Mon, 16 Oct 2017 09:37:26 +0000 (+0200) Subject: API: Fully boolify api_rectify X-Git-Tag: rec-4.1.0-rc2~36^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c00908f1e29a97047fe7d6040729bb34625598f8;p=pdns API: Fully boolify api_rectify --- diff --git a/docs/http-api/zone.rst b/docs/http-api/zone.rst index 282f7d2f7..2a6acd517 100644 --- a/docs/http-api/zone.rst +++ b/docs/http-api/zone.rst @@ -38,7 +38,7 @@ Comments are per-RRset. Switching ``dnssec`` to ``true`` (from ``false``) sets up DNSSEC signing based on the other flags, this includes running the equivalent of - ``secure-zone`` and ``rectify-zone`` (if ``api_rectify`` is set to "1"). + ``secure-zone`` and ``rectify-zone`` (if ``api_rectify`` is set to ``true``). This also applies to newly created zones. If ``presigned`` is ``true``, no DNSSEC changes will be made to the zone or cryptokeys. diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index 9d22bd718..02dfbb338 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -564,9 +564,12 @@ static void updateDomainSettingsFromDocument(UeberBackend& B, const DomainInfo& if (document["soa_edit"].is_string()) { di.backend->setDomainMetadataOne(zonename, "SOA-EDIT", document["soa_edit"].string_value()); } - if (document["api_rectify"].is_string()) { - di.backend->setDomainMetadataOne(zonename, "API-RECTIFY", document["api_rectify"].string_value()); + try { + bool api_rectify = boolFromJson(document, "api_rectify"); + di.backend->setDomainMetadataOne(zonename, "API-RECTIFY", api_rectify ? "1" : "0"); } + catch (JsonException) {} + if (document["account"].is_string()) { di.backend->setAccount(zonename, document["account"].string_value()); }