-
Notifications
You must be signed in to change notification settings - Fork 26
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 jwt tests #714
Merged
Merged
Add jwt tests #714
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
525b231
Update ref to ably-common
funkyboy ca98832
Fix tests for expired tokens
funkyboy ed30e9e
Add utilities to get a JWT token from echo server
funkyboy e817604
Add tests for JWT and Realtime
funkyboy 044f3c6
Fix encrypted option for getJWTToken
funkyboy ed681b3
Add JWT tests for rest and encrypted/embedded tokens
funkyboy 9de3703
Use clientId instead of client_id
funkyboy 5a6b0ee
Fix issue in passing errors along
funkyboy 53d4eb9
Fix JWT renew test
funkyboy 95b51a8
Add test to check reauth without disconnection using JWT
funkyboy 13a78dc
Add support for application/jwt responses from authUrl
funkyboy 5c36c8c
Add test for JWT returned with application/jwt content type
funkyboy 4e37a96
Add test to request a JWT token via requestToken with application/jwt…
funkyboy 81fdbf1
Add refs to spec items
funkyboy 54c84de
Remove uneeded method
funkyboy 903bc3e
Fix typo
funkyboy c7efe08
Improve publish with JWT test
funkyboy 936955b
Improve token expiration test
funkyboy 4b5ada4
Remove unneeded autoConnect setting
funkyboy 7351d46
Fix typos in contexts
funkyboy 5ec0760
Remove autoConnect false when not needed
funkyboy a2100f2
Add spaces around closures
funkyboy 221ec69
Update URL of JWT server
funkyboy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we had agreed that https://docs.ably.io/client-lib-development-guide/features/#RSA4b stated that the connection should not become failed, but instead should become disconnected and retry. I believe @paddybyers updated the spec after chatting with you about this at some point, although oddly I can't find a matching commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add this as a TODO above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattheworiordan RSA4b says that a REST request fails if a token error is returned after a retry, which is correct, and is unrelated to this test.
https://docs.ably.io/client-lib-development-guide/features/#RTN14b relates to token failures on connection creation - it says that a connection should not fail in that case, but become disconnected. This test is therefore wrong and, because it passes, there is also a bug in the library (which will have existed before these JWT changes). @funkyboy pls raise a separate issue for that (and find the other existing, non-JWT, invalid test).
The discussion you remembered related was https://github.com/ably/docs/issues/429, relating to RTN15h, and that's to do with failures to reconnect (ie not initial connection failures). I'm guessing that there's going to be an issue for iOS there as well. I will do a docs PR for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paddybyers @mattheworiordan The non-JWT corresponding test is https://github.com/ably/ably-ios/blob/develop/Spec/Auth.swift#L305 and again it tests for
FAILED
.Issue raised here: #730
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ably/docs#439. @funkyboy can you check that behaviour please in this library and see if complies with the
DISCONNECTED
orFAILED
behaviour?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paddybyers This seems to test the new
RTN15h1
that you wrote.These all riff around the same "token expired/wrong" conditions but none seems to tests for the "single attempt to renew the token" clause.
Should I open a new issue about this?
cc @mattheworiordan
UPDATE: this seems close to test this https://github.com/ably/docs/pull/439/files#diff-11900b395df266bc2bbfc1d11bdfc7a0R390 but it's not checking for the connection state :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I should have scrolled up to see the context of the test I found. That explains why I could not find the record of the change we made in the spec!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paddybyers
Opened issue here #731