Add canary fixtures for internal package names in every ecosystem
The fixture matrix above, each case with its README.md and expect.json. Covers R1, R2 and the inputs for R8. Done when every row has its fixtures, a script checks that every name listed as internal in an expect.json either contains cdxcanary or belongs to the look-alike set, every host listed as trusted is under corp.invalid, and the look-alike responses are recorded with their source URLs.
Things that can go wrong
- Real names in fixtures. Canary names use the
cdxcanarytoken and the reserved.invalidtop-level domain, so a failing test leaks nothing real. Fixtures that test look-alike collisions use public names declared as internal and recorded responses, never live registries. - Aliases. An npm alias such as
"billing": "npm:@acme/[email protected]"putsbillinginnode_modulesand@acme/billingin the lockfile. Both are checked, and a match on either is a match. - Go case encoding. Proxy URLs write uppercase letters as
!plus the lowercase letter, sogit.acme.corp/Billingappears asgit.acme.corp/!billing. The URL decoder must undo that before matching. cdx-purl lowercases golang paths and splits/v2into the name, so the matcher must rejoin namespace and name.
Plan
https://github.com/cdxgen/.github/blob/16db3843748dd931f6ca02c2aa13d918bcfdfdac/plans/internal-packages-corpus.md
This issue is task T1 in plans/internal-packages-corpus.md. The terms, the pattern grammar, the policy levels and the full list of edge cases are in plans/internal-packages.md.
Hi @prabhu,
I would like to work on #4831 (Task T1: adding the canary fixtures, README.md / expect.json files, and the fixture validation script across ecosystems).
I will review plans/internal-packages-corpus.md, plans/internal-packages.md, and the repository's CONTRIBUTING.md guidelines first to ensure all canary tokens (cdxcanary), trusted hosts (corp.invalid), look-alike recorded responses, and edge cases (npm aliases, Go ! case encoding, etc.) strictly match the specification before opening the PR.
@rishitha2625, thank you for your message. These corpuses are usually kept in the maintainers local machine for faster agentic iteration. If you would like to help, could you help with testing and reviews? This discussion has some ideas https://github.com/cdxgen/cdxgen/discussions/4781
Thank you for letting me know, @prabhu! That makes sense. I'll check out discussion #4781 and see where I can help with testing and reviewing the upcoming changes.