fix: align admin behavior and Kratos integrations

This commit is contained in:
2026-08-14 14:14:51 +08:00
parent 8c4c6ba661
commit e0b0e1d8c8
123 changed files with 4334 additions and 1877 deletions
+17
View File
@@ -0,0 +1,17 @@
package service
import (
"net"
"testing"
)
func TestPrivateIP(t *testing.T) {
for _, value := range []string{"127.0.0.1", "10.0.0.1", "172.16.0.1", "192.168.1.1", "169.254.1.1", "::1"} {
if !privateIP(net.ParseIP(value)) {
t.Fatalf("expected %s to be private", value)
}
}
if privateIP(net.ParseIP("8.8.8.8")) {
t.Fatal("public IP was classified as private")
}
}