Remove support for wildcard ns match domain

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
This commit is contained in:
bcmmbaga
2025-05-22 19:01:53 +03:00
parent 31f0879e71
commit 3e3268db5f
2 changed files with 8 additions and 6 deletions

View File

@@ -18,10 +18,7 @@ import (
"github.com/netbirdio/netbird/management/server/types"
)
const (
domainPattern = `^(?i)[\*a-z0-9]+([\-\.]{1}[a-z0-9]+)*[*.a-z]{1,}$`
maxLabelLen = 63
)
const domainPattern = `^(?i)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*[*.a-z]{1,}$`
var invalidDomainName = errors.New("invalid domain name")

View File

@@ -904,10 +904,15 @@ func TestValidateDomain(t *testing.T) {
errFunc: require.NoError,
},
{
name: "Valid wildcard domain",
domain: "*.example",
name: "Valid domain name with trailing dot",
domain: "example.",
errFunc: require.NoError,
},
{
name: "Invalid wildcard domain name",
domain: "*.example",
errFunc: require.Error,
},
{
name: "Invalid domain name with leading dot",
domain: ".com",