Skip to content

feat: remove enterprise imports from third_party_auth#38103

Open
pwnage101 wants to merge 1 commit intomasterfrom
pwnage101/ENT-11566
Open

feat: remove enterprise imports from third_party_auth#38103
pwnage101 wants to merge 1 commit intomasterfrom
pwnage101/ENT-11566

Conversation

@pwnage101
Copy link
Copy Markdown
Contributor

@pwnage101 pwnage101 commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 SAMLAccountDisconnected signal 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>
@pwnage101 pwnage101 force-pushed the pwnage101/ENT-11566 branch from 38b5af9 to 9ba777f Compare April 20, 2026 21:37
@pwnage101 pwnage101 marked this pull request as ready for review April 20, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enterprise An enterprise-related change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants