Add Migadu domain admin with shared lists, compaction, and safer apply.
Build the Go API and React UI for managing domain denylist/allowlist/recipient deny and spam settings, plus shared lists that import/apply across domains with wildcard compaction, entry verification, and Migadu-friendly list encoding (including per-domain recipient filtering and rejection bisect on apply).
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"net"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestIsTrustedProxy(t *testing.T) {
|
||||
cfg := &Config{}
|
||||
networks, err := parseCIDRs("10.0.0.0/8,127.0.0.1")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
cfg.TrustedProxies = networks
|
||||
|
||||
if !cfg.IsTrustedProxy(net.ParseIP("10.1.2.3")) {
|
||||
t.Fatal("expected 10.1.2.3 trusted")
|
||||
}
|
||||
if !cfg.IsTrustedProxy(net.ParseIP("127.0.0.1")) {
|
||||
t.Fatal("expected 127.0.0.1 trusted")
|
||||
}
|
||||
if cfg.IsTrustedProxy(net.ParseIP("192.168.1.1")) {
|
||||
t.Fatal("expected 192.168.1.1 untrusted")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user