Skip to content

Commit

Permalink
Switch back to serde_yaml
Browse files Browse the repository at this point in the history
Fixes the rec part of PowerDNS#15202
  • Loading branch information
omoerbeek committed Feb 24, 2025
1 parent 6561c48 commit 023bafd
Show file tree
Hide file tree
Showing 6 changed files with 2,764 additions and 2,783 deletions.
40 changes: 11 additions & 29 deletions pdns/recursordist/rec-rust-lib/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pdns/recursordist/rec-rust-lib/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ crate-type = ["staticlib"]
[dependencies]
cxx = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_yaml = { package = "serde_yml", version = "0.0.12" }
serde_yaml = { version = "0.9.34" }
ipnet = "2.8"
once_cell = "1.18.0"
base64 = "0.22"
Expand Down
50 changes: 25 additions & 25 deletions pdns/recursordist/test-settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ BOOST_AUTO_TEST_CASE(test_rust_parse)
- zone: example.net
file: another/file/name
forward_zones:
- zone: '.'
- zone: .
forwarders:
- '9.9.9.9'
- 9.9.9.9
forward_zones_recurse:
- zone: '.'
- zone: .
forwarders:
- '9.9.9.9'
- '1.2.3.4'
- 9.9.9.9
- 1.2.3.4
- ::99
recurse: true
webservice:
Expand Down Expand Up @@ -110,7 +110,7 @@ BOOST_AUTO_TEST_CASE(test_rust_validation_with_error2)
forward_zones:
- zone: "example.com"
forwarders:
- '1.2.3.4'
- 1.2.3.4
- '-a.b'
)EOT";

Expand All @@ -126,7 +126,7 @@ BOOST_AUTO_TEST_CASE(test_rust_validation_with_error3)
forward_zones:
- zone:
forwarders:
- '1.2.3.4'
- 1.2.3.4
)EOT";

BOOST_CHECK_THROW({
Expand Down Expand Up @@ -211,10 +211,10 @@ BOOST_AUTO_TEST_CASE(test_rust_forwardzones_to_yaml)

const std::string expected = R"EOT(- zone: zone1
forwarders:
- '1.2.3.4'
- 1.2.3.4
- zone: zone2
forwarders:
- '1.2.3.4'
- 1.2.3.4
- ::1
recurse: true
notify_allowed: true
Expand All @@ -233,9 +233,9 @@ example1.com= 1.2.3.4, 5.6.7.8; 8.9.0.1

const std::string expected = R"EOT(- zone: example1.com
forwarders:
- '1.2.3.4'
- '5.6.7.8'
- '8.9.0.1'
- 1.2.3.4
- 5.6.7.8
- 8.9.0.1
- zone: example2.com
forwarders:
- ::1
Expand Down Expand Up @@ -908,13 +908,13 @@ BOOST_AUTO_TEST_CASE(test_yaml_to_luaconfigand_back)
{
const std::string yaml = R"EOT(dnssec:
trustanchors:
- name: '.'
- name: .
dsrecords:
- '10000 8 2 a06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d'
- 10000 8 2 a06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
- name: aa.
dsrecords:
- '1234 8 2 a06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d'
- '4567 8 2 b06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d'
- 1234 8 2 a06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
- 4567 8 2 b06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
negative_trustanchors:
- name: aa.
reason: aaa
Expand All @@ -924,24 +924,24 @@ BOOST_AUTO_TEST_CASE(test_yaml_to_luaconfigand_back)
trustanchorfile_interval: 99
incoming:
proxymappings:
- subnet: '1.0.0.0/8'
address: '4.5.6.7'
- subnet: '3.4.5.6/32'
address: '6.7.8.9'
- subnet: 1.0.0.0/8
address: 4.5.6.7
- subnet: 3.4.5.6/32
address: 6.7.8.9
domains:
- a.
- b.
- c.
recursor:
sortlists:
- key: '1.0.0.0/8'
- key: 1.0.0.0/8
subnets:
- subnet: '5.6.7.8/32'
- subnet: 5.6.7.8/32
order: 99
rpzs:
- name: rpz.local
addresses:
- '192.168.178.3:53'
- 192.168.178.3:53
refresh: 10
dumpFile: tmp/rpz.dump
seedFile: tmp/rpz.dump
Expand Down Expand Up @@ -979,7 +979,7 @@ BOOST_AUTO_TEST_CASE(test_yaml_to_luaconfigand_back)
logging:
protobuf_servers:
- servers:
- '1.2.3.4:99'
- 1.2.3.4:99
timeout: 100
maxQueuedEntries: 101
reconnectWaitTime: 102
Expand All @@ -993,7 +993,7 @@ BOOST_AUTO_TEST_CASE(test_yaml_to_luaconfigand_back)
logMappedFrom: true
outgoing_protobuf_servers:
- servers:
- '1.2.3.6:101'
- 1.2.3.6:101
timeout: 100
maxQueuedEntries: 101
reconnectWaitTime: 102
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
incoming:
allow_from_file: ''
allow_from: !override
- '1.2.3.4/32'
- '127.0.0.0/24'
- 1.2.3.4/32, 127.0.0.0/24

Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
incoming:
allow_notify_from_file: ''
allow_notify_from: !override
- '127.0.0.0/24'
- 127.0.0.0/24

Loading

0 comments on commit 023bafd

Please # to comment.