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 createRedirectUrl to client and fixed timestamp issue on JWT's #62

Merged
merged 2 commits into from
Oct 28, 2015

Conversation

matthisk
Copy link
Contributor

#61 and #58 both fixed. Used 'qs' library to create querystring. createRedirectUrl fails on incorrect targetUrl (similar to python implementation. Created two tests to test createRedirectUrl one to check whether wrong target urls result in an error and one to test the result. Notice that I decode the resulting JWT and check that result, instead of checking against an encoded JWT (like the python lib does). That is a bad idea because the order of the payload json affects the encoded JWT making the test really prone to failures (that do not origin from anything actually breaking) especially since dicts do not have a true ordering. Maybe a good idea to change this test in the py lib as well.

@tschellenbach
Copy link
Member

That's a good point, very slick implementation.

@@ -50,6 +53,7 @@ StreamClient.prototype = {
this.group = this.options.group || 'unspecified';
// track subscriptions made on feeds created by this client
this.subscriptions = {};
this.noJWTTimestamp = this.options.noJWTTimestamp || true;
Copy link
Member

Choose a reason for hiding this comment

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

hard to set noJWTTimestamp to false here ;)

Copy link
Member

Choose a reason for hiding this comment

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

I would rename noJWTTimestamp (keep JWT out of it) to something like expireTokens or something similar.

@matthisk
Copy link
Contributor Author

Good catch, fixed the issue and renamed to expireTokens.

tbarbugli added a commit that referenced this pull request Oct 28, 2015
Added createRedirectUrl to client and fixed timestamp issue on JWT's
@tbarbugli tbarbugli merged commit 04e92ee into master Oct 28, 2015
@mahboubii mahboubii deleted the create-redirect-url branch June 22, 2020 06:15
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

3 participants