Skip to content

Commit 694628c

Browse files
committed
Add ipv6 check to localnet
1 parent 003d3d0 commit 694628c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

binderhub/tests/test_auth.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,14 @@ async def test_ban_networks(request, app, use_session, path, banned, prefixlen,
9191
"255.255.255.255/32": "255.x",
9292
"1.0.0.0/8": "1.x",
9393
}
94-
local_net = str(ipaddress.ip_network("127.0.0.1").supernet(new_prefix=prefixlen))
94+
local_net = [
95+
str(ipaddress.ip_network("127.0.0.1").supernet(new_prefix=prefixlen)),
96+
str(ipaddress.ip_network("::1").supernet(new_prefix=prefixlen)),
97+
]
98+
9599
if banned:
96-
ban_networks[local_net] = "local"
100+
for net in local_net:
101+
ban_networks[net] = "local"
97102

98103
# pass through trait validators on app
99104
app.ban_networks = ban_networks

0 commit comments

Comments
 (0)