Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

[question] itsdangerous vs PyJWT? #10

Closed
sloria opened this issue May 15, 2014 · 8 comments · Fixed by #22
Closed

[question] itsdangerous vs PyJWT? #10

sloria opened this issue May 15, 2014 · 8 comments · Fixed by #22

Comments

@sloria
Copy link
Contributor

sloria commented May 15, 2014

Why use PyJWT instead of itsdangerous, which has an implementation of JWS?

@svenstaro
Copy link
Contributor

For our flasky use case, one less dependency would certainly improve things.

+1

EDIT: Actually looking at this more thoroughly, it seems like PyJWT was the choice because it maps very closely to the function of this library. Using itsdangerous on the other hand would require more code on the side of flask-jwt which would be duplicating some of PyJWT's functionality. So all in all, using PyJWT seems sensible to me.

@sloria
Copy link
Contributor Author

sloria commented May 17, 2014

@svenstaro Can you elaborate on why itsdangerous would be any more complex than using PyJWT? The API for itsdangerous is very simple; seems like a simple change to flask-jwt's _default_encode_handler and _default_decode_handler, but I may be missing something.

@svenstaro
Copy link
Contributor

itsdangerous doesn't seem to have token expiry handlers.

@sloria
Copy link
Contributor Author

sloria commented May 22, 2014

itsdangerous has the TimedJSONWebSignatureSerializer, which handles time-based expiry.

@svenstaro
Copy link
Contributor

Oh, well I didn't know that. In that case the project might as well just switch to that one to reduce dependencies.

@sloria
Copy link
Contributor Author

sloria commented May 26, 2014

If the maintainers give a go-ahead on switching to itsdangerous, I would be willing to write a patch.

@mattupstate
Copy link
Collaborator

I'm up for removing the dependency. I was ignorant to JWS implementation available in itsdangerous.

@sloria
Copy link
Contributor Author

sloria commented Jun 7, 2014

I'll get started on a patch this weekend

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants