From 722e48feb2aa85d8cb75069a06024e506367e34f Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Tue, 14 Jun 2022 21:20:48 +0200 Subject: add DummyResolver Can be used to disable DNS checks. --- pkg/dns/dns.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'pkg') diff --git a/pkg/dns/dns.go b/pkg/dns/dns.go index 606ce7b..9cac60e 100644 --- a/pkg/dns/dns.go +++ b/pkg/dns/dns.go @@ -31,6 +31,13 @@ func NewDefaultResolver() Verifier { return &DefaultResolver{} } +type DummyResolver struct { +} + +func NewDummyResolver() Verifier { + return &DummyResolver{} +} + func (dr *DefaultResolver) Verify(ctx context.Context, name string, pub *types.PublicKey) error { if err := validPrefix(name); err != nil { return fmt.Errorf("dns: %s", err) @@ -61,3 +68,7 @@ func validPrefix(name string) error { } return nil } + +func (_ *DummyResolver) Verify(_ context.Context, _ string, _ *types.PublicKey) error { + return nil +} -- cgit v1.2.3