Add new PURL type: 'firefox-extension' - #927
Open
annextuckner wants to merge 2 commits into
Open
Conversation
Add a type definition, tests, and generated documentation for Firefox Browser Extensions (add-ons) distributed via addons.mozilla.org, following the structure and review feedback of the 'chrome-extension' type (package-url#522). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4 tasks
Member
|
@annextuckner Thank you for the PR and adapting the "Register new PURL type" template for the PR. We especially appreciate that you provided some failing tests. |
mixmix
reviewed
Jul 22, 2026
| ## Name definition | ||
|
|
||
| - **Requirement:** Required | ||
| - **Permitted Characters:** `^([a-zA-Z0-9-._]*@[a-zA-Z0-9-._]+|\{[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\})$` |
Contributor
There was a problem hiding this comment.
Is the second part (the more UUID shaped bit) really case sensitive?
oh... I sampled the database and yes! {5C46D283-ABDE-4dce-B83C-08881401921C}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR registers a new PURL type for Firefox Browser Extensions (add-ons), as distributed via addons.mozilla.org (AMO). It follows the structure and review feedback of the recently merged
chrome-extensiontype (#522), and answers the questions from the Register new PURL type template below.Why is this new PURL type needed?
Browser extensions are installable, versioned software packages and an increasingly important software supply chain surface (SBOMs, malware and vulnerability advisories, policy/inventory tooling all need to reference them). The
chrome-extensiontype was registered in #522; Firefox is the other major independent extension ecosystem, with its own store (AMO), its own extension ID format, and — unlike Chrome — a documented public API with downloadable version history. There is currently no standard way to identify a Firefox add-on and version.What are the PURL component level definitions?
Full definition in
types/firefox-extension-definition.json, with generated docs and test cases included in this PR.typefirefox-extension(descriptive<browser>-extensionnaming per #522 / #673 feedback)namespacenamebrowser_specific_settings.gecko.idmanifest key: either an email-like string of 80 chars or less (e.g.uBlock0@raymondhill.net) or a GUID in curly braces (e.g.{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}). Case sensitive.permitted_characters: `^([a-zA-Z0-9-.]*@[a-zA-Z0-9-.]+versionversionkey, enforced by AMO for new submissions.permitted_characters:^\d+(\.\d+){0,3}$qualifiers/subpathhttps://addons.mozilla.org— add-ons are queryable by extension ID via the documented AMO API, and previous versions are listed and downloadable.Example PURLs (all real, verified against the AMO v5 API):
pkg:firefox-extension/uBlock0%40raymondhill.net@1.72.2pkg:firefox-extension/%40testpilot-containers@8.3.8pkg:firefox-extension/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D@4.41.1pkg:firefox-extension/uBlock0%40raymondhill.net(latest)What input do you have from the relevant package ecosystem/community?
browser_specific_settings.gecko.id, manifestversion) and the AMO addons-server API docs; the extension ID is the key Mozilla itself uses in its API and blocklist.Are there any open questions or concerns about this new PURL type?
ublock-origin) was deliberately rejected in favor of the immutable extension ID, consistent with the Add new PURL type: 'chrome-extension' #522 feedback favoring collision-free primary keys — and because Firefox also supports signed self-distributed extensions that have no AMO listing or slug. The trade-off is percent-encoding (%40,%7B,%7D) in every PURL. An expected-failure test guards against slugs being used as names.uBlock0@raymondhill.net), so the name is defined as case sensitive to avoid mangling the canonical ID; AMO lookups are tolerant in practice.1.0b3) and would not match the version pattern; the definition notes this and follows the format AMO enforces today.Checks
Docs and
purl-types-index.jsonregenerated withmake gendocs;make checkjsonpasses; roundtrip canonicalization of all valid test cases verified with packageurl-python.A sibling PR (#928) adds
edge-extensionfor the Microsoft Edge Add-ons store.🤖 Generated with Claude Code