Skip to content

feat: add filters to support logistration integration - #337

Open
pwnage101 wants to merge 1 commit into
openedx:mainfrom
pwnage101:pwnage101/ENT-11568
Open

feat: add filters to support logistration integration#337
pwnage101 wants to merge 1 commit into
openedx:mainfrom
pwnage101:pwnage101/ENT-11568

Conversation

@pwnage101

@pwnage101 pwnage101 commented Mar 5, 2026

Copy link
Copy Markdown
Contributor
  • Added new authentication architecture subdomain, and ADR to explain why it is needed.
  • Added six new authentication-related filters:
    • LogistrationViewContextGenerated
    • AuthnMFEContextGenerated
    • LoginAltRedirectURLRequested
    • LoginFormGenerated
    • RegistrationFormGenerated
    • LogistrationViewRenderCompleted
  • Added one new structural type:
    • FormDescriptionProtocol - declares the minimal surface the form filters pass to pipeline steps.

ENT-11568


Integration Testing

See openedx/edx-enterprise#2551 (comment)


Related:

Comment thread openedx_filters/learning/filters.py Outdated
@pwnage101
pwnage101 force-pushed the pwnage101/ENT-11568 branch 3 times, most recently from 0fa2f77 to 8651fc4 Compare July 13, 2026 19:47
@pwnage101
pwnage101 force-pushed the pwnage101/ENT-11568 branch 3 times, most recently from 5ebe0d6 to c0c46d4 Compare July 14, 2026 05:01
@pwnage101 pwnage101 changed the title feat: add LogistrationContextRequested and PostLoginRedirectURLRequested filters feat: add filters to support logistration integration Jul 14, 2026
@pwnage101
pwnage101 requested a review from Copilot July 14, 2026 05:05

Copilot AI left a comment

Copy link
Copy Markdown

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 extends the openedx_filters.learning public filter surface to support “logistration” (combined login/registration) and related auth flows, aligning the filters library with new integration points in edx-platform/enterprise.

Changes:

  • Added six new learning filters for logistration context/response customization, MFE redirect control, post-login redirect override, and TPA form overrides.
  • Added two structural Protocol types (FormDescriptionProtocol, ProviderConfigProtocol) to document the minimal interface passed to pipeline steps.
  • Added/updated test coverage for the new filters, and bumped package version + changelog entry.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
openedx_filters/learning/filters.py Adds new logistration/auth-related filters and protocol structural types.
openedx_filters/learning/tests/test_filters.py Adds unit tests validating new filters’ filter_type values and passthrough/exception behavior.
openedx_filters/init.py Bumps package version to 3.9.0.
CHANGELOG.rst Adds a 3.9.0 changelog entry describing the new filters and protocols.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread openedx_filters/learning/filters.py Outdated
@pwnage101
pwnage101 force-pushed the pwnage101/ENT-11568 branch 2 times, most recently from 0c4ee36 to 2f95918 Compare July 22, 2026 01:47
Comment thread CHANGELOG.rst Outdated
Comment thread openedx_filters/learning/tests/test_filters.py Outdated

@iloveagent57 iloveagent57 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good, one small suggestion to DRY things up a tiny bit.

Comment thread openedx_filters/learning/filters.py Outdated
@pwnage101
pwnage101 force-pushed the pwnage101/ENT-11568 branch from 6d579f6 to 5602d20 Compare July 29, 2026 16:10
@pwnage101

pwnage101 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@felipemontoya or @feanil could use one of your eyes on this big one.

The full ADR may be the best way to catch up, and there's a diagram in there too: https://github.com/openedx/edx-enterprise/blob/abd13d1be582e5c51f57373608d67032c96d4056/docs/decisions/0016-logistration-filters.md

Comment thread openedx_filters/learning/filters.py Outdated

@felipemontoya felipemontoya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this work is good and overall very needed in the login/registration extensibility story. Thanks for putting this together @pwnage101. Now that I understand the context, new review should be quicker.

Comment thread openedx_filters/learning/filters.py Outdated
Comment thread openedx_filters/learning/filters.py Outdated
Comment thread openedx_filters/learning/filters.py Outdated
Comment thread openedx_filters/learning/filters.py Outdated
Comment thread openedx_filters/learning/filters.py Outdated
Comment thread openedx_filters/learning/filters.py Outdated
Comment thread openedx_filters/learning/filters.py Outdated
@pwnage101
pwnage101 force-pushed the pwnage101/ENT-11568 branch from 5602d20 to fc89cc1 Compare August 4, 2026 17:58
@pwnage101

pwnage101 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@felipemontoya Awesome feedback! I just updated this PR to incorporate all of your feedback, with the exception of one:

I opted not to create a consolidated ContextGenerated filter. The reality of the two "context" dictionaries is that the shape differs between the legacy template context and the AuthN MFE context, so their processing cannot be safely collapsed under one filter. With extra work on the MFE, we could bring the two context dicts into alignment, but that is out of scope.

But, that did make me realize that I was completely missing an AuthnMFEContextGenerated filter, so I added that.

Additionally I created a new architecture subdomain called "Authentication", and added a new ADR (0008) to justify it.

Here's a quick overview of the 6 new authentication filters, plus the 2 pre-existing ones which still live under the "Learning" subdomain:

Class Type
LogistrationViewContextGenerated org.openedx.authentication.logistration_view.context.generated.v1
LogistrationViewRenderCompleted org.openedx.authentication.logistration_view.render.completed.v1
AuthnMFEContextGenerated org.openedx.authentication.mfe.context.generated.v1
LoginFormGenerated org.openedx.authentication.login.form.generated.v1
RegistrationFormGenerated org.openedx.authentication.registration.form.generated.v1
LoginAltRedirectURLRequested org.openedx.authentication.login.alt_redirect_url.requested.v1
StudentRegistrationRequested org.openedx.learning.student.registration.requested.v1
StudentLoginRequested org.openedx.learning.student.login.requested.v1

For the platform reference, you'll need to refer to edx/edx-platform#407

@pwnage101
pwnage101 force-pushed the pwnage101/ENT-11568 branch from fc89cc1 to 7daae2b Compare August 4, 2026 20:37
@pwnage101
pwnage101 force-pushed the pwnage101/ENT-11568 branch 4 times, most recently from b633447 to c88bcdf Compare August 5, 2026 01:16
* Added new `authentication` architecture subdomain
* Added six new authentication-related filters:
  * `LogistrationViewContextGenerated`
  * `AuthnMFEContextGenerated`
  * `LoginAltRedirectURLRequested`
  * `LoginFormGenerated`
  * `RegistrationFormGenerated`
  * `LogistrationViewRenderCompleted`
* Added one new structural type:
  * `FormDescriptionProtocol` - declares the minimal surface the form filters
    pass to pipeline steps.
  * `ProviderConfigProtocol` - declares the minimal surface of the third-party
    auth provider configuration that the form filters pass to pipeline steps.

ENT-11568
@pwnage101
pwnage101 force-pushed the pwnage101/ENT-11568 branch from c88bcdf to aebe588 Compare August 5, 2026 01:30
Comment thread docs/conf.py
'sphinx_copybutton',
'sphinx.ext.graphviz',
'sphinxcontrib.mermaid',
'myst_parser',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

markdown support for docs is needed because on Github only markdown supports mermaid rendering.

should not rely on anything beyond this protocol.
"""

def override_field_properties(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could one use this to add a new field?

My understanding is that it would not work because it only works on existing fields, but adding the capacity to add a filter to the protocol would be a killer feature for anyone trying to have their own logistration logic.


## Decision

We will introduce a new "Authentication" architecture subdomain, implemented in

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@mariajgrimaldi this makes sense to me, but I'll like to know your thoughs. Should this mean that we also add a similar subdomain in events?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants