Skip to content

Commit

Permalink
auth api: flush all caches when flushing
Browse files Browse the repository at this point in the history
So far we never flushed the DNSSEC caches, except when DELETEing a domain.
However clearly some operations can affect the DNSSEC settings, and then the
caches should go.

Also do this for the flush API, to be consistent, and for users writing to the
DNSSEC settings/data externally.
  • Loading branch information
zeha committed Dec 6, 2023
1 parent 95e7f67 commit 8f52c7a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pdns/ws-auth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2044,6 +2044,7 @@ static void apiServerZoneDetail(HttpRequest* req, HttpResponse* resp) {
updateDomainSettingsFromDocument(B, di, zonename, document, zoneWasModified);
di.backend->commitTransaction();

DNSSECKeeper::clearCaches(zonename);
purgeAuthCaches(zonename.toString() + "$");

resp->body = "";
Expand Down Expand Up @@ -2369,6 +2370,7 @@ static void patchZone(UeberBackend& B, HttpRequest* req, HttpResponse* resp) //

di.backend->commitTransaction();

DNSSECKeeper::clearCaches(zonename);
purgeAuthCaches(zonename.toString() + "$");

resp->body = "";
Expand Down Expand Up @@ -2503,6 +2505,7 @@ static void apiServerCacheFlush(HttpRequest* req, HttpResponse* resp) {
}
}

DNSSECKeeper::clearCaches(canon);
// purge entire zone from cache, not just zone-level records.
uint64_t count = purgeAuthCaches(canon.toString() + "$");
resp->setJsonBody(Json::object {
Expand Down

0 comments on commit 8f52c7a

Please sign in to comment.