You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2024/05/10 10:51:41 UTC
(incubator-devlake) branch kw-testconn-blacklist-ipv6 created (now 296c4af57)
This is an automated email from the ASF dual-hosted git repository.
klesh pushed a change to branch kw-testconn-blacklist-ipv6
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
at 296c4af57 refactor: add ipv6 test cases for api client blacklist feature
This branch includes the following new commits:
new 296c4af57 refactor: add ipv6 test cases for api client blacklist feature
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(incubator-devlake) 01/01: refactor: add ipv6 test cases for api client blacklist feature
Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch kw-testconn-blacklist-ipv6
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit 296c4af5747f0279904eefde46c4e5cc27384b5f
Author: Klesh Wong <zh...@merico.dev>
AuthorDate: Fri May 10 18:50:52 2024 +0800
refactor: add ipv6 test cases for api client blacklist feature
---
.../helpers/pluginhelper/api/api_client_test.go | 36 ++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
diff --git a/backend/helpers/pluginhelper/api/api_client_test.go b/backend/helpers/pluginhelper/api/api_client_test.go
index 361dc619d..d0c964719 100644
--- a/backend/helpers/pluginhelper/api/api_client_test.go
+++ b/backend/helpers/pluginhelper/api/api_client_test.go
@@ -33,7 +33,7 @@ func TestApiClientBlackList(t *testing.T) {
Err errors.Error
}{
{
- Name: "Internal IP Addresses",
+ Name: "Blocked Internal IP Addresses",
Pattern: "10.0.0.1/16",
Endpoints: []string{
"https://10.0.0.1",
@@ -44,7 +44,7 @@ func TestApiClientBlackList(t *testing.T) {
Err: ErrHostNotAllowed,
},
{
- Name: "Internal IP Addresses",
+ Name: "Allowed Public IP Addresses",
Pattern: "10.0.0.1/16",
Endpoints: []string{
"http://10.1.0.1",
@@ -54,6 +54,38 @@ func TestApiClientBlackList(t *testing.T) {
},
Err: nil,
},
+ {
+ Name: "Blocked IPv6 loopback",
+ Pattern: "::1/128",
+ Endpoints: []string{
+ "http://[::1]",
+ },
+ Err: ErrHostNotAllowed,
+ },
+ {
+ Name: "Blocked IPv6 Unique Local Addresses IP Addresses",
+ Pattern: "fc00::/7",
+ Endpoints: []string{
+ "http://[fdf8:f53b:82e4::53]",
+ },
+ Err: ErrHostNotAllowed,
+ },
+ {
+ Name: "Blocked IPv6 Link-Local IP Addresses",
+ Pattern: "fe80::/10",
+ Endpoints: []string{
+ "http://[fe80::200:5aee:feaa:20a2]",
+ },
+ Err: ErrHostNotAllowed,
+ },
+ {
+ Name: "Allowed IPv6 Public IP Addresses",
+ Pattern: "fe80::/10",
+ Endpoints: []string{
+ "http://[2001:0002:6c::430]",
+ },
+ Err: nil,
+ },
} {
t.Run(tc.Name, func(t *testing.T) {
for _, endpoint := range tc.Endpoints {