Skip to content

fix(api)!: load only installed middlewares #217

Closed as not planned
Closed as not planned

Description

@uniqueg

Why?

Child of #194 and #201. The middleware management spec merged in #196 adds middlewares from Git repositories, PyPI packages and local paths at runtime, and the API has no security. Implemented as specified, anyone who can reach the API can run code in proTES. Even restricted to admins, installing code at runtime bypasses review and image builds, and fails on read-only container file systems (FOCA's chart). #201 also requires the middleware API to be restricted to ECP_CLN:ADMIN.

How?

  1. Middlewares come only from installed packages: an entry-point group (e.g. pro_tes.middlewares), with the built-in ones (random and distance-based task distribution) registered there; third-party middlewares are installed into the image.
  2. Revise api/middleware_management.yaml: a middleware is referenced by its entry-point name (with its config), no git/pypi/local sources or package locations; problem details for errors; served under the TES base path.
  3. Security: bearer auth; only the role admin (ECP_CLN:ADMIN) may change the stack; reads per the decision on the middleware direction.
  4. Register the spec again in config.yaml (it was unregistered in the FOCA 0.15 upgrade, refactor!: upgrade to FOCA 0.15 #203).
  5. Docs: middlewares page (how to write, package and install a middleware).

Acceptance criteria

  • The API cannot install or import code that isn't an installed, registered middleware; tests cover rejected references.
  • Only admins can change the middleware stack.
  • The built-in middlewares are available through entry points; documented.

Update (2026-10-22): generic configuration. proTES must stay generic, so that any organization can deploy it with its own identity provider, clients and groups. Wherever this issue names LS Login, ECP_CLN, Krini, Conquest or other ELIXIR On-Cloud specifics, read them as examples of deployment configuration: the implementation has no such defaults (issuers, audiences, service clients, group mappings and on-behalf-of clients are all set by the deployment), and config comments, chart values, docs and tests use generic, clearly fictitious values. ELIXIR On-Cloud deployment values are documented outside this repository.

Activity

  1. added
    priority: high
    status: blocked
    type flag: breaking change
    type flag: spec change
    type: feature
    type: security
    workload: days
    on Oct 22, 2026
  2. self-assigned this
    on Oct 23, 2026
  3. moved this from Backlog to In progress in ELIXIR On-Cloudon Oct 23, 2026
  4. uniqueg commented on Oct 24, 2026

    @uniqueg
    MemberAuthor

    Closing as superseded.

    The goals of this issue are met by the new plugin engine in FOCA
    (foca.plugins, elixir-cloud-aai/foca#486, FOCA 0.18.0):

    • only installed code runs: plugins are entry points, and only those
      listed in the operator's allowlist (plugins.available) are imported,
      optionally pinned to a distribution and version;
    • no runtime installation from Git, PyPI or local paths;
    • unknown or mismatching plugins stop the app at startup.

    The entry-point group is foca.plugins (not pro_tes.middlewares), as
    the same engine serves proWES and later gateways. proTES adopts it in
    #321. The unused management spec (api/middleware_management.yaml) and
    the middlewares collection are removed in #316.

  5. moved this from In progress to Done in ELIXIR On-Cloudon Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: highstatus: blockedtype flag: breaking changetype flag: spec changetype: featuretype: securityworkload: days

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions