From 12c135ccaab9659e4f8c67b83e5ac22dc5a355bd Mon Sep 17 00:00:00 2001 From: dblythy Date: Sat, 24 Apr 2021 11:13:51 +1000 Subject: [PATCH 1/5] Update OAuth1.spec.js --- spec/OAuth1.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/OAuth1.spec.js b/spec/OAuth1.spec.js index 3234394c09..04d2619ce3 100644 --- a/spec/OAuth1.spec.js +++ b/spec/OAuth1.spec.js @@ -93,7 +93,7 @@ describe('OAuth', function () { consumer_key: 'XXXXXXXXXXXXXXXXXXXXXXXXX', consumer_secret: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', }; - const path = '/1.1/help/configuration.json'; + const path = '/1.1/oauth/request_token'; const params = { lang: 'en' }; const oauthClient = new OAuth(options); oauthClient.get(path, params).then(function (data) { From 9c8466808f4b5bff882e33158fa6f59d2fc23d89 Mon Sep 17 00:00:00 2001 From: dblythy Date: Sun, 25 Apr 2021 18:29:30 +1000 Subject: [PATCH 2/5] Update OAuth1.spec.js --- spec/OAuth1.spec.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/OAuth1.spec.js b/spec/OAuth1.spec.js index 04d2619ce3..aa46335fb8 100644 --- a/spec/OAuth1.spec.js +++ b/spec/OAuth1.spec.js @@ -87,13 +87,13 @@ describe('OAuth', function () { done(); } - it('Should fail a GET request', done => { + it('GET request should fail with invalid credentials', done => { const options = { host: 'api.twitter.com', - consumer_key: 'XXXXXXXXXXXXXXXXXXXXXXXXX', - consumer_secret: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + consumer_key: 'invalid_consumer_key', + consumer_secret: 'invalid_consumer_secret', }; - const path = '/1.1/oauth/request_token'; + const path = '/1.1/account/settings.json'; const params = { lang: 'en' }; const oauthClient = new OAuth(options); oauthClient.get(path, params).then(function (data) { @@ -101,11 +101,11 @@ describe('OAuth', function () { }); }); - it('Should fail a POST request', done => { + it('POST request should fail with invalid credentials', done => { const options = { host: 'api.twitter.com', - consumer_key: 'XXXXXXXXXXXXXXXXXXXXXXXXX', - consumer_secret: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + consumer_key: 'invalid_consumer_key', + consumer_secret: 'invalid_consumer_secret', }; const body = { lang: 'en', From b484f91e17bad6c32a523acc5bb504513dcd4f3e Mon Sep 17 00:00:00 2001 From: dblythy Date: Sun, 25 Apr 2021 18:31:40 +1000 Subject: [PATCH 3/5] Update OAuth1.spec.js --- spec/OAuth1.spec.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/OAuth1.spec.js b/spec/OAuth1.spec.js index aa46335fb8..6a2631b66b 100644 --- a/spec/OAuth1.spec.js +++ b/spec/OAuth1.spec.js @@ -88,6 +88,10 @@ describe('OAuth', function () { } it('GET request should fail with invalid credentials', done => { + /* + This endpoint has been chosen to make a request to an endpoint that requires OAuth which fails due to missing authentication. + Any other endpoint from the Twitter API that requires OAuth can be used instead in case the currently used endpoint deprecates. + */ const options = { host: 'api.twitter.com', consumer_key: 'invalid_consumer_key', @@ -102,6 +106,10 @@ describe('OAuth', function () { }); it('POST request should fail with invalid credentials', done => { + /* + This endpoint has been chosen to make a request to an endpoint that requires OAuth which fails due to missing authentication. + Any other endpoint from the Twitter API that requires OAuth can be used instead in case the currently used endpoint deprecates. + */ const options = { host: 'api.twitter.com', consumer_key: 'invalid_consumer_key', From 15ea635cda72c6fa9ee0649aca5219388b636144 Mon Sep 17 00:00:00 2001 From: dblythy Date: Sun, 25 Apr 2021 19:09:38 +1000 Subject: [PATCH 4/5] Update OAuth1.spec.js --- spec/OAuth1.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/OAuth1.spec.js b/spec/OAuth1.spec.js index 6a2631b66b..7981581b69 100644 --- a/spec/OAuth1.spec.js +++ b/spec/OAuth1.spec.js @@ -89,7 +89,7 @@ describe('OAuth', function () { it('GET request should fail with invalid credentials', done => { /* - This endpoint has been chosen to make a request to an endpoint that requires OAuth which fails due to missing authentication. + This endpoint has been chosen to make a request to an endpoint that requires OAuth which fails due to missing authentication. Any other endpoint from the Twitter API that requires OAuth can be used instead in case the currently used endpoint deprecates. */ const options = { @@ -107,7 +107,7 @@ describe('OAuth', function () { it('POST request should fail with invalid credentials', done => { /* - This endpoint has been chosen to make a request to an endpoint that requires OAuth which fails due to missing authentication. + This endpoint has been chosen to make a request to an endpoint that requires OAuth which fails due to missing authentication. Any other endpoint from the Twitter API that requires OAuth can be used instead in case the currently used endpoint deprecates. */ const options = { From 8ac31c465206099cb8def6339cabe839e6b743dd Mon Sep 17 00:00:00 2001 From: dblythy Date: Sun, 25 Apr 2021 21:34:47 +1000 Subject: [PATCH 5/5] Update OAuth1.spec.js --- spec/OAuth1.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/OAuth1.spec.js b/spec/OAuth1.spec.js index 7981581b69..aa6e8ed0c5 100644 --- a/spec/OAuth1.spec.js +++ b/spec/OAuth1.spec.js @@ -87,7 +87,7 @@ describe('OAuth', function () { done(); } - it('GET request should fail with invalid credentials', done => { + it('GET request for a resource that requires OAuth should fail with invalid credentials', done => { /* This endpoint has been chosen to make a request to an endpoint that requires OAuth which fails due to missing authentication. Any other endpoint from the Twitter API that requires OAuth can be used instead in case the currently used endpoint deprecates. @@ -105,7 +105,7 @@ describe('OAuth', function () { }); }); - it('POST request should fail with invalid credentials', done => { + it('POST request for a resource that requires OAuth should fail with invalid credentials', done => { /* This endpoint has been chosen to make a request to an endpoint that requires OAuth which fails due to missing authentication. Any other endpoint from the Twitter API that requires OAuth can be used instead in case the currently used endpoint deprecates.