Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra modification for Previous ECMA Version #323

Open
wants to merge 104 commits into
base: master
Choose a base branch
from
Open

Extra modification for Previous ECMA Version #323

wants to merge 104 commits into from

Conversation

cr24osome
Copy link

No description provided.

Rudolf Olah and others added 30 commits February 8, 2016 17:38
Added bluebird as a dependency

Using Bluebird's promisifyAll and an object that delegates methods to
the OAuth2 implementation to be able to support promises.

Copied tests from oauth2 to oauth2promises. Existing tests are passing
with some small corrections.
Version is now 0.9.15, added links to both GPL and MIT licenses.
and some code style cleanup #8
"Setting multiArgs to true means the resulting promise will always fulfill with an array of the callback's success value(s). This is needed because promises only support a single success value while some callback API's have multiple success value. The default is to ignore all but the first success value of a callback function."

explanation is here: http://bluebirdjs.com/docs/api/promise.promisifyall.html#option-multiargs

fixes #10
Needed to use the _oa raw client instead of the oa client which is the
promisfied wrapper.

The test is "and followRedirect is false it should not perform the
secure request with the new location".

related to #4
instead of being a required dependency, related to #4
The function returns a string value immediately and is not asynchronous,
this fixes three broken unit tests in oauthpromise-tests.js.

related to #4
When using the promise, it would pass the response and an
IncomingMessage object. We only need to pass the data object from the
response.
* OAuth Promises
* OAuth2 Promises
* Examples that use promises
* Existing tests for OAuth and OAuth2 ported to ensure backwards compatibility with Promise wrapper objects
Rudolf Olah and others added 30 commits December 26, 2016 20:23
move extraParams to getOAuthAccessToken parameters
We have to use both constructor because old constructor is deprecated
but we still need it. And new node js versions don’t allow using old
constructor.
…uctor

Backwards compatible buffer constructor to support older versions of Node (for Amazon Lambda)
* Adds EventEmitter api to request for OAuth2 client

This add to events first one if for before _request method executes and
second one is after _request method executes. This commit also include
test cases.

* Adds OAuth2 example with hooks

* Updates Readme

* Replace ES6 style for backward compatibility

* version bump to 0.9.16

* style changes to appease Codacy
* Allow passing Content-Type header to OAuth constructor to set _defaultContentType

* Added _defaultContentType instance variable to OAuth

* Added setDefaultContentType method to set Content-Type header to something other than application/x-www-form-urlencoded when creating a request with post/get/etc

* README.md: Add setting content type to 'application/json' to the example for OAuth1 and change requires to reference 'oauth-libre' instead of 'oauth'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants