• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PowerDNS / pdns / 18776176249

24 Oct 2025 09:51AM UTC coverage: 73.028% (+15.6%) from 57.383%
18776176249

Pull #16370

github

web-flow
Merge 0f309894e into 39f7f1b27
Pull Request #16370: auth: xfr churning

38273 of 63104 branches covered (60.65%)

Branch coverage included in aggregate %.

186 of 264 new or added lines in 1 file covered. (70.45%)

14471 existing lines in 217 files now uncovered.

127487 of 163878 relevant lines covered (77.79%)

5632363.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/pdns/auth-catalogzone.hh
1
/*
2
 * This file is part of PowerDNS or dnsdist.
3
 * Copyright -- PowerDNS.COM B.V. and its contributors
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of version 2 of the GNU General Public License as
7
 * published by the Free Software Foundation.
8
 *
9
 * In addition, for the avoidance of any doubt, permission is granted to
10
 * link this program with OpenSSL and to (re)distribute the binaries
11
 * produced as the result of such linking.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
 */
22

23
#pragma once
24

25
#include "ext/json11/json11.hpp"
26
#include "base32.hh"
27
#include "dnssecinfra.hh"
28

29
struct DomainInfo;
30

31
typedef map<ZoneName, pdns::SHADigest> CatalogHashMap;
32

33
class CatalogInfo
34
{
35
public:
36
  enum CatalogType : uint8_t
37
  {
38
    None,
39
    Producer,
40
    Consumer
41
  };
42

43
  static const string& getTypeString(enum CatalogType type)
44
  {
640✔
45
    static const std::array<const string, 3> types = {"none", "producer", "consumer"};
640✔
46
    return types.at(type);
640✔
47
  }
640✔
48

49
  CatalogInfo() :
50
    d_id(0), d_type(CatalogType::None) {}
1,058✔
51
  CatalogInfo(uint32_t id, const ZoneName& zone, const std::string& options, CatalogType type)
UNCOV
52
  {
×
53
    d_id = id;
×
54
    d_zone = zone;
×
55
    fromJson(options, type);
×
56
  }
×
57

58
  void fromJson(const std::string& json, CatalogType type);
59
  std::string toJson() const;
60
  void setType(CatalogType type) { d_type = type; }
200✔
61

62
  void updateHash(CatalogHashMap& hashes, const DomainInfo& di) const;
63
  DNSName getUnique() const { return DNSName(toBase32Hex(hashQNameWithSalt(std::to_string(d_id), 0, DNSName(d_zone)))); } // salt with domain id to detect recreated zones
564✔
64
  static DNSZoneRecord getCatalogVersionRecord(const ZoneName& zone);
65
  void toDNSZoneRecords(const ZoneName& zone, vector<DNSZoneRecord>& dzrs) const;
66

67
  bool operator<(const CatalogInfo& rhs) const
68
  {
1,256✔
69
    return d_zone < rhs.d_zone;
1,256✔
70
  }
1,256✔
71

72
  uint32_t d_id;
73
  ZoneName d_zone;
74
  DNSName d_coo, d_unique;
75
  std::set<std::string> d_group;
76
  vector<ComboAddress> d_primaries;
77

78
private:
79
  CatalogType d_type;
80
  json11::Json d_doc;
81
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc