aboutsummaryrefslogtreecommitdiff
path: root/plugin/file/dnssec_test.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2018-08-29 12:26:22 +0100
committerGravatar GitHub <noreply@github.com> 2018-08-29 12:26:22 +0100
commitba1efee4f1c2258e43b1bd8035ac6d1208675b95 (patch)
tree17ec11d7616120357c2828b6374d02ab081c5e42 /plugin/file/dnssec_test.go
parenteb51e8bac90fac86d34c9e1cb89b04ea0936b034 (diff)
downloadcoredns-ba1efee4f1c2258e43b1bd8035ac6d1208675b95.tar.gz
coredns-ba1efee4f1c2258e43b1bd8035ac6d1208675b95.tar.zst
coredns-ba1efee4f1c2258e43b1bd8035ac6d1208675b95.zip
Default to scrubbing replies in the server (#2012)
Every plugin needs to deal with EDNS0 and should call Scrub to make a message fit the client's buffer. Move this functionality into the server and wrapping the ResponseWriter into a ScrubWriter that handles these bits for us. Result: Less code and faster, because multiple chained plugins could all be calling scrub and SizeAndDo - now there is just one place. Most tests in file/* and dnssec/* needed adjusting because in those unit tests you don't see OPT RRs anymore. The DNSSEC signer was also looking at the returned OPT RR to see if it needed to sign - as those are now added by the server (and thus later), this needed to change slightly. Scrub itself still exist (for backward compat reasons), but has been made a noop. Scrub has been renamed to scrub as it should not be used by external plugins. Fixes: #2010 Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/file/dnssec_test.go')
-rw-r--r--plugin/file/dnssec_test.go18
1 files changed, 4 insertions, 14 deletions
diff --git a/plugin/file/dnssec_test.go b/plugin/file/dnssec_test.go
index 29cd9a61e..fee39a37a 100644
--- a/plugin/file/dnssec_test.go
+++ b/plugin/file/dnssec_test.go
@@ -11,6 +11,7 @@ import (
"github.com/miekg/dns"
)
+// All OPT RR are added in server.go, so we don't specify them in the unit tests.
var dnssecTestCases = []test.Case{
{
Qname: "miek.nl.", Qtype: dns.TypeSOA, Do: true,
@@ -18,8 +19,7 @@ var dnssecTestCases = []test.Case{
test.RRSIG("miek.nl. 1800 IN RRSIG SOA 8 2 1800 20160426031301 20160327031301 12051 miek.nl. FIrzy07acBbtyQczy1dc="),
test.SOA("miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1282630057 14400 3600 604800 14400"),
},
- Ns: auth,
- Extra: []dns.RR{test.OPT(4096, true)},
+ Ns: auth,
},
{
Qname: "miek.nl.", Qtype: dns.TypeAAAA, Do: true,
@@ -27,8 +27,7 @@ var dnssecTestCases = []test.Case{
test.AAAA("miek.nl. 1800 IN AAAA 2a01:7e00::f03c:91ff:fef1:6735"),
test.RRSIG("miek.nl. 1800 IN RRSIG AAAA 8 2 1800 20160426031301 20160327031301 12051 miek.nl. SsRT="),
},
- Ns: auth,
- Extra: []dns.RR{test.OPT(4096, true)},
+ Ns: auth,
},
{
Qname: "miek.nl.", Qtype: dns.TypeNS, Do: true,
@@ -39,7 +38,6 @@ var dnssecTestCases = []test.Case{
test.NS("miek.nl. 1800 IN NS omval.tednet.nl."),
test.RRSIG("miek.nl. 1800 IN RRSIG NS 8 2 1800 20160426031301 20160327031301 12051 miek.nl. ZLtsQhwaz+lHfNpztFoR1Vxs="),
},
- Extra: []dns.RR{test.OPT(4096, true)},
},
{
Qname: "miek.nl.", Qtype: dns.TypeMX, Do: true,
@@ -51,8 +49,7 @@ var dnssecTestCases = []test.Case{
test.MX("miek.nl. 1800 IN MX 5 alt2.aspmx.l.google.com."),
test.RRSIG("miek.nl. 1800 IN RRSIG MX 8 2 1800 20160426031301 20160327031301 12051 miek.nl. kLqG+iOr="),
},
- Ns: auth,
- Extra: []dns.RR{test.OPT(4096, true)},
+ Ns: auth,
},
{
Qname: "www.miek.nl.", Qtype: dns.TypeA, Do: true,
@@ -63,9 +60,6 @@ var dnssecTestCases = []test.Case{
test.RRSIG("www.miek.nl. 1800 RRSIG CNAME 8 3 1800 20160426031301 20160327031301 12051 miek.nl. NVZmMJaypS+wDL2Lar4Zw1zF"),
},
Ns: auth,
- Extra: []dns.RR{
- test.OPT(4096, true),
- },
},
{
// NoData
@@ -76,7 +70,6 @@ var dnssecTestCases = []test.Case{
test.RRSIG("miek.nl. 1800 IN RRSIG SOA 8 2 1800 20160426031301 20160327031301 12051 miek.nl. FIrzy07acBbtyQczy1dc="),
test.SOA("miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1282630057 14400 3600 604800 14400"),
},
- Extra: []dns.RR{test.OPT(4096, true)},
},
{
Qname: "b.miek.nl.", Qtype: dns.TypeA, Do: true,
@@ -89,7 +82,6 @@ var dnssecTestCases = []test.Case{
test.RRSIG("miek.nl. 1800 IN RRSIG SOA 8 2 1800 20160426031301 20160327031301 12051 miek.nl. FIrzy07acBbtyQczy1dc="),
test.SOA("miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1282630057 14400 3600 604800 14400"),
},
- Extra: []dns.RR{test.OPT(4096, true)},
},
{
Qname: "b.blaat.miek.nl.", Qtype: dns.TypeA, Do: true,
@@ -102,7 +94,6 @@ var dnssecTestCases = []test.Case{
test.RRSIG("miek.nl. 1800 IN RRSIG SOA 8 2 1800 20160426031301 20160327031301 12051 miek.nl. FIrzy07acBbtyQczy1dc="),
test.SOA("miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1282630057 14400 3600 604800 14400"),
},
- Extra: []dns.RR{test.OPT(4096, true)},
},
{
Qname: "b.a.miek.nl.", Qtype: dns.TypeA, Do: true,
@@ -114,7 +105,6 @@ var dnssecTestCases = []test.Case{
test.RRSIG("miek.nl. 1800 IN RRSIG SOA 8 2 1800 20160426031301 20160327031301 12051 miek.nl. FIrzy07acBbtyQczy1dc="),
test.SOA("miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1282630057 14400 3600 604800 14400"),
},
- Extra: []dns.RR{test.OPT(4096, true)},
},
}
w-blog-template Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/packages/integrations/deno (unfollow)
AgeCommit message (Expand)AuthorFilesLines