Skip to content

Conversation

ShaheedHaque
Copy link
Contributor

@ShaheedHaque ShaheedHaque commented Mar 22, 2021

Fixes #712
Fixes #636
Fixes #808

Description of the Change

The function django.contrib.auth.authenticate() has an optional first request argument. Some backends, such as django-axes (i.e. the subject of #712) and others (i.e. the subject of #636) require this argument to be present. This change provides this argument.

Additionally, this change is based on the patch in #712, and constructs a Django HttpRequest object from the DOT request object in order to provide API compatibility. This avoid the issue that caused the original fix for #636 to be reverted, and also addresses #808.

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

@codecov
Copy link

codecov bot commented Mar 22, 2021

Codecov Report

Merging #949 (c2580d3) into master (39a4577) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #949      +/-   ##
==========================================
+ Coverage   96.59%   96.60%   +0.01%     
==========================================
  Files          31       31              
  Lines        1704     1710       +6     
==========================================
+ Hits         1646     1652       +6     
  Misses         58       58              
Impacted Files Coverage Δ
oauth2_provider/oauth2_validators.py 93.66% <100.00%> (+0.09%) ⬆️

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 39a4577...c2580d3. Read the comment docs.

@ShaheedHaque ShaheedHaque force-pushed the enhance_compatibility_with_django_auth branch from f179f76 to a0ead0b Compare March 22, 2021 13:37
@ShaheedHaque ShaheedHaque force-pushed the enhance_compatibility_with_django_auth branch from 7506170 to 2989685 Compare March 22, 2021 14:07
@n2ygk
Copy link
Contributor

n2ygk commented Mar 22, 2021

@ShaheedHaque are you ready for review? I seem to have jumped the gun and started reviewing....

@n2ygk n2ygk added this to the 1.5.1 milestone Mar 22, 2021
@ShaheedHaque
Copy link
Contributor Author

@n2ygk Yes, sorry, I kept seeing merge conflicts and the like because I caught things just as 1.5.0 was going out. Also, there was a slight reduction in code coverage which I realised I could eliminate. No more changes are planned at this point :-).

Clean up some mis-merged updates.
Copy link
Contributor

@n2ygk n2ygk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

@n2ygk n2ygk merged commit 9d2aac2 into django-oauth:master Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants