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: allow oauth configuration per site and backend #32656

Merged

Conversation

navinkarkera
Copy link
Contributor

@navinkarkera navinkarkera commented Jul 5, 2023

Description

Currently, we can only add oauth configuration for a given backend to only a single site. This PR includes site_id in KEY_FIELDS for oauth configuration provider allowing a backend configuration for each site.

Supporting information

Mostly copied from eduNEXT/edunext-platform#601 except for minor changes like ignoring site_id in provider id as site_id is already considered while fetching the correct configuration.

Testing instructions

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 5, 2023
@openedx-webhooks
Copy link

openedx-webhooks commented Jul 5, 2023

Thanks for the pull request, @navinkarkera! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@navinkarkera navinkarkera force-pushed the navin/multsite-oauth-config-master branch 2 times, most recently from 04197d4 to a473c5d Compare July 7, 2023 14:52
@navinkarkera navinkarkera marked this pull request as ready for review July 7, 2023 16:44
@navinkarkera navinkarkera force-pushed the navin/multsite-oauth-config-master branch from a473c5d to 8d29434 Compare July 7, 2023 16:45
Copy link
Contributor

@kaustavb12 kaustavb12 left a comment

Choose a reason for hiding this comment

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

👍

Already reviewed and tested the internal PR open-craft#542

This PR is identical to that.

@mphilbrick211
Copy link

Hi @navinkarkera - is this ready for review?

kaustavb12 added a commit to open-craft/edx-platform that referenced this pull request Aug 15, 2023
* feat: allow oauth configuration per site and backend

Allows admins to configure same oauth backend for multiple sites

(cherry picked from commit efd2ef9)

* fix: skip pipeline if oauth provider for site is not setup

(cherry picked from commit 29f8494)

* refactor: remove site_id from provider_id

(cherry picked from commit 236f7a5)

---------

Cherry pick of #542 

Upstream PR openedx#32656

[BB-7589](https://tasks.opencraft.com/browse/BB-7589)

---------

Co-authored-by: Navin Karkera <navin@opencraft.com>
@mphilbrick211
Copy link

Hi @navinkarkera! Flagging the new tests that have popped up, per the recent update: https://discuss.openedx.org/t/minor-change-to-edx-platform-check-statuses/11131

@navinkarkera navinkarkera force-pushed the navin/multsite-oauth-config-master branch from 8d29434 to facb9c8 Compare September 13, 2023 10:28
@mphilbrick211
Copy link

Hi @openedx/arch-bom! is this something you can please review/merge for us? Thanks!

@robrap
Copy link
Contributor

robrap commented Sep 14, 2023

Before digging into details, I made a comment related on this DEPR openedx/platform-roadmap#21 (comment) on site_configuration, because it would be useful to know direction around this.

Copy link
Contributor

@robrap robrap left a comment

Choose a reason for hiding this comment

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

Thank you. Mostly minor comments, and hoping that new tests would help me better understand the actual core changes of this PR.

@robrap robrap assigned navinkarkera and unassigned robrap Sep 26, 2023
@robrap robrap added the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Sep 26, 2023
@navinkarkera navinkarkera force-pushed the navin/multsite-oauth-config-master branch from facb9c8 to 0a46ea7 Compare September 28, 2023 09:34
@navinkarkera
Copy link
Contributor Author

@robrap I have updated the PR to address your comments, please have a look when you find some time.

Copy link
Contributor

@robrap robrap left a comment

Choose a reason for hiding this comment

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

I'd like to see some of the minor improvements to the test if you can, but none of my comments are blocking. Thank you!

common/djangoapps/third_party_auth/tests/test_provider.py Outdated Show resolved Hide resolved
common/djangoapps/third_party_auth/tests/test_provider.py Outdated Show resolved Hide resolved
@navinkarkera navinkarkera force-pushed the navin/multsite-oauth-config-master branch from 5331bd7 to d91a17e Compare September 29, 2023 14:47
@robrap
Copy link
Contributor

robrap commented Sep 29, 2023

@navinkarkera: Remind me if you'll need this merged for you, and let me know if you are ready for that. Thank you!

@mphilbrick211 mphilbrick211 removed the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Oct 2, 2023
Allows admins to configure same oauth backend for multiple sites

(cherry picked from commit be4b676)

refactor: remove site_id from provider_id

(cherry picked from commit 7bbe8e8)

fix: skip pipeline if oauth provider for site is not setup

(cherry picked from commit ec738bc)

docs: update test docstrings

test: add test for oauth config per site
@navinkarkera navinkarkera force-pushed the navin/multsite-oauth-config-master branch from d91a17e to bd55bfe Compare October 9, 2023 14:32
@navinkarkera
Copy link
Contributor Author

@robrap Thanks! This is ready to be merged.

@robrap robrap merged commit 565b34e into openedx:master Oct 10, 2023
45 of 61 checks passed
@openedx-webhooks
Copy link

@navinkarkera 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

@Agrendalath Agrendalath deleted the navin/multsite-oauth-config-master branch November 9, 2023 15:04
0x29a pushed a commit to open-craft/edx-platform that referenced this pull request Dec 28, 2023
Allows admins to configure same oauth backend for multiple sites.

This change includes site_id in KEY_FIELDS for oauth configuration
provider allowing a backend configuration for each site.

(cherry picked from commit 565b34e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants