Skip to content

2. Plugin definition discovery #410

Description

@BryanttV

Description

Implement the definition discovery mechanism without hardcoding known modules.

  • Discovery mechanism: evaluate whether to use the Python entry points pattern (similar to how Open edX already discovers Django app plugins), or a directory/file convention for YAML files.
  • Core self-discovery: openedx-authz should consume its own role/permission definitions through the same path used for external modules (this is key for the "core and contributed definitions use the same path" requirement).
  • Collection: aggregate all discovered definitions in memory before passing them to validation (don't load incrementally without seeing the full set, since there are cross-cutting validations like duplicate detection).
  • Early validation: apply the rules defined in the ADR — duplicate identifiers, unsupported scope types, broken references.
  • Load error handling: define what happens if a module has an invalid definition — does the whole startup fail, or is that module skipped with an error log?
  • Testing: cover with at least one "fake" test module simulating an external contribution, to confirm there's no accidental hardcoding of known module names.

Concrete deliverable: a working mechanism where installing a new Python package with a valid definition is enough for it to be discovered, without touching openedx-authz.

Metadata

Metadata

Assignees

No one assigned

    Labels

    willowReleased in Willow

    Type

    No type

    Projects

    Status
    Blocked

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions