Skip to content

Fix Composer minified metadata expansion and namespaced package routing#63

Open
andrew wants to merge 3 commits intomainfrom
fix-composer-metadata-and-routing
Open

Fix Composer minified metadata expansion and namespaced package routing#63
andrew wants to merge 3 commits intomainfrom
fix-composer-metadata-and-routing

Conversation

@andrew
Copy link
Copy Markdown
Contributor

@andrew andrew commented Apr 5, 2026

Packagist serves metadata in a minified format ("minified": "composer/2.0") where only the first version entry has all fields and subsequent entries inherit from the previous one. The proxy was passing this through without expanding it, which meant cooldown filtering could break the inheritance chain (losing fields like name) and ~dev sentinel markers were silently dropped.

The proxy now expands the minified format before filtering and rewriting, ensuring every version entry is self-contained.

Web UI and API routes used single-segment chi URL params for package names, which broke for Composer's vendor/name format. /package/composer/monolog/monolog would match the version show route instead of the package show route.

All /package/ and related API routes now use wildcard paths with a resolvePackageName helper that tries increasingly longer path prefixes as package names via DB lookup, correctly handling namespaced packages across all endpoints (show, version, browse, compare, vulns).

Fixes #61, fixes #62

andrew added 3 commits April 5, 2026 10:00
Packagist serves metadata in a minified format where only the first version
entry has all fields and subsequent entries inherit from the previous one.
The proxy was passing this through without expanding it, which meant cooldown
filtering could break the inheritance chain (losing fields like `name`) and
`~dev` sentinel markers were silently dropped.

The proxy now expands the minified format before filtering and rewriting,
ensuring every version entry is self-contained.

Web UI and API routes used single-segment chi URL params for package names,
which broke for Composer's `vendor/name` format. `/package/composer/monolog/monolog`
would match the version show route instead of the package show route.

All `/package/` and related API routes now use wildcard paths with a
`resolvePackageName` helper that tries increasingly longer path prefixes as
package names via DB lookup, correctly handling namespaced packages across
all endpoints (show, version, browse, compare, vulns).

Fixes #61, fixes #62
Verifies the wildcard routing handles slashes in package names for
npm (@babel/core), Go modules (github.com/stretchr/testify),
OCI images (library/nginx), Conda (conda-forge/numpy), and
Conan (zlib/1.2.13@demo/stable).
The swagger annotations for the old per-endpoint handlers were removed
during the wildcard routing refactor. Regenerate to match current state.
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.

Bug: Web UI "package not found" shown for cached Composer packages Bug: Composer proxy repository - Unknown package has no name defined

1 participant