Skip to content

Releases: vimalloc/flask-jwt-extended

3.3.0

29 Aug 20:39
Compare
Choose a tag to compare
  • Add possibility to set up cookies max-age during runtime (#81)
  • Register this extension with a flask app in a more proper way (043ba23)

3.2.0

29 Jul 03:38
Compare
Choose a tag to compare
  • Adds optional @jwt.claims_verification_loader and @jwt.claims_verification_failed_loader to do verification of the user_claims in an access token (refs #64 #70)

3.1.1

13 Jul 15:23
Compare
Choose a tag to compare
  • Fix some issues introduced in 3.1.0 when using a JWT_IDENTITY_CLAIM that is not 'identity' (#67)

3.1.0

13 Jul 02:27
Compare
Choose a tag to compare
  • Allows changing the identity claim name via JWT_IDENTITY_CLAIM options (#65)

3.0.0

09 Jul 01:32
Compare
Choose a tag to compare

First off, sorry and advance, as this is a big breaking change for how blacklist and token revoking works. If you use these features, you will need to update your application accordingly to get everything working with the 3.x.x releases. If you are not using the token blacklisting/revoking features, you should be able to update to the 3.x.x releases without any issues.

Token revoking has always been the weakest part of this extension. It locked you in to a single (not overly efficient) way of doing things, and didn't provide any way to customize this feature to fit with your applications needs.This library always aimed to give you the tools needed so that you could do whatever it was you wanted to do with your application. Unfortunately, the original blacklist feature did not do this, and thus why I am making a large breaking change to introduce a new blacklisting system.

This new blacklisting system only requires that you give this extension a callback function that checks if a token has been revoked or not. It is now up to you to provide this function, as well as keeping track of the revoked tokens.

To upgrade to the 3.x.x branch, you will need to remove theapp.config['JWT_BLACKLIST_STORE'], and use your own code to store blacklisted tokens. You will also need to use the @jwt.token_in_blacklist_loaderto provide a callback method which we use to check if a token is expired. Finally, if you are using app.config['JWT_BLACKLIST_STORE'] = 'all'', you will need to change it to app.config['JWT_BLACKLIST_STORE'] = ['access', 'refresh'].

Check out these links for examples that you can use with your application:

(I'm also generally available in IRC to help out if you have any questions. I am in #flask-jwt-extended on freenode).

Final Note: I know breaking changes suck. I am very happy with where this extension is at now, and do not foresee any more breaking changes on the horizon. I will to do everything I can to prevent more breaking changes from here on out.

Change List

  • JWT_BLACKLIST_STORE option has been removed.
  • all simplekv code has been removed.
  • JWT_BLACKLIST_TOKEN_CHECKS option now takes a string or a list of strings, and the valid strings are ['access', 'refresh'] instead of 'refresh' or 'all'.
  • JWT_BLACKLIST_TOKEN_CHECKS option now defaults to ['access', 'refresh']. This is the equivalent of the 'all' option in 2.x.x.
  • Add @jwt.token_in_blacklist_loader decorator. This is used to register a callback function for checking if a token has been blacklisted.
  • Add decode_token(encoded_token) function, which lets you decode an encoded token.
  • Users now needs to add tokens to the blacklist themselves, it is no longer automatically added in the create_access_token() and create_refresh_token() calls.

2.4.1

18 Jun 18:01
Compare
Choose a tag to compare
  • Export get_jti(encoded_token) in __init__.py (#53)

2.4.0

15 Jun 02:39
Compare
Choose a tag to compare

2.3.0

14 Jun 23:39
Compare
Choose a tag to compare
  • Adds ability to overwrite expires time in create_access_token and create_refresh_token with optional expires_delta kwarg (#52 and #55)

2.2.0

04 Jun 19:11
Compare
Choose a tag to compare
  • Adds ability to get jti from an encoded token (#51)
  • New optional kwarg encoded_token which can be passed to get_stored_token (#51)

2.1.1

30 May 15:39
Compare
Choose a tag to compare
  • get_jwt_identity() now returns None instead of {} if no jwt is present