Repository navigation
Normalize domain inputs in the library entry point - #272
rksharma-owg wants to merge 1 commit into
Conversation
|
CI triage posted on behalf of @rksharma-owg by OpenAI Codex (autonomous). The second labeling attempt failed because Could a maintainer handle the labels and review the workflow's fork-PR behavior? Application changes would not address this failure, and this account has no repository write access. The separate build and analysis runs are still in progress. Failed label job: https://github.com/cisagov/pshtt/actions/runs/34401625336/job/102919823424 |
🗣 Description
Normalize input domains in
inspect_domains()using the existingutils.format_domains()helper. Library callers currently pass inputs such ashttps://www.example.comstraight toinspect(), whereas the CLI strips those prefixes first.The CLI now delegates normalization and its optional sorting to the library. Sorting happens after normalization, and normalization runs only once, preserving the existing treatment of a name such as
www.www.example.com.💭 Motivation and context
Fixes #133. Existing bare-domain input keeps its order unless sorting is requested. Explicit ports and duplicate entries are preserved, and the input list is not modified. The existing helper's normalization rules are unchanged.
🧪 Testing
pytest -o addopts='' -q: 41 passed, 5 skipped on macOS, CPython 3.10.20 x86_64 with SSLyze 4.1.0. The five skips already exist upstream.--sorted --json.pre-commit run --files src/pshtt/cli.py src/pshtt/pshtt.py tests/test_cli.py tests/test_pshtt.py: passed, including Black, Flake8, isort, mypy, and Bandit.git diff --check: passed.The x86_64 runtime was used because the existing ARM macOS
nasslwheel fails to import with a missing_SSLv2_methodsymbol. No dependency changes are included.✅ Pre-approval checklist
✅ Pre-merge checklist