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

In case of different auth header it triggers error instead of None #65

Closed awais786 closed 4 years ago

awais786 commented 4 years ago

When the Authorization header is sent with a different prefix other than default it raises error. It should return None so that other auth class can validate it. This issue is appearing due to this change.

Two issues already reported https://github.com/Styria-Digital/django-rest-framework-jwt/issues/57 https://github.com/Styria-Digital/django-rest-framework-jwt/issues/63

awais786 commented 4 years ago

@fitodic Please review.

codecov-commenter commented 4 years ago

Codecov Report

Merging #65 into master will decrease coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #65      +/-   ##
==========================================
- Coverage   98.14%   98.12%   -0.02%     
==========================================
  Files          19       19              
  Lines         485      481       -4     
  Branches       45       45              
==========================================
- Hits          476      472       -4     
  Misses          7        7              
  Partials        2        2              
Flag Coverage Δ
#codecov 98.12% <100.00%> (-0.02%) :arrow_down:
#dj111 97.65% <100.00%> (-0.02%) :arrow_down:
#dj20 97.23% <100.00%> (-0.03%) :arrow_down:
#dj21 97.23% <100.00%> (-0.03%) :arrow_down:
#dj22 97.23% <100.00%> (-0.03%) :arrow_down:
#dj30 97.71% <100.00%> (-0.02%) :arrow_down:
#drf310 97.23% <100.00%> (-0.03%) :arrow_down:
#drf311 97.71% <100.00%> (-0.02%) :arrow_down:
#drf37 97.65% <100.00%> (-0.02%) :arrow_down:
#drf38 97.65% <100.00%> (-0.02%) :arrow_down:
#drf39 97.65% <100.00%> (-0.02%) :arrow_down:
#py27 97.23% <100.00%> (-0.03%) :arrow_down:
#py35 97.23% <100.00%> (-0.03%) :arrow_down:
#py36 97.23% <100.00%> (-0.03%) :arrow_down:
#py37 97.23% <100.00%> (-0.03%) :arrow_down:
#py38 97.08% <100.00%> (-0.03%) :arrow_down:

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

Impacted Files Coverage Δ
src/rest_framework_jwt/blacklist/exceptions.py 100.00% <ø> (ø)
src/rest_framework_jwt/authentication.py 97.02% <100.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 79dda00...f0863d6. Read the comment docs.