Repository navigation
Description
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 ofParams); pluspresets,
the default pipeline and the client constraints (enabled,
max_steps,max_alternatives, frame step IDs,tag_prefix,
client_backends). Adminconfignever returned.GET <base>/plugins/{id}: one plugin;404for unknown and
non-visible ones alike.
foca.plugins.api.service_info_fields()for
service_info.runtime_fields: an extension fieldgatewaywith
plugins_url,client_pipelines,client_backendsand 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. roleuser
mayGET <base>/plugins*, andGET <base>/tasks/{id}/provenance
(the app's own endpoint; ownership checked as forGET /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 forGET <base>/plugins*
andGET <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
- Blocked by feat(plugins): resolve per-request pipelines #487 (P2: selection rules, constraints).
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.
Activity
fix(plugins): hide steps and defer plugin setup