Skip to main content

OL Open edX Events Handler

A generic Open edX plugin for handling Open edX signals and events for MIT Open Learning.

Purpose

This plugin serves as the centralized handler for all Open edX signals and events that MIT OL systems need to react to. Rather than creating a separate plugin for each event, all signal handlers and filters are collected here.

Currently handled events:

  • org.openedx.learning.user.course_access_role.added.v1 — When a course access role (e.g. instructor, staff) is added, notifies an external system via webhook so the user can be enrolled as an auditor in the corresponding course.

  • org.openedx.learning.course.enrollment.created.v1 — When a user is enrolled in a course (for example, when a course team manually enrolls a batch of learners from the instructor dashboard), notifies an external system via webhook so the enrollment can be mirrored there. Enrollments that the external system created itself through the Open edX enrollment REST API are skipped, see ENROLLMENT_WEBHOOK_SERVICE_WORKER_USERNAME below.

  • openedx.core.djangoapps.signals.signals.COURSE_GRADE_NOW_PASSED — When a learner earns a passing grade, notifies an external system to create a certificate.

Version Compatibility

For this plugin’s compatibility with Open edX, see the Open edX Release Compatibility table.

Installation

For detailed installation instructions, please refer to the plugin installation guide.

Installation required in:

  • LMS

  • Studio (CMS)

Configuration

edx-platform configuration

  • Add the following configuration values to the config file in Open edX. For any release after Juniper, that config file is /edx/etc/lms.yml and /edx/etc/cms.yml. If you’re using private.py, add these values to lms/envs/private.py and cms/envs/private.py. These should be added to the top level.

    ENROLLMENT_WEBHOOK_URL: "https://example.com/api/openedx_webhook/enrollment/"
    ENROLLMENT_WEBHOOK_ACCESS_TOKEN: "<your-oauth-access-token>"
    CERTIFICATE_WEBHOOK_URL: "https://example.com/api/openedx_webhook/certificate/"
    CERTIFICATE_WEBHOOK_ACCESS_TOKEN: "<your-oauth-access-token>"
  • Optionally, override the roles that trigger the webhook (defaults to ["instructor", "staff"]):

    ENROLLMENT_COURSE_ACCESS_ROLES: ["instructor", "staff"]
  • Set the username of the service worker that the external system uses to create enrollments through the Open edX enrollment REST API. Enrollments created by this user are not sent back to it:

    ENROLLMENT_WEBHOOK_SERVICE_WORKER_USERNAME: "<service-worker-username>"

    This must be the username of the Django user that owns the OAuth2 token the external system authenticates with, because that is the user Open edX resolves the request to. Do not copy the external system’s own service-worker-username setting (for example MITx Online’s OPENEDX_SERVICE_WORKER_USERNAME): nothing keeps the two in sync, and if they disagree the filter never matches and every enrollment the external system creates is sent straight back to it. Resolve the owner from the token itself:

    from oauth2_provider.models import AccessToken
    AccessToken.objects.get(token="<the external system's API token>").user.username

    When the setting is unset, or when the acting user cannot be determined (an enrollment made from a Celery task or a management command), the webhook is dispatched anyway. The receiving endpoint is idempotent, so a redundant call is harmless, while dropping a real enrollment is not.

  • For Tutor installations, these values can also be managed through a custom Tutor plugin.

Metadata

Release files for ol-openedx-events-handler 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ol-openedx-events-handler 0.4.0
File Size Uploaded Provenance
ol_openedx_events_handler-0.4.0.tar.gz 13.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ol-openedx-events-handler 0.4.0
File Interpreter ABI Platform
ol_openedx_events_handler-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.7 kB

Release files / ol_openedx_events_handler-0.4.0.tar.gz

Download URL ol_openedx_events_handler-0.4.0.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
48e86ecf56ae2ee2427aa4249e13247ea1f62d6047f72f4acef52872d08a9199
BLAKE2b-256 checksum
How to use checksums
057b96e9f1934878048c92ae34d1792002b557c517afa2a35b923ba08b7fd599
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / ol_openedx_events_handler-0.4.0-py3-none-any.whl

Download URL ol_openedx_events_handler-0.4.0-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2af66ce9108dec21f36c0dbaab9b49e4bd5de7d5619fe832cc18834c9327b78
BLAKE2b-256 checksum
How to use checksums
c00aadf94181b9f75bf4de54506dc0c20ac01d84faf5e4bf05a4fd08024aa08d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for ol-openedx-events-handler 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page