Skip to content

Add Enterprise Add-on API - #25215

Merged
chrstinalin merged 2 commits into
mozilla:masterfrom
chrstinalin:#14851-enterprise-api
Aug 20, 2026
Merged

Add Enterprise Add-on API#25215
chrstinalin merged 2 commits into
mozilla:masterfrom
chrstinalin:#14851-enterprise-api

Conversation

@chrstinalin

@chrstinalin chrstinalin commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Fixes mozilla/addons#14851

Description

Adds API support for enterprise channel work.

Testing

  • V3 and V4 APIs do not support enterprise uploads.
  • Does not show enterprise by default anywhere (following unlisted behaviour)
  • Only authors & those with unlisted permissions can access the APIs.

1. Upload

/api/v5/addons/upload/

  • POST can take and create an enterprise upload.
  • GET should include any previously uploaded enterprise uploads.

/api/v5/addons/upload/<string:uuid>/

  • GET shows details about an enterprise upload. Should show the ADMIN_INSTALL_ONLY_REQUIRED error when the setting is missing.
Screenshots image image

2. Add-on

/api/v5/addons/addon/

  • POST can take an enterprise upload and create a new add-on.

3. Version

/api/v5/addons/addon/(int:addon_id|string:addon_slug|string:addon_guid)/versions/

  • POST Allows submitting an enterprise upload as a version to an existing add-on.
  • GET does not show enterprise versions by default. Can filter to show via enterprise_only.

/api/v5/addons/addon/(int:addon_id|string:addon_slug|string:addon_guid)/versions/(int:id|string:version_number)/

  • GET can retrieve an enterprise version.

Checklist

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.

@chrstinalin
chrstinalin marked this pull request as draft July 29, 2026 19:18
@chrstinalin
chrstinalin force-pushed the #14851-enterprise-api branch from 970e277 to 4761b3c Compare July 30, 2026 13:33
@chrstinalin
chrstinalin force-pushed the #14851-enterprise-api branch 7 times, most recently from 55ec3e4 to b98378c Compare August 14, 2026 15:54
@chrstinalin
chrstinalin marked this pull request as ready for review August 14, 2026 18:03
@chrstinalin
chrstinalin force-pushed the #14851-enterprise-api branch from b98378c to f054b68 Compare August 14, 2026 18:03
@chrstinalin
chrstinalin requested review from a team and nothingrandom and removed request for a team August 14, 2026 18:28

@nothingrandom nothingrandom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Feel uncomfortable being the only one looking at this, @eviljeff or @diox - are you happy to take a look also?

@eviljeff
eviljeff self-requested a review August 20, 2026 09:07

@eviljeff eviljeff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks fine, just looking for some clarification before approving.

Comment thread src/olympia/signing/views.py Outdated
Comment thread src/olympia/lib/settings_base.py Outdated
addon = self.get_addon_object()
if requested == 'all_with_deleted' or self.action != 'list':
queryset = addon.versions(manager='unfiltered_for_relations').all()
elif requested == 'all_with_unlisted':

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

all_with_unlisted is actually "all" - i.e. including listed, unlisted, and enterprise.

Two questions here:

  • do we want all_with_unlisted to include enterprise? If not do we want/need an all_with_unlisted_and_enterprise? Either way the docs should mention the behaviour.
  • if all_with_unlisted is going to include enterprise versions in v5, should it also include enterprise versions in v4 and v3? i.e. if the no-enterprise gate is active, should this queryset exclude enterprise versions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

RE: The comment above this section;

    # filter in use. When fetching a single instance however, we use the
    # same queryset as the less restrictive filter, that allows us to see
    # all versions, even deleted ones. In any case permission checks will
    # prevent access if necessary (meaning regular users will never see
    # deleted or unlisted versions regardless of the queryset being used).

I imagine it would be more consistent with the intent to include enterprise versions in v5, and consistent with the rest of the code to gate it for v3/v4?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Depends really if we want consistency across the version of the api - so enterprise is available everywhere in v5, but unavailable everywhere in v3 and v4. Or across the add-on, so no matter which version of the api you use, once submitted, the enterprise versions would be in the list of versions.

Really a question for Product if not already specified in the PRD/issues, but imo, I don't think we gain anything from preventing those versions from being exposed to developers in the api responses. Going further, maybe we don't need the api gate either - i.e. does it matter if someone used v3 with filter=enterprise_only? 🤷

… error on pass for enterprise channel in v3/v4
@chrstinalin
chrstinalin force-pushed the #14851-enterprise-api branch from 22649b7 to 3862c4f Compare August 20, 2026 13:44
@chrstinalin
chrstinalin requested a review from eviljeff August 20, 2026 14:24

@eviljeff eviljeff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

r+wc if we don't care about developers using v3/v4 and seeing enterprise versions we could strip out some of the extra complexity with the new api gate🤷

@chrstinalin
chrstinalin merged commit 6e159f2 into mozilla:master Aug 20, 2026
47 checks passed
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.

[Task]: Support new "enterprise" channel in add-on API

4 participants