jpadilla / django-rest-framework-jwt

JSON Web Token Authentication support for Django REST Framework
http://jpadilla.github.io/django-rest-framework-jwt/
MIT License
3.19k stars 650 forks source link

Fixes #290 -- Pass request object on authenticate() #395

Open jezeniel opened 6 years ago

jezeniel commented 6 years ago

Django 1.11 introduced def authenticate(request, ...). This would be useful for some authentications with additional data. i.e. multiple user types.

jezeniel commented 6 years ago

Need opinions and tips on how to add test case for this one.

codecov[bot] commented 6 years ago

Codecov Report

Merging #395 into master will increase coverage by 0.06%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #395      +/-   ##
==========================================
+ Coverage   90.67%   90.73%   +0.06%     
==========================================
  Files          14       14              
  Lines         847      853       +6     
  Branches       29       30       +1     
==========================================
+ Hits          768      774       +6     
  Misses         66       66              
  Partials       13       13
Flag Coverage Δ
#codecov 90.73% <100%> (+0.06%) :arrow_up:
#dj110 87.33% <80%> (-0.15%) :arrow_down:
#dj111 87.33% <80%> (-0.15%) :arrow_down:
#dj18 89.68% <80%> (-0.17%) :arrow_down:
#dj19 89.68% <80%> (-0.17%) :arrow_down:
#drf31 89.68% <80%> (-0.17%) :arrow_down:
#drf32 89.68% <80%> (-0.17%) :arrow_down:
#drf33 89.68% <80%> (-0.17%) :arrow_down:
#drf34 90.73% <100%> (+0.06%) :arrow_up:
#drf35 90.38% <100%> (+0.06%) :arrow_up:
#drf36 90.38% <100%> (+0.06%) :arrow_up:
#py27 90.73% <100%> (+0.06%) :arrow_up:
#py33 89.33% <80%> (-0.17%) :arrow_down:
#py34 90.38% <100%> (+0.89%) :arrow_up:
#py35 87.57% <100%> (?)
#py36 87.57% <100%> (?)
Impacted Files Coverage Δ
rest_framework_jwt/compat.py 78.57% <100%> (+4.65%) :arrow_up:
rest_framework_jwt/serializers.py 82.6% <100%> (+0.19%) :arrow_up:

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 0a0bd40...20594c5. Read the comment docs.

codecov[bot] commented 6 years ago

Codecov Report

Merging #395 into master will increase coverage by 0.06%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #395      +/-   ##
==========================================
+ Coverage   90.67%   90.73%   +0.06%     
==========================================
  Files          14       14              
  Lines         847      853       +6     
  Branches       29       30       +1     
==========================================
+ Hits          768      774       +6     
  Misses         66       66              
  Partials       13       13
Flag Coverage Δ
#codecov 90.73% <100%> (+0.06%) :arrow_up:
#dj110 87.33% <80%> (-0.15%) :arrow_down:
#dj111 87.33% <80%> (-0.15%) :arrow_down:
#dj18 89.68% <80%> (-0.17%) :arrow_down:
#dj19 89.68% <80%> (-0.17%) :arrow_down:
#drf31 89.68% <80%> (-0.17%) :arrow_down:
#drf32 89.68% <80%> (-0.17%) :arrow_down:
#drf33 89.68% <80%> (-0.17%) :arrow_down:
#drf34 90.73% <100%> (+0.06%) :arrow_up:
#drf35 90.38% <100%> (+0.06%) :arrow_up:
#drf36 90.38% <100%> (+0.06%) :arrow_up:
#py27 90.73% <100%> (+0.06%) :arrow_up:
#py33 89.33% <80%> (-0.17%) :arrow_down:
#py34 90.38% <100%> (+0.89%) :arrow_up:
#py35 87.57% <100%> (?)
#py36 87.57% <100%> (?)
Impacted Files Coverage Δ
rest_framework_jwt/compat.py 78.57% <100%> (+4.65%) :arrow_up:
rest_framework_jwt/serializers.py 82.6% <100%> (+0.19%) :arrow_up:

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 0a0bd40...20594c5. Read the comment docs.

jezeniel commented 6 years ago

Any updates for this one?

zgyarmati commented 5 years ago

I vote for this, as it also affects me, and the patch works for me well