Skip to content

Conversation

@sobregosodd
Copy link
Contributor

@sobregosodd sobregosodd commented Feb 5, 2026

Context:
Typosquatting relies on top_packages json files to identify if the scanned package resembles a known one.
There is a functionality that refreshes the file if is older than 30 days in the filesystem.
A recent contribution introduced an error that makes the program exists if the json file is refreshed.

This PR:

  • Fixes the downloaded format error when file is refreshed.
  • Refactors code so that the refresh logic is only in the parent's typosquatting class instead of replicated in every ecosystem
  • Changes the refresh behaviour, the oldness of the json file is now tracked in the json file itself (downloaded_timestamp), since filesystem age is not a good fit: it's set when guarddog is installed or built, not when the list was collected

@sobregosodd sobregosodd marked this pull request as ready for review February 6, 2026 08:37
Copy link
Contributor

@ikretz ikretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sobregosodd sobregosodd merged commit 54fa051 into main Feb 6, 2026
5 checks passed
@sobregosodd sobregosodd deleted the s.obregoso/fix_typosquatting branch February 6, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants