client: update DNSConfig type (#8916)

This PR adds DNSFilterURL to the DNSConfig type to be used by
control changes to add DNS filtering logic

Fixes #cleanup

Signed-off-by: Richard Castro <richard@tailscale.com>
This commit is contained in:
Richard Castro 2023-08-16 14:54:17 -07:00 committed by GitHub
parent 37c0b9be63
commit 57da1f1501
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 0 deletions

View File

@ -10,6 +10,7 @@ type DNSConfig struct {
Domains []string `json:"domains"` Domains []string `json:"domains"`
Nameservers []string `json:"nameservers"` Nameservers []string `json:"nameservers"`
Proxied bool `json:"proxied"` Proxied bool `json:"proxied"`
DNSFilterURL string `json:"DNSFilterURL"`
} }
type DNSResolver struct { type DNSResolver struct {

View File

@ -1403,6 +1403,8 @@ type DNSConfig struct {
// //
// Matches are case insensitive. // Matches are case insensitive.
ExitNodeFilteredSet []string `json:",omitempty"` ExitNodeFilteredSet []string `json:",omitempty"`
// DNSFilterURL contains a user inputed URL that should have a list of domains to be blocked
DNSFilterURL string `json:",omitempty"`
} }
// DNSRecord is an extra DNS record to add to MagicDNS. // DNSRecord is an extra DNS record to add to MagicDNS.

View File

@ -261,6 +261,7 @@ func (src *DNSConfig) Clone() *DNSConfig {
CertDomains []string CertDomains []string
ExtraRecords []DNSRecord ExtraRecords []DNSRecord
ExitNodeFilteredSet []string ExitNodeFilteredSet []string
DNSFilterURL string
}{}) }{})
// Clone makes a deep copy of RegisterResponse. // Clone makes a deep copy of RegisterResponse.

View File

@ -557,6 +557,7 @@ func (v DNSConfigView) ExtraRecords() views.Slice[DNSRecord] { return views.Slic
func (v DNSConfigView) ExitNodeFilteredSet() views.Slice[string] { func (v DNSConfigView) ExitNodeFilteredSet() views.Slice[string] {
return views.SliceOf(v.ж.ExitNodeFilteredSet) return views.SliceOf(v.ж.ExitNodeFilteredSet)
} }
func (v DNSConfigView) DNSFilterURL() string { return v.ж.DNSFilterURL }
// A compilation failure here means this code must be regenerated, with the command at the top of this file. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _DNSConfigViewNeedsRegeneration = DNSConfig(struct { var _DNSConfigViewNeedsRegeneration = DNSConfig(struct {
@ -569,6 +570,7 @@ func (v DNSConfigView) ExitNodeFilteredSet() views.Slice[string] {
CertDomains []string CertDomains []string
ExtraRecords []DNSRecord ExtraRecords []DNSRecord
ExitNodeFilteredSet []string ExitNodeFilteredSet []string
DNSFilterURL string
}{}) }{})
// View returns a readonly view of RegisterResponse. // View returns a readonly view of RegisterResponse.