Skip to content
This repository has been archived by the owner on Nov 27, 2019. It is now read-only.

Commit

Permalink
fix: Added --api-proxy option to the sign command (#593)
Browse files Browse the repository at this point in the history
  • Loading branch information
ingoe authored and kumar303 committed Feb 7, 2017
1 parent 2dd7b6a commit 723bbe1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions bin/jpm
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ program
"optional XPI to be signed. By default, an XPI will be built " +
"from your working directory")
.option("--timeout <milliseconds>", "time to wait for a signing result")
.option("--api-proxy <url>", "Optional proxy to use for all API requests." +
" Example: https://yourproxy:6000")
.action(function(options) {
signCmd(program, options);
});
Expand Down
3 changes: 2 additions & 1 deletion lib/sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ function sign(options, config) {
apiKey: options.apiKey,
apiSecret: options.apiSecret,
apiUrlPrefix: options.apiUrlPrefix,
apiProxy: options.apiProxy || undefined,
verbose: options.verbose,
timeout: options.timeout || undefined,
timeout: options.timeout || undefined
}).then(function(result) {
if (typeof xpiInfo.cleanUp !== "undefined") {
logger.debug("cleaning up XPI temp directory");
Expand Down
13 changes: 13 additions & 0 deletions test/unit/test.sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,19 @@ describe("sign", function() {
}).catch(done);
});

it("can configure a proxy", function() {
return runSignCmd({
cmdOptions: {
apiKey: "some-key",
apiSecret: "some-secret",
apiProxy: "some-proxy",
},
}).then(function() {
expect(signAddonCall.call[0].apiProxy)
.to.be.equal("some-proxy");
});
});

it("passes custom XPI to the signer", function(done) {
var mockXpiInfoGetter = new CallableMock({
returnValue: when.promise(function(resolve) {
Expand Down

0 comments on commit 723bbe1

Please sign in to comment.