mozilla / addons

☂ Umbrella repository for Mozilla Addons ✨
Other
125 stars 41 forks source link

[Task]: Add ability to add/update addon privacy policies #14927

Closed rougetimelord closed 1 month ago

rougetimelord commented 1 month ago

Description

Hi! I'm a maintainer on an addon that's listed on AMO, and we (semi) recently were asked to update our privacy policy. I would like to be able to push updates to our privacy policy using our release workflow, rather than having to ping the person who's AMO account actually hosts the addon every time there's a change to our privacy policy.

So basically, I would like if there was a Privacy Policy (and probably EULA) key to the following external API endpoints:

Another possible solution is to add push/patch/put methods to the /api/v5/addons/addon/(int:id|string:slug|string:guid)/eula_policy/ endpoint.

Acceptance Criteria

### Milestones/checkpoints
- [x] Add a way to update privacy policies and/or EULAs to the external API.

Checks

┆Issue is synchronized with this Jira Task

diox commented 1 month ago

An API already exists: https://mozilla.github.io/addons-server/topics/api/addons.html#eula-and-privacy-policy

rougetimelord commented 1 month ago

An API already exists: https://mozilla.github.io/addons-server/topics/api/addons.html#eula-and-privacy-policy

From my reading of the docs this endpoint only gets the current policies for an addon. I want to be able to create/update the privacy policy of an addon.

I'm unable to test currently but does the endpoint accept PUSH/PATCH/PUT methods?

diox commented 1 month ago

My apologies, you're correct! It's an oversight on our part, it should be straightforward to fix, we'll try to get it done for our next release.

diox commented 1 month ago

/api/v5/addons/addon/(int:id|string:slug|string:guid)/eula_policy/ will allow PATCH to edit eula/privacy policy. Docs will be updated soon, the patch will only land in production for our next push August 8th though.

ioanarusiczki commented 1 month ago

I sent from https://httpie.io/app PATCH requests for eula and privacy policy, some examples:

EULA with some long text (~10000 chars) https://addons-dev.allizom.org/en-US/firefox/addon/ublock-origin_test/eula/ with emojis https://addons-dev.allizom.org/fr/firefox/addon/ublock-origin_test/eula/ with urls https://addons-dev.allizom.org/en-US/firefox/addon/foxclocks_test/eula/ privacy policy https://addons-dev.allizom.org/en-US/firefox/addon/foxclocks_test/privacy/

@diox I can send these for a theme too , and it's going to be displayed on frontend or rev tools. Themes don't have these fields available in dev hub, but in case this is a problem let me know, I'll file a followup.

diox commented 1 month ago

@ioanarusiczki yeah let's have a follow-up for this, we can prevent that from happening.

I also noticed in devhub, changing the privacy policy triggers an activity log ({addon} policy changed, action id 38) that is not happening through that new API, we should fix that while we're at it.

ioanarusiczki commented 1 month ago

@diox I'm looking into models/activity/activitylog/ and added/changed eula or privacy policy for some add-ons from dev hub but I don't see an activity log (checked dev and stage). I see an activity recorded for License only.

diox commented 1 month ago

You're right, I was basing that on some 15 years old code I see in the form but it doesn't look like it's doing anything...