feat: remove enterprise imports from third_party_auth#38103
Open
feat: remove enterprise imports from third_party_auth#38103
Conversation
dc287f4 to
38b5af9
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR continues the enterprise pluginification effort by removing platform-side enterprise dependencies from third_party_auth, shifting enterprise-specific social-auth pipeline behavior and SAML disconnect cleanup to the enterprise plugin via settings injection and a new Django signal contract.
Changes:
- Removed enterprise model imports/utilities from
third_party_auth(pipeline association helper, SAML disconnect unlinking). - Introduced
SAMLAccountDisconnectedsignal and updated SAML disconnect flow to emit it. - Updated LMS social-auth pipeline settings and added ADR documentation describing the decoupling and new contracts.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| openedx/features/enterprise_support/tests/test_api.py | Removes tests tied to platform-side enterprise/TPA coupling (pipeline insertion + unlink helper). |
| openedx/features/enterprise_support/api.py | Deletes now-unneeded helpers that supported third_party_auth enterprise coupling. |
| lms/envs/common.py | Updates default SOCIAL_AUTH_PIPELINE and clarifies enterprise pipeline injection ownership (enterprise plugin). |
| docs/decisions/0026-enterprise-decoupled-from-third-party-auth.rst | Adds ADR documenting the migration, new signal contract, and pipeline injection approach. |
| docs/decisions/0025-saml-admin-views-in-enterprise-plugin.rst | Updates ADR wording to reflect current decoupling approach/implications. |
| common/djangoapps/third_party_auth/utils.py | Removes enterprise-model-dependent helper. |
| common/djangoapps/third_party_auth/tests/test_utils.py | Removes unit test coverage for the removed enterprise-only helper. |
| common/djangoapps/third_party_auth/tests/specs/test_testshib.py | Updates integration test to validate signal emission instead of enterprise unlink side effects. |
| common/djangoapps/third_party_auth/signals/signals.py | Adds the new SAMLAccountDisconnected signal definition. |
| common/djangoapps/third_party_auth/signals/init.py | Re-exports the signal for a stable import path. |
| common/djangoapps/third_party_auth/saml.py | Emits SAMLAccountDisconnected during SAML disconnect before removing the social-auth record. |
| common/djangoapps/third_party_auth/pipeline.py | Converts associate_by_email_if_saml into a deprecated no-op for backward compatibility. |
| common/djangoapps/third_party_auth/models.py | Adds clarifying comments around the enterprise-only disable_for_enterprise_sso field. |
| common/djangoapps/third_party_auth/apps.py | Removes enterprise pipeline mutation from AppConfig.ready(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Remove enterprise pipeline functions and insert_enterprise_pipeline_elements; enterprise pipeline steps are now injected by the enterprise plugin. - Add SAMLAccountDisconnected signal in SAMLAuth.disconnect() to replace the unlink_enterprise_user_from_idp import (moved to the enterprise plugin). - Added an ADR to help explain the migration. ENT-11566 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
38b5af9 to
9ba777f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ENT-11566
Blocked by: