Repository navigation
fix(cli): list dead-links results the cloud checker could not verify as unverifiable, never broken (squirrelscan/repo#2818) - #762
Conversation
|
Reviewed the diff and the engine code it plugs into. The change is small and consistent, and I found nothing blocking.
Security: provider strings from the service are allow-listed to the engine's vocabulary, so a value like |
…as unverifiable, never broken (squirrelscan/repo#2818) DeadLinkResult gains optional wafBlocked and wafProvider. The service sets them for a link it could not verify either way: bot protection, a timeout or failed connection from its network, or a first 404 waiting for its confirming check. The CLI passes them to the engine, so the rules list the link with the firewall-blocked ones as status unverifiable. A vendor outside the engine's vocabulary reads as unknown. Older services omit the fields and nothing changes. Signed-off-by: Nik Cubrilovic <[email protected]>
…or list to the engine type (squirrelscan/repo#2818) Review round 1. An unverified result's status and redirectUrl are null, a refused 403 included, so a CLI that predates the flag reads the link as unchecked rather than broken. The CLI's vendor list is checked against WafProvider at compile time. dead-links docs name what the service could not verify and where it is listed. Signed-off-by: Nik Cubrilovic <[email protected]>
fa12987 to
42fc7c4
Compare
|
Rebased onto main 7e991f5 (#755, #757), new head 42fc7c4, DCO on both commits. The one conflict was the same paragraph in |
|
Review of #762: no blocking issues. The fields line up with the engine:
Test coverage is good: it covers a known vendor, an unknown vendor, and a result without the flag. |
Summary
Public half of squirrelscan/repo#2818. It pairs with squirrelscan/repo#2829, the private PR that makes the cloud dead-links service send these fields.
When you are signed in, the cloud dead-links service checks your external links through Perch. A Perch verdict the checker could not settle either way had no way to reach the rules as "not verified":
So a timeout came back as a broken link (
Error: timeout), and a refused link disappeared from the report.DeadLinkResult(packages/core-contracts/src/services.ts) gains optionalwafBlockedandwafProvider. These are the namesExternalCheckResultalready has, and the WAF-blocked "status unverifiable" bucket inlinks/broken-external-linksalready reads them.apps/cli/src/audit/cloud.ts) passes them to the engine. A vendor outside the engine'sWafProvidervocabulary becomesunknown, so no new dependency is added.rules/links/broken-external-linkssays the WAF list also holds what the cloud checker could not verify.rules/links/dead-linksnames those cases and points to the list.WafProvidertype at compile time (satisfies).[Unreleased]Fixed entry.Merge order (#2818's last criterion): this PR first. The private PR sends the fields, and it does not need a gitlink bump: until the next routine bump it declares them in a twin type named after this contract. On the wire, either order is safe: an unverified result has no status and no error (a refused 403 included), so a client that predates these fields reads the link as unchecked, never broken. The CLI half takes effect with the next CLI release.
Follow-up filed: #764 (the local link cache keeps cloud rate-limited and unverified answers for 7 days).
Verification
apps/cli:bun test tests/audit/cloud-spend.test.tspasses 9, 2 of them new: awafBlockedresult keeps its flag and a known vendor, an unknown vendor readsunknown, and a result without the flag carries none.apps/cli: typecheck, lint and format:check are clean.packages/core-contracts: typecheck is clean.docs:bun x [email protected] check --strictreports all checks passed.Checklist
Signed-off-byline (git commit -s).Agent skill (squirrelscan/skills): no change needed.