是否有用于Mozilla的API,用于更新已签名的插件? [英] Is there an API for Mozilla for updating signed addons?

查看:87
本文介绍了是否有用于Mozilla的API,用于更新已签名的插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个已签名的插件,我个人使用过,但想尝试使其通过AMO分发.我已经通过Developer Hub上载了初始版本,现在希望能够通过CI管道包含自动发布.

I have a signed addon that I use personally but would like to experiment with making it distributable via AMO. I have already uploaded the initial version through the Developer Hub, and I'm now hoping to be able to include an automated release through a CI pipeline.

我已经研究了一段时间,发现了 API文档,但运气不佳.我肯定可以正确地连接我的JWT,因为我得到了301(我认为这是因为本文中描述的API在最近两年中已更改),但是当我进行重定向时又得到了400.

I've been investigating how to do this for a while now, having found this article and API doc but haven't had much luck. I'm definitely able to connect with my JWT properly, as I get either a 301 (I assume this is because the API described in the article has been changed in the last two years) but then a 400 when I follow the redirects.

每个请求都在多部分文件数据中返回缺少上载"键.我认为这与端点是PUT有关,但期望采用多部分形式(我的所有研究都表明这一点得到了支持.仅限POST).我已经尝试了几种不同的方法,包括cURL和各种Python库-包括PyCurl尝试在POST请求中使用多部分并仅覆盖PUT的方法-但似乎没有用.

Every request returns Missing "upload" key in multipart file data. I believe this is to do with the endpoint being a PUT but expecting a multipart form (all my research points to this being supported by POST only). I've tried several different approaches, both with cURL and with various Python libraries - including PyCurl to try and use the multipart in a POST request and override only the method to PUT - but just don't seem to be getting anywhere.

我没有找到任何有关此文档的最新文档,因为较早的文章暗示它是已弃用的API,但是较新的文档似乎没有我想要的答案.像这样的问题表明它仍然可行,而且我已经提到过web-ext,但我想我只是想念如何将各个部分放在一起.

I haven't been able to find any recent documentation on this, as the older articles imply it's a deprecated API but the newer docs don't seem to have the answers I'm looking for. Issues like this one suggest it's still possible, and I've seen mention of web-ext but I think I'm just missing how to put the pieces together.

我的要求是:

    curl -XPUT https://addons.mozilla.org/api/v3/addons/{myId}/versions/0.2 -F 'upload=../toolbox.api' -H 'Authorization: JWT <myToken>' -v -L

有没有人尝试这样做,并且对如何前进有任何建议?或者反过来说,这肯定是不可能?

Has anyone tried to do this and have any advice on how to move forward? Or conversely know that it's definitely not possible?

提前谢谢!

推荐答案

您可以使用基于node.js的命令

You can use the node.js based command web-ext to sign extensions from command line.

与curl方法类似,您将获得颁发者/秘密,然后将其用作给定参数或环境变量:

Like with the curl approach you obtain the issuer/secret, then use those as given arguments or environment variables:

web-ext sign --api-key=$AMO_JWT_ISSUER --api-secret=$AMO_JWT_SECRET 

如果您需要使用代理:

web-ext sign --api-key=... --api-secret=... --api-proxy=https://yourproxy:6000

有关详细信息,请参见链接的文章. (及其其他功能).

Please see the linked article for details (and its other features).

这篇关于是否有用于Mozilla的API,用于更新已签名的插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆