Skip to content

Commit

Permalink
Add ipv6 check to localnet
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed Nov 27, 2024
1 parent 003d3d0 commit 694628c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions binderhub/tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,14 @@ async def test_ban_networks(request, app, use_session, path, banned, prefixlen,
"255.255.255.255/32": "255.x",
"1.0.0.0/8": "1.x",
}
local_net = str(ipaddress.ip_network("127.0.0.1").supernet(new_prefix=prefixlen))
local_net = [
str(ipaddress.ip_network("127.0.0.1").supernet(new_prefix=prefixlen)),
str(ipaddress.ip_network("::1").supernet(new_prefix=prefixlen)),
]

if banned:
ban_networks[local_net] = "local"
for net in local_net:
ban_networks[net] = "local"

# pass through trait validators on app
app.ban_networks = ban_networks
Expand Down

0 comments on commit 694628c

Please sign in to comment.