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

PowerDNS / pdns / 12595591960

03 Jan 2025 09:27AM UTC coverage: 62.774% (+2.5%) from 60.245%
12595591960

Pull #15008

github

web-flow
Merge c2a2749d3 into 788f396a7
Pull Request #15008: Do not follow CNAME records for ANY or CNAME queries

30393 of 78644 branches covered (38.65%)

Branch coverage included in aggregate %.

105822 of 138350 relevant lines covered (76.49%)

4613078.44 hits per line

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

0.0
/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<DNSName, 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
  {
×
45
    static const std::array<const string, 3> types = {"none", "producer", "consumer"};
×
46
    return types.at(type);
×
47
  }
×
48

49
  CatalogInfo() :
50
    d_id(0), d_type(CatalogType::None) {}
×
51
  CatalogInfo(uint32_t id, const DNSName& zone, const std::string& options, CatalogType type)
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; }
×
61

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

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

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

77
private:
78
  CatalogType d_type;
79
  json11::Json d_doc;
80
};
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