Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2021-09-23 22:59:11 +0300
committerGitHub <noreply@github.com>2021-09-23 22:59:11 +0300
commit3495f7af4c6031c71e47dcd0d882b3950486cfc9 (patch)
treeb28f435a210e32b987630914f8bbfdd95dbc5176 /plugins/CoreHome
parent40f0ce2e614632ec8ac6af71a38f1c47b267e26c (diff)
For login allow list add support for IPv6 (#18046)
Diffstat (limited to 'plugins/CoreHome')
-rw-r--r--plugins/CoreHome/tests/Integration/LoginAllowlistTest.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/CoreHome/tests/Integration/LoginAllowlistTest.php b/plugins/CoreHome/tests/Integration/LoginAllowlistTest.php
index 993a722648..bfec00497f 100644
--- a/plugins/CoreHome/tests/Integration/LoginAllowlistTest.php
+++ b/plugins/CoreHome/tests/Integration/LoginAllowlistTest.php
@@ -132,7 +132,13 @@ class LoginAllowlistTest extends IntegrationTestCase
public function test_getAllowlistedLoginIps_shouldResolveIp()
{
$this->setGeneralConfig('login_allowlist_ip', ['192.168.33.1', 'matomo.org', '127.0.0.1']);
- $this->assertSame(['192.168.33.1', '185.31.40.177', '127.0.0.1'], $this->allowlist->getAllowlistedLoginIps());
+ $this->assertSame(['192.168.33.1', '185.31.40.177', '2a00:b6e0:1:200:177::1', '127.0.0.1'], $this->allowlist->getAllowlistedLoginIps());
+ }
+
+ public function test_getAllowlistedLoginIps_shouldResolveIpv6Only()
+ {
+ $this->setGeneralConfig('login_allowlist_ip', ['192.168.33.1', 'integration-test.matomo.org', '127.0.0.1']);
+ $this->assertSame(['192.168.33.1', 'integration-test.matomo.org', '::1', '127.0.0.1'], $this->allowlist->getAllowlistedLoginIps());
}
public function test_getAllowlistedLoginIps_shouldNotBeCheckedIfOnlyEmptyEntries()