plugin/tls: manage certificates with ACME DNS-01 (#8310)

* plugin/tls: add automatic ACME certificates

Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>

* chore: add houyuwushang to CODEOWNERS

Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>

* chore: regenerate maintainer owners

Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>

---------

Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
This commit is contained in:
houyuwushang
2026-07-30 10:24:22 +08:00
committed by GitHub
parent 03260d5b67
commit 546fac83ea
13 changed files with 1369 additions and 73 deletions

View File

@@ -4,6 +4,7 @@ import (
"testing"
"github.com/coredns/caddy"
"github.com/coredns/coredns/plugin"
)
func TestKeyForConfig(t *testing.T) {
@@ -65,3 +66,26 @@ func TestGetConfig(t *testing.T) {
}
})
}
func TestAddPluginToAllServerBlocks(t *testing.T) {
c := caddy.NewTestController("dns", "")
ctx := c.Context().(*dnsContext)
first := &Config{}
secondZone := &Config{firstConfigInBlock: first}
third := &Config{}
first.firstConfigInBlock = first
third.firstConfigInBlock = third
ctx.configs = []*Config{first, secondZone, third}
AddPluginToAllServerBlocks(c, func(next plugin.Handler) plugin.Handler { return next })
if got := len(first.Plugin); got != 1 {
t.Fatalf("first server block has %d plugins, want 1", got)
}
if got := len(secondZone.Plugin); got != 0 {
t.Fatalf("secondary zone has %d plugins before propagation, want 0", got)
}
if got := len(third.Plugin); got != 1 {
t.Fatalf("second server block has %d plugins, want 1", got)
}
}