From a0b6cbc966135ea791d3335f78e3ea9c25c6f060 Mon Sep 17 00:00:00 2001 From: Christopher Cannell Date: Mon, 18 Apr 2016 12:25:06 -0400 Subject: [PATCH 1/3] Update request to latest version The pre-existing version of request did not support RSA-SHA1 method of oauth. Jira requires RSA-SHA1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7e56d2b2..4d77064f 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ } ], "dependencies": { - "request": "<2.16.0", + "request": "^2.72.0", "oauth": "^0.9.11" }, "scripts": { From 47e9cfc4b5bc96c8f93c04fdcd6da975cf22d490 Mon Sep 17 00:00:00 2001 From: Christopher Cannell Date: Mon, 18 Apr 2016 12:35:24 -0400 Subject: [PATCH 2/3] Add ability to specify oauth signature method Jira supports RSA-SH1 which is not the default for require --- lib/jira.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/jira.js b/lib/jira.js index 190e2661..5030b5f8 100644 --- a/lib/jira.js +++ b/lib/jira.js @@ -182,7 +182,8 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor consumer_key: oauth.consumer_key, consumer_secret: oauth.consumer_secret, token: oauth.access_token, - token_secret: oauth.access_token_secret + token_secret: oauth.access_token_secret, + signature_method: oauth.signature_method }; } else if(this.username && this.password) { options.auth = { From 0722a9837c953a92643d0bb8c26af6432b360120 Mon Sep 17 00:00:00 2001 From: Christopher Cannell Date: Mon, 18 Apr 2016 15:40:12 -0400 Subject: [PATCH 3/3] Allow alternate names for oauth token and token_secret --- lib/jira.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jira.js b/lib/jira.js index 5030b5f8..5bb21e7c 100644 --- a/lib/jira.js +++ b/lib/jira.js @@ -181,8 +181,8 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor options.oauth = { consumer_key: oauth.consumer_key, consumer_secret: oauth.consumer_secret, - token: oauth.access_token, - token_secret: oauth.access_token_secret, + token: oauth.access_token || oauth.token, + token_secret: oauth.access_token_secret || oauth.token_secret, signature_method: oauth.signature_method }; } else if(this.username && this.password) {