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

Add test for failed grant token request #218

Merged
merged 1 commit into from
Feb 8, 2017

Conversation

seanh
Copy link
Contributor

@seanh seanh commented Feb 8, 2017

No description provided.

@codecov-io
Copy link

codecov-io commented Feb 8, 2017

Codecov Report

Merging #218 into master will increase coverage by 0.21%.

@@            Coverage Diff             @@
##           master     #218      +/-   ##
==========================================
+ Coverage   75.11%   75.33%   +0.21%     
==========================================
  Files         114      114              
  Lines        5691     5729      +38     
  Branches      930      937       +7     
==========================================
+ Hits         4275     4316      +41     
+ Misses       1416     1413       -3
Impacted Files Coverage Δ
src/sidebar/session.js 89.65% <ø> (-1.71%)
src/sidebar/oauth-auth.js 100% <ø> (+3.57%)
src/sidebar/directive/annotation-share-dialog.js 100% <ø> (+23.33%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e8e035...4087de3. Read the comment docs.

@@ -53,6 +53,18 @@ describe('oauth auth', function () {
});
});

it('should raise if a grant token request fails', function () {
Copy link
Member

Choose a reason for hiding this comment

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

You mean access token request, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sigh, I don't know! You post the grant token to the endpoint in order to get an access token back. Is this a grant token request or an access token request?

I suppose your are requesting an access token as in that's the thing that you're asking for in response.

But that is also true of refresh token requests, so would you call those access token requests as well?

With the way I've done it, if you call the request after the token you're sending, then you have grant token requests and refresh token requests (no ambiguity).

I'm not sure how the spec names these though...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, looks like the spec calls them "access token requests" and "refresh requests" :)

Copy link
Member

Choose a reason for hiding this comment

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

I suppose your are requesting an access token as in that's the thing that you're asking for in response.

Yes, exactly.

But that is also true of refresh token requests, so would you call those access token requests as well?

Yes, but the test might be worded as "access token refresh" rather than "access token request" to differentiate the two.

The other option would be to describe this test as a grant token exchange, since that is what the client provides in return for the access token.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, looks like the spec calls them "access token requests" and "refresh requests" :)

Seems clear enough to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, renamed it

@seanh seanh force-pushed the add-test-for-failed-grant-token-request branch from 8c813b4 to 4087de3 Compare February 8, 2017 17:56
@robertknight
Copy link
Member

LGTM.

@robertknight robertknight merged commit 7f75f29 into master Feb 8, 2017
@robertknight robertknight deleted the add-test-for-failed-grant-token-request branch February 8, 2017 18:14
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.

3 participants