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

Added support for client credentials flow #133

Merged
merged 2 commits into from
Oct 7, 2016

Conversation

glena
Copy link
Contributor

@glena glena commented Oct 7, 2016

No description provided.

@glena glena changed the title Added support for client credentials flow DO NOT MERGE YET - Added support for client credentials flow Oct 7, 2016
@glena glena force-pushed the add-client-credentials-support branch 5 times, most recently from 22528ab to 0e8ca35 Compare October 7, 2016 15:49
@glena glena changed the title DO NOT MERGE YET - Added support for client credentials flow Added support for client credentials flow Oct 7, 2016
@coveralls
Copy link

Coverage Status

Coverage increased (+0.08%) to 94.925% when pulling 0e8ca35 on add-client-credentials-support into 69e26e5 on master.

@@ -28,6 +30,8 @@ var OAuthAuthenticator = function (options) {

this.oauth = new RestClient(oauthUrl);
this.clientId = options.clientId;
this.clientSecret = options.clientSecret;
this.domain = options.domain;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is the domain used? not familiar with the code base, but no change in the PR seems to be using it. if it is in this.oauth then 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to remove that. I made it different at first

it('should perform a POST request to ' + path, function (done) {
var request = this.request;

this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can return the promise and avoid calling done() inside then.

I would not add catch(done). If this results in an error, the test should not pass

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@glena glena force-pushed the add-client-credentials-support branch from 0e8ca35 to 3fd2466 Compare October 7, 2016 16:42
.authenticator
.clientCredentialsGrant(options)
.then(done.bind(null, null))
.catch(done.bind(null, null));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the operation fails the test should not pass, remove the catch. you can return the promise directly, remove the done parameter and the then call

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, we should check the rest of the tests then

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

})
.reply(200);

this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for all of these, same thing: return the promise and don't handle the catch, no need for that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 94.672% when pulling 3fd2466 on add-client-credentials-support into 69e26e5 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 94.945% when pulling bbcd85d on add-client-credentials-support into 69e26e5 on master.

@hzalaz hzalaz merged commit d007aea into master Oct 7, 2016
@hzalaz hzalaz deleted the add-client-credentials-support branch October 7, 2016 17:06
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.

None yet

4 participants