What
redact_url_query should handle IPv6 host URLs correctly. Currently we test only path-style URLs like /api?token=x and one https://example.com:8443/... host. We don't have coverage for the IPv6 bracket form, e.g. http://[::1]:8080/api?token=secret.
Expected outcome
Add test cases to tests/test_url_query.py covering:
http://[::1]:8080/api?token=abc → token redacted, host/port preserved verbatim
http://[2001:db8::1]/api?api_key=abc&page=1 → key redacted, page preserved
- A case with
? inside the IPv6 bracket should not be misparsed (the current find('?') is naive — verify or fix)
If the third case finds a real bug, please file it separately and ship just the tests here.
Why this is good for newcomers
- Self-contained: one test file
- Clear acceptance criteria: assertions follow the existing
parse_qsl(urlparse(out).query) pattern in the file
- No domain knowledge of redaction policy required
Pointers
- Source:
src/redactkit/url_query.py
- Existing tests:
tests/test_url_query.py
- See
CONTRIBUTING.md for dev setup
What
redact_url_queryshould handle IPv6 host URLs correctly. Currently we test only path-style URLs like/api?token=xand onehttps://example.com:8443/...host. We don't have coverage for the IPv6 bracket form, e.g.http://[::1]:8080/api?token=secret.Expected outcome
Add test cases to
tests/test_url_query.pycovering:http://[::1]:8080/api?token=abc→ token redacted, host/port preserved verbatimhttp://[2001:db8::1]/api?api_key=abc&page=1→ key redacted, page preserved?inside the IPv6 bracket should not be misparsed (the currentfind('?')is naive — verify or fix)If the third case finds a real bug, please file it separately and ship just the tests here.
Why this is good for newcomers
parse_qsl(urlparse(out).query)pattern in the filePointers
src/redactkit/url_query.pytests/test_url_query.pyCONTRIBUTING.mdfor dev setup