Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions PURL-TYPES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,29 @@ github
pkg:github/package-url/purl-spec@244fd47e07d1004
pkg:github/package-url/purl-spec@244fd47e07d1004#everybody/loves/dogs

github-release
--------------
``github-release`` for GitHub releases:

- ``namespace``: The GitHub user or organization. It is not case sensitive and
must be lowercased.
- ``name``: The GitHub repository name. It is not case sensitive and must be
lowercased.
- ``version``: The release version. It is required and is case sensitive.
- Qualifier ``repository_url``: GitHub server hosting the release (optional).
Useful in case a private server is used. If omitted, ``https://github.com``
is assumed as the default.
- Qualifier ``file_name``: Selects a named (case sensitive) asset contained
within the release (optional).
- Qualifier ``checksum``: Checksum for the release asset (optional). Must be
in the form of `lowercase_algorithm:hex_encoded_lowercase_value`.

- Examples::

pkg:github-release/cli/[email protected]
pkg:github-release/foo/[email protected]?repository_url=https:%2F%2Ffoobar.ghe.com
pkg:github-release/foo/[email protected]?file_name=bin-linux.tgz&checksum=sha256:deadbeef
Copy link
Member

Choose a reason for hiding this comment

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

Is there anything that could not be accomplished with the github type and a file_name qualifier?

Copy link
Contributor

Choose a reason for hiding this comment

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

Concrete example of why this is different from the github type: pkg:github-release/keepassxc/[email protected]?file_name=KeePassXC-2.7.10-arm64.dmg from https://github.com/keepassxreboot/keepassxc/releases/tag/2.7.10. The file is not part of the Git repository so it cannot be referenced using pkg:github. You'd need to represent it with a pkg:generic. I'm not sure what pkg:github-release gives beyond pkg:generic. GitHub Releases is a place where you could be downloading a package from but isn't a package management system. There's no implied meaning about version numbers or the content or format of the file or dependencies between releases.

Copy link
Member

Choose a reason for hiding this comment

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

So now that a released file is immutable, why would this not be fine to point to an exact file in a release? And a release is always attached to a git tag so what about this?

pkg:github/keepassxreboot/[email protected]?file_name=KeePassXC-2.7.10-arm64.dmg that would resolve to this https://github.com/keepassxreboot/keepassxc/releases/download/2.7.10/KeePassXC-2.7.10-arm64.dmg ?

And https://github.com/keepassxreboot/keepassxc/releases/download/2.7.10/KeePassXC-2.7.10-Win64.msi to pkg:github/keepassxreboot/[email protected]?file_name=KeePassXC-2.7.10-Win64.msi

(Note that works even if releases would be mutable, these are two different things)

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems weird to me for pkg:github/keepassxreboot/[email protected] to refer to a tag in a Git repository and pkg:github/keepassxreboot/[email protected]?file_name=KeePassXC-2.7.10-arm64.dmg to refer to an arbitrary file that exists alongside that Git repository. I guess it's kind of similar to pkg:pypi where the package is made of multiple files that are not necessarily related, except that for pkg:github the file_name qualifier would change the mechanism for retrieving the package.


golang
------
``golang`` for Go packages:
Expand Down
12 changes: 12 additions & 0 deletions test-suite-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -706,5 +706,17 @@
"qualifiers": null,
"subpath": null,
"is_invalid": true
},
{
"description": "github-release valid name",
"purl": "pkg:GitHub-Release/foo/[email protected]?repository_url=https://acme.ghe.com&file_name=bin-linux.tgz&checksum=sha256:ff537afd5996cb67a319d6b0d3e65a330480068398a90bd81ea823a0566512c8",
"canonical_purl": "pkg:github-release/foo/[email protected]?repository_url=https:%2F%2Facme.ghe.com&file_name=bin-linux.tgz&checksum=sha256:ff537afd5996cb67a319d6b0d3e65a330480068398a90bd81ea823a0566512c8",
"type": "github-release",
"namespace": "foo",
"name": "bar",
"version": "v1.0.1",
"qualifiers": {"repository_url": "https://acme.ghe.com", "file_name": "bin-linux.tgz", "checksum": "sha256:ff537afd5996cb67a319d6b0d3e65a330480068398a90bd81ea823a0566512c8" },
"subpath": null,
"is_invalid": false
}
]