Can't download sidned extension via API

(Oleksiy Bondar) #1

Hi everyone,

I have a simple add-on which I use alongside with automated tests to add some functionality I need, I’m able to sign my addon via Web intrface and I’m able to sign it via API however I can’t download it through API, its avalable only via Web interface

when I sign an addon I’m getting following response

{
“guid”:"{47af37ff-e76f-43c1-9e7d-a87204b49adb}",
“active”:false,
“automated_signing”:true,
“url”:“https://addons.mozilla.org/api/v4/addons/{47af37ff-e76f-43c1-9e7d-a87204b49adb}/versions/1.0.0/uploads/d01244d9a8b84de7b7778170179a15d1/”,
“files”:{
},
“passed_review”:false,
“pk”:“d01244d9a8b84de7b7778170179a15d1”,
“processed”:false,
“reviewed”:false,
“valid”:false,
“validation_results”:null,
“validation_url”:“https://addons.mozilla.org/en-US/developers/upload/d01244d9a8b84de7b7778170179a15d1”,
“version”:“1.0.0”
}

so the problem is that addon is inactive and files list is empty

to sign addon I’m using following endpoint POST /api/v4/addons/

please suggest me what I’m doing wrong

going a little bit forward I’ll explain what I’m trying to achieve

So I have an WebExtension addon which perfectly works under chrome and I’ve modified it to work alongside with a Firefox, now I need a possibility automatically sign addon through API and downloadd it immediatelly after signing also via API call, I cannot manualy sign the addon and put is somwere because I have dynamically generated code of addon. So each time I sign it it has some code differences. As I said earlier it’s used in automated tests and generated part is addon options, hense I could add an options page for this purposes but that will require UI automation on this page, other way I could put options into profile options, but thats impossible for chrome so that would require 2 different approaches for FF and Chrome

other alternative coauld be usage FF for developers which allows to install unsigned addons, but this option is not acceptable due to testing policy, browser should have only official builds, nightly and developers editions are out of the scope

thanx in advance

0 Likes

(Martin Giger) #2

I don’t really know the API, but there’s https://www.npmjs.com/package/sign-addon as a wrapper for it, which is used in the web-ext CLI tool, which would do all of this for you.

0 Likes

(Oleksiy Bondar) #3

I thought about it but its bad Idea since each runtime environment will have to have the lib, and that’s practically imposible

so I’m trying to solve that by using vanilla code, without any extras

0 Likes

(Oleksiy Bondar) #4

Found a solution while looking into sign-addon source code

the downloadable files list is being generated asynchronous, so in original response files attr is empty and all I needed to do is perform status check API call with a delays untill file will be ready for download

0 Likes