fix(web-app-keycloak): reject scoped IPv6 admin networks, drop module docstring

Addresses two CodeRabbit findings on PR #1261.

1. Scoped IPv6 (thread 4421596356): ipaddress.ip_network accepts a scope
   ID, so `fe80::1%eth0` resolved to `fe80::1%eth0/128` and the vhost
   would carry `allow fe80::1%eth0/128;`, which nginx refuses to load.
   kc_admin_networks now raises AnsibleFilterError for any entry whose
   network address carries a scope ID. test_admin_allowlist.py covers a
   scoped address and a scoped CIDR; both fail against the previous
   filter.
2. Module docstring (thread 4421596351): removed; it described the
   module instead of documenting parameters or a trip-wire.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5.5 committed 2026-10-30 16:52:06 +01:00
1 parent bbe75cf4ed
commit 2393e8ddba
2 files changed
+9 -3

No files matched your search

@@ -318,6 +318,8 @@ class TestDeclaredValues(unittest.TestCase):
["auth.example.com"],
[""],
[42],
["fe80::1%eth0"],
["fe80::%eth0/64"],
):
with self.subTest(value=value), self.assertRaises(AnsibleFilterError):
admin_networks(value)