]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth api: clear domain metadata cache after setting or deleting it
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 25 Mar 2021 11:16:19 +0000 (12:16 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 25 Mar 2021 11:16:19 +0000 (12:16 +0100)
pdns/ws-auth.cc

index 86e2c0ba2c8111f122c118d4e665092134962c11..edf3bd5030faddc08caa7cc02fbeec5cf5de825e 100644 (file)
@@ -967,6 +967,8 @@ static void apiZoneMetadata(HttpRequest* req, HttpResponse *resp) {
       throw ApiException("Could not update metadata entries for domain '" +
         zonename.toString() + "'");
 
+    DNSSECKeeper::clearMetaCache(zonename);
+
     Json::array respMetadata;
     for (const string& s : vecMetadata)
       respMetadata.push_back(s);
@@ -1032,6 +1034,8 @@ static void apiZoneMetadataKind(HttpRequest* req, HttpResponse* resp) {
     if (!B.setDomainMetadata(zonename, kind, vecMetadata))
       throw ApiException("Could not update metadata entries for domain '" + zonename.toString() + "'");
 
+    DNSSECKeeper::clearMetaCache(zonename);
+
     Json::object key {
       { "type", "Metadata" },
       { "kind", kind },
@@ -1046,6 +1050,8 @@ static void apiZoneMetadataKind(HttpRequest* req, HttpResponse* resp) {
     vector<string> md;  // an empty vector will do it
     if (!B.setDomainMetadata(zonename, kind, md))
       throw ApiException("Could not delete metadata for domain '" + zonename.toString() + "' (" + kind + ")");
+
+    DNSSECKeeper::clearMetaCache(zonename);
   } else
     throw HttpMethodNotAllowedException();
 }