Skip to content

feat: add filters to support logistration integration - #337

Merged
pwnage101 merged 1 commit into
openedx:mainfrom
pwnage101:pwnage101/ENT-11568
Aug 7, 2026
Merged

feat: add filters to support logistration integration#337
pwnage101 merged 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 several new structural types:
    • 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.
    • RunningPipeline - authentication pipeline state.

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 5 times, most recently 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.

Comment thread openedx_filters/authentication/protocols.py Outdated

## 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?

@pwnage101
pwnage101 force-pushed the pwnage101/ENT-11568 branch 2 times, most recently from 085932c to d245e72 Compare August 5, 2026 23:50

@ssurendrannair ssurendrannair 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.

Approved — Looks good to me.
One suggestion for follow-up: consider adding negative-path tests for malformed or unexpected filter outputs. Since these filters are extension points in the authentication flow, validating failure scenarios would strengthen the contract and help catch regressions as new implementations are added.

@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.

Thanks for all the work @pwnage101 writing and refactoring after review. I think this PR has reached a very good form now.

* Added new `authentication` architecture subdomain
* Added six new authentication-related filters:
  * `LogistrationViewContextGenerated`
  * `AuthnMFEContextGenerated`
  * `LoginAltRedirectURLRequested`
  * `LoginFormGenerated`
  * `RegistrationFormGenerated`
  * `LogistrationViewRenderCompleted`
* Added several new structural types:
  * `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.
  * `RunningPipeline` - authentication pipeline state.

ENT-11568
@pwnage101
pwnage101 force-pushed the pwnage101/ENT-11568 branch from 1fe1131 to 673a948 Compare August 7, 2026 00:30

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

Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.

Suppressed comments (2)

openedx_filters/filters.py:62

  • The pipeline runner treats any non-dict return value (including custom sentinel objects) as a signal to stop execution (OpenEdxPublicFilter.run_pipeline checks isinstance(result, dict)). However, PipelineStep.run_filter is annotated as returning only dict[str, Any] | None, which conflicts with the documented “object different from a dict” return and will cause type checkers to flag legitimate pipeline-step implementations.
    # The explicit ``return None`` below is required by static type checkers, which treat an
    # implicit fall-through as a missing return whenever a return type is annotated.
    def run_filter(  # pylint: disable=useless-return
        self, *args: Any, **kwargs: Any,
    ) -> dict[str, Any] | None:

openedx_filters/authentication/types.py:90

  • PR description says only one new structural type (FormDescriptionProtocol), but this PR also introduces ProviderConfigProtocol in the same module. Please update the PR description (or reconcile the scope) so it matches the shipped public surface.
class ProviderConfigProtocol(Protocol):
    """
    Structural interface of the third-party auth provider configuration.

    Only the minimal surface consumed by pipeline steps is declared here. Pipeline steps

Comment thread docs/reference/filters.rst
Comment thread setup.py
@pwnage101
pwnage101 merged commit 6ff0b5a into openedx:main Aug 7, 2026
11 checks passed
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.

6 participants