Skip to content

Conversation

Seldaek
Copy link
Member

@Seldaek Seldaek commented Aug 28, 2025

Fixes #1497

It's not very elegant but just adds it on the package page at the bottom of the sidebar like this:

image

I'm open for better suggestions but I don't think this should be very prominent tbh..

As specified here https://github.com/package-url/purl-spec/blob/main/types-doc/composer-definition.md and https://github.com/package-url/purl-spec/blob/main/types/composer-definition.json

// resolve Package-URL to package names https://github.com/package-url/purl-spec/blob/main/PURL-SPECIFICATION.rst
$packageNames = array_map(
fn ($name) => Preg::replace('{^pkg:/?/?composer/([^/]+/[^/@?]+).*}', '$1', $name),
$packageNames
Copy link
Member

Choose a reason for hiding this comment

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

Wonder if this needs to parse the purl more completely then and reject if the repository_url is something other than packagist.org?

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind, since the advisory API isn't restricted to packages actually served by this repo, doesn't matter what repo is in the purl.

@Seldaek Seldaek merged commit ae04441 into composer:main Oct 6, 2025
3 checks passed
@Seldaek Seldaek deleted the purl-support branch October 6, 2025 09:02
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.

Add support for PURL (Package URL)

2 participants