Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new backend BitbucketDataCenterOAuth2 and BaseOAuth2PKCE #856

Merged
merged 17 commits into from
Nov 22, 2023
Merged

feat: add new backend BitbucketDataCenterOAuth2 and BaseOAuth2PKCE #856

merged 17 commits into from
Nov 22, 2023

Conversation

eshaan7
Copy link
Contributor

@eshaan7 eshaan7 commented Nov 9, 2023

Proposed changes

Resolves #855.
Related social-docs PR: python-social-auth/social-docs#190

  • Adds a new backend BitbucketDataCenterOAuth2.
  • Generalizes the PKCE logic in a base class BaseOAuth2PKCE and re-used in both TwitterOAuth2 and BitbucketDataCenterOAuth2.
  • Generalizes the PKCE unit-tests logic in base classes OAuth2PkcePlainTest and OAuth2PkceS256Test and re-used in both test_twitter_oauth2.py and test_bitbucket_datacenter.py

Types of changes

Please check the type of change your PR introduces:

  • Release (new release request)
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (PEP8, lint, formatting, renaming, etc)
  • Refactoring (no functional changes, no api changes)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build related changes (build process, tests runner, etc)
  • Other (please describe):

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask. We're here to
help! This is simply a reminder of what we are going to look for before merging
your code.

Other information

Any other information that is important to this PR such as screenshots of how
the component looks before and after the change.

@eshaan7 eshaan7 changed the title feat: add new backend BitbucketDataCenterOAuth2 feat: add new backend BitbucketDataCenterOAuth2 Nov 9, 2023
@nijel
Copy link
Member

nijel commented Nov 9, 2023

Abstracting that sounds like a good idea. Please also add tests and documentation.

Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (a670659) 77.34% compared to head (9799025) 77.58%.

Files Patch % Lines
social_core/backends/oauth.py 95.12% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #856      +/-   ##
==========================================
+ Coverage   77.34%   77.58%   +0.24%     
==========================================
  Files         341      343       +2     
  Lines       10413    10525     +112     
  Branches      699      700       +1     
==========================================
+ Hits         8054     8166     +112     
  Misses       2201     2201              
  Partials      158      158              
Flag Coverage Δ
unittests 77.58% <98.91%> (+0.24%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

johanseto added a commit to eduNEXT/eox-core that referenced this pull request Nov 17, 2023
This add a generic backend based in ConfigurableOpenIdConnectAuth but
with PKCE.
This backend is inspired  in the social-core way to implement PKCE.
There is a current PR in working, but for the moment, that class is not merged and accesible.
So after that is finished this has it code for `code_challenge` and `code_challenge_method`implementation.
PR: python-social-auth/social-core#856
johanseto added a commit to eduNEXT/eox-core that referenced this pull request Nov 20, 2023
This add a generic backend based in ConfigurableOpenIdConnectAuth but
with PKCE.
This backend is inspired  in the social-core way to implement PKCE.
There is a current PR in working, but for the moment, that class is not merged and accesible.
So after that is finished this has it code for `code_challenge` and `code_challenge_method`implementation.
PR: python-social-auth/social-core#856
johanseto added a commit to eduNEXT/eox-core that referenced this pull request Nov 20, 2023
This add a generic backend based in ConfigurableOpenIdConnectAuth but
with PKCE.
This backend is inspired  in the social-core way to implement PKCE.
There is a current PR in working, but for the moment, that class is not merged and accesible.
So after that is finished this has it code for `code_challenge` and `code_challenge_method`implementation.
PR: python-social-auth/social-core#856
@eshaan7 eshaan7 marked this pull request as ready for review November 21, 2023 10:00
@eshaan7
Copy link
Contributor Author

eshaan7 commented Nov 21, 2023

@nijel;

Can I get a review on this now? I have added complete tests along with refactoring the existing PKCE ones. Just docs pending, will do it later.

Copy link
Member

@nijel nijel left a comment

Choose a reason for hiding this comment

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

Thanks, looks good now. I think we can merge this once the docs is ready as well.

social_core/tests/backends/test_twitter_oauth2.py Outdated Show resolved Hide resolved
@eshaan7
Copy link
Contributor Author

eshaan7 commented Nov 21, 2023

@nijel; pushed some smaller changes addressing the review and made USE_PKCE a configurable setting for Bitbucket Data Center since it supports both with and without.

Also, docs PR is up at: python-social-auth/social-docs#190

Copy link
Contributor

@johanseto johanseto left a comment

Choose a reason for hiding this comment

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

Add some style suggestions

social_core/backends/oauth.py Outdated Show resolved Hide resolved
social_core/backends/oauth.py Outdated Show resolved Hide resolved
social_core/backends/oauth.py Outdated Show resolved Hide resolved
johanseto added a commit to eduNEXT/eox-core that referenced this pull request Nov 21, 2023
* feat: add pkce-openid-backend

This adds a generic backend based on ConfigurableOpenIdConnectAuth but
with PKCE.
This backend is inspired in the social-core way to implement PKCE.
There is a current PR in work, but for the moment, that class is not merged and accessible.
So after that is finished this has it code for `code_challenge` and `code_challenge_method`implementation.
PR: python-social-auth/social-core#856

* refactor: avoid repeated pkce conf definition

* feat: update with small changes social_core

* refactor: suggestions from code review

Co-authored-by: Omar Al-Ithawi @ NELC <134635705+omar-nelc@users.noreply.github.com>
Co-authored-by: Andrey Cañon <andrey.canon@edunext.co>
Co-authored-by: Johan Castiblanco <51926076+johanv26@users.noreply.github.com>
@eshaan7
Copy link
Contributor Author

eshaan7 commented Nov 22, 2023

@nijel; Let's merge this :D

@nijel nijel merged commit 51ff887 into python-social-auth:master Nov 22, 2023
8 checks passed
@nijel
Copy link
Member

nijel commented Nov 22, 2023

Merged, thanks for your contribution!

@eshaan7 eshaan7 deleted the feature/new-backend/bitbucket-datacenter-oauth2 branch November 23, 2023 17:15
@eshaan7 eshaan7 changed the title feat: add new backend BitbucketDataCenterOAuth2 feat: add new backend BitbucketDataCenterOAuth2 and BaseOAuth2PKCE Jan 12, 2024
andrey-canon added a commit to eduNEXT/eox-core that referenced this pull request Mar 5, 2024
* feat: add pkce-openid-backend

This adds a generic backend based on ConfigurableOpenIdConnectAuth but
with PKCE.
This backend is inspired in the social-core way to implement PKCE.
There is a current PR in work, but for the moment, that class is not merged and accessible.
So after that is finished this has it code for `code_challenge` and `code_challenge_method`implementation.
PR: python-social-auth/social-core#856

* refactor: avoid repeated pkce conf definition

* feat: update with small changes social_core

* refactor: suggestions from code review

Co-authored-by: Omar Al-Ithawi @ NELC <134635705+omar-nelc@users.noreply.github.com>
Co-authored-by: Andrey Cañon <andrey.canon@edunext.co>
andrey-canon added a commit to eduNEXT/eox-core that referenced this pull request Mar 5, 2024
This adds a generic backend based on ConfigurableOpenIdConnectAuth but
with PKCE.
This backend is inspired in the social-core way to implement PKCE.
There is a current PR in work, but for the moment, that class is not merged and accessible.
So after that is finished this has it code for `code_challenge` and `code_challenge_method`implementation.
PR: python-social-auth/social-core#856

Co-authored-by: Omar Al-Ithawi @ NELC <134635705+omar-nelc@users.noreply.github.com>
Co-authored-by: Andrey Cañon <andrey.canon@edunext.co>
andrey-canon added a commit to eduNEXT/eox-core that referenced this pull request Mar 5, 2024
This adds a generic backend based on ConfigurableOpenIdConnectAuth but
with PKCE.
This backend is inspired in the social-core way to implement PKCE.
There is a current PR in work, but for the moment, that class is not merged and accessible.
So after that is finished this has it code for `code_challenge` and
`code_challenge_method`implementation.
PR: python-social-auth/social-core#856

Co-authored-by: Omar Al-Ithawi @ NELC <134635705+omar-nelc@users.noreply.github.com>
Co-authored-by: Andrey Cañon <andrey.canon@edunext.co>
andrey-canon added a commit to eduNEXT/eox-core that referenced this pull request Dec 26, 2024
This adds a generic backend based on ConfigurableOpenIdConnectAuth but
with PKCE.
This backend is inspired in the social-core way to implement PKCE.
There is a current PR in work, but for the moment, that class is not merged and accessible.
So after that is finished this has it code for `code_challenge` and
`code_challenge_method`implementation.
PR: python-social-auth/social-core#856

Co-authored-by: Omar Al-Ithawi @ NELC <134635705+omar-nelc@users.noreply.github.com>
Co-authored-by: Andrey Cañon <andrey.canon@edunext.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[New backend] Bitbucket Data Center OAuth2
3 participants