labd / django-cognito-jwt

An Authentication backend for Django Rest Framework for AWS Cognito JWT tokens
MIT License
177 stars 59 forks source link

Adding request to user method #21

Open JoeButler99 opened 4 years ago

JoeButler99 commented 4 years ago

Hi everyone, - I needed a method to add the request object to the call to get_or_create_for_cognito. I saw in one of the other pull requests this was also added.

I've created a crude system to do this, now I can receive from this library with def get_or_create_for_cognito(self, jwt_payload, request): in my manager model.

I am open to helping any suggestions to doing this in a better/cleaner way. (I'm also quite new to python packaging and its tooling..)

codecov[bot] commented 4 years ago

Codecov Report

Merging #21 into master will decrease coverage by 2.22%. The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #21      +/-   ##
==========================================
- Coverage     100%   97.77%   -2.23%     
==========================================
  Files           3        3              
  Lines          87       90       +3     
  Branches        9       10       +1     
==========================================
+ Hits           87       88       +1     
- Misses          0        1       +1     
- Partials        0        1       +1
Impacted Files Coverage Δ
src/django_cognito_jwt/backend.py 95.34% <50%> (-4.66%) :arrow_down:

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 6a30df4...1fe35ca. Read the comment docs.

codecov[bot] commented 4 years ago

Codecov Report

Merging #21 into master will decrease coverage by 2.22%. The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #21      +/-   ##
==========================================
- Coverage     100%   97.77%   -2.23%     
==========================================
  Files           3        3              
  Lines          87       90       +3     
  Branches        9       10       +1     
==========================================
+ Hits           87       88       +1     
- Misses          0        1       +1     
- Partials        0        1       +1
Impacted Files Coverage Δ
src/django_cognito_jwt/backend.py 95.34% <50%> (-4.66%) :arrow_down:

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 6a30df4...1fe35ca. Read the comment docs.