From 2a99df0588e168660d3b528209d8f51689ca92b7 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Fri, 7 Jul 2023 16:17:39 +0200 Subject: [feature] enable + document explicit IP dialer allowing/denying (#1950) * [feature] enable + document explicit IP dialer allowing/denying * lord have mercy * allee jonge * shortcut check ipv6 prefixes * comment * separate httpclient_test, export Sanitizer --- internal/netutil/validate_test.go | 54 --------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 internal/netutil/validate_test.go (limited to 'internal/netutil/validate_test.go') diff --git a/internal/netutil/validate_test.go b/internal/netutil/validate_test.go deleted file mode 100644 index 37def4ce6..000000000 --- a/internal/netutil/validate_test.go +++ /dev/null @@ -1,54 +0,0 @@ -package netutil - -import ( - "net/netip" - "testing" -) - -func TestValidateIP(t *testing.T) { - tests := []struct { - name string - ip netip.Addr - }{ - // IPv4 tests - { - name: "IPv4 this host on this network", - ip: netip.MustParseAddr("0.0.0.0"), - }, - { - name: "IPv4 dummy address", - ip: netip.MustParseAddr("192.0.0.8"), - }, - { - name: "IPv4 Port Control Protocol Anycast", - ip: netip.MustParseAddr("192.0.0.9"), - }, - { - name: "IPv4 Traversal Using Relays around NAT Anycast", - ip: netip.MustParseAddr("192.0.0.10"), - }, - { - name: "IPv4 NAT64/DNS64 Discovery 1", - ip: netip.MustParseAddr("192.0.0.17"), - }, - { - name: "IPv4 NAT64/DNS64 Discovery 2", - ip: netip.MustParseAddr("192.0.0.171"), - }, - // IPv6 tests - { - name: "IPv4-mapped address", - ip: netip.MustParseAddr("::ffff:169.254.169.254"), - }, - } - - for _, tc := range tests { - tc := tc - t.Run(tc.name, func(t *testing.T) { - t.Parallel() - if valid := ValidateIP(tc.ip); valid != false { - t.Fatalf("Expected IP %s to be: %t, got: %t", tc.ip, false, valid) - } - }) - } -} -- cgit v1.2.3