From 959bcf358cb988f242284afe61a1d99fa705150b Mon Sep 17 00:00:00 2001 From: "Kai A. Hiller" Date: Thu, 22 Feb 2024 20:52:27 +0100 Subject: [PATCH] Specify IP subnet literals in canonical form This is needed, because the netaddr package removed support for the implicit prefix form in version 1.0.0: /~https://github.com/netaddr/netaddr/pull/360 --- changelog.d/16953.misc | 1 + tests/api/test_auth.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelog.d/16953.misc diff --git a/changelog.d/16953.misc b/changelog.d/16953.misc new file mode 100644 index 00000000000..81abcc3df02 --- /dev/null +++ b/changelog.d/16953.misc @@ -0,0 +1 @@ +Specify IP subnets in canonical form. diff --git a/tests/api/test_auth.py b/tests/api/test_auth.py index ce85ddf22aa..bd229cf7e9c 100644 --- a/tests/api/test_auth.py +++ b/tests/api/test_auth.py @@ -128,7 +128,7 @@ def test_get_user_by_req_appservice_valid_token_good_ip(self) -> None: token="foobar", url="a_url", sender=self.test_user, - ip_range_whitelist=IPSet(["192.168/16"]), + ip_range_whitelist=IPSet(["192.168.0.0/16"]), ) self.store.get_app_service_by_token = Mock(return_value=app_service) self.store.get_user_by_access_token = AsyncMock(return_value=None) @@ -147,7 +147,7 @@ def test_get_user_by_req_appservice_valid_token_bad_ip(self) -> None: token="foobar", url="a_url", sender=self.test_user, - ip_range_whitelist=IPSet(["192.168/16"]), + ip_range_whitelist=IPSet(["192.168.0.0/16"]), ) self.store.get_app_service_by_token = Mock(return_value=app_service) self.store.get_user_by_access_token = AsyncMock(return_value=None)