Skip to content

feat(plugins): list available plugins #489

Closed

Description

@uniqueg

Problem

Clients (SDK, Krini) can only choose per-task pipelines if they can
query which plugins and presets they may use. Unauthenticated discovery
(e.g. by registries or portals) needs to know what a gateway can do,
without an attack map of installed code.

Proposal

  • Spec fragment (foca/plugins/api.yaml) and controllers
    (foca.plugins.api), registered by the app under its base path like
    FOCA's service-info spec:
    • GET <base>/plugins, authenticated (Q11): per selectable plugin
      the principal may use: id, title, description, group,
      subgroup, phases, capabilities, maturity, distribution,
      version, params_schema (JSON Schema of Params); plus presets,
      the default pipeline and the client constraints (enabled,
      max_steps, max_alternatives, frame step IDs, tag_prefix,
      client_backends). Admin config never returned.
    • GET <base>/plugins/{id}: one plugin; 404 for unknown and
      non-visible ones alike.
  • foca.plugins.api.service_info_fields() for
    service_info.runtime_fields: an extension field gateway with
    plugins_url, client_pipelines, client_backends and the union of
    the enabled plugins' capability descriptors (generic terms from a
    community vocabulary, e.g. crypt4gh-input; no IDs, distributions or
    versions; D8).
  • Controllers take the principal from foca.plugins.adapter; the
    listing itself is a pure function of config, loaded plugins and
    principal.
  • Access control: FOCA ships no default policies for these routes.
    It documents the rules apps add to their policies, e.g. role user
    may GET <base>/plugins*, and GET <base>/tasks/{id}/provenance
    (the app's own endpoint; ownership checked as for GET /tasks/{id}).

Acceptance criteria

  • Listing filtered by roles and client_selectable; enabled: false
    plugins and presets that need them hidden.
  • Unauthenticated /plugins → 401; service-info fields contain no
    plugin IDs or versions.
  • Docs: endpoint description, service-info extension, how apps register
    the fragment, and the policy rules apps add for GET <base>/plugins*
    and GET <base>/tasks/{id}/provenance.
  • 100% coverage, mypy, ruff, mkdocs build --strict.

Surviving the Connexion 3 migration

The OpenAPI fragment and the listing function are framework-free;
controllers return plain dicts (portable return values). Only the
principal lookup goes through foca.plugins.adapter, which rc1
replaces.

Dependencies

Open questions

  • Who curates the capability vocabulary: GA4GH Cloud Work Stream, or
    FOCA docs until one exists (chosen for now)?

Added during pre-review: the listing equals what selection accepts for the caller: plugins are listed only if the caller may send inline pipelines (client_pipelines.enabled, roles, inline in allowed), presets only if presets are allowed for the caller and the caller may use them (PluginHost.may_use_preset); GET <base>/plugins/{id} agrees. The 403 response is documented as coming from the app's access-control policy; client_pipelines and client_backends are fully typed in the spec.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: highstatus: blockedtype: featureworkload: days

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions