Styria-Digital / django-rest-framework-jwt

JSON Web Token Authentication support for Django REST Framework
https://styria-digital.github.io/django-rest-framework-jwt/
MIT License
191 stars 57 forks source link

Fix buggy migration for 'blacklisted' token ids #94

Closed ashokdelphia closed 3 years ago

ashokdelphia commented 3 years ago

Fix decode call for migration.

I don't care about verifying the token value here; if it got as far as the database, it's reasonable to expect it was valid when it was inserted.

This was my mistake in Styria-Digital/django-rest-framework-jwt#84, which was released in v1.18.0, where I didn't test the migration properly with real data.

codecov-commenter commented 3 years ago

Codecov Report

Merging #94 (0bc59c8) into master (8e5a737) will not change coverage. The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #94   +/-   ##
=======================================
  Coverage   93.87%   93.87%           
=======================================
  Files          21       21           
  Lines         588      588           
  Branches       69       69           
=======================================
  Hits          552      552           
  Misses         24       24           
  Partials       12       12           
Flag Coverage Δ
codecov 93.19% <0.00%> (ø)
dj111 92.53% <0.00%> (ø)
dj20 92.36% <0.00%> (ø)
dj21 92.36% <0.00%> (ø)
dj22 92.36% <0.00%> (ø)
dj30 93.02% <0.00%> (ø)
drf310 92.36% <0.00%> (ø)
drf311 93.02% <0.00%> (ø)
drf37 92.53% <0.00%> (ø)
drf38 92.53% <0.00%> (ø)
drf39 92.53% <0.00%> (ø)
py27 92.36% <0.00%> (ø)
py35 92.36% <0.00%> (ø)
py36 92.36% <0.00%> (ø)
py37 92.36% <0.00%> (ø)
py38 92.68% <0.00%> (ø)
pyjwt1 93.19% <0.00%> (ø)
pyjwt2 93.02% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...work_jwt/blacklist/migrations/0002_add_token_id.py 62.50% <0.00%> (ø)

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 8e5a737...0bc59c8. Read the comment docs.

ashokdelphia commented 3 years ago

@fitodic If you get a chance to look at this in the next week or so, that would be much appreciated. At present, one can't upgrade from pre-1.18 to >=1.18 if they're actively using token invalidation.

Apologies for my error in #84.

fitodic commented 3 years ago

@ashokdelphia No problem, thanks for the fix 👍🏼

ashokdelphia commented 3 years ago

@fitodic Apologies if this is already in hand, but if you could publish a new version when you have the time to, that would be much appreciated.

fitodic commented 3 years ago

I just remembered this morning that I forgot to release the new version yesterday. Got distracted I guess. Anyway, 1.19.1 should be on PyPI. Sorry for the delay 🙂