Skip to content

ADR-0237: A plugin names several clusters, and Rahdar checks each ​

  • Status: accepted
  • Date: 2026-12-02
  • Deciders: Mahdi Amirabdollahi
  • Change: openspec/changes/40-estate-scoped-plugins
  • Amends: ADR-0114 (one cluster per tool), ADR-0235 item 7 (how an estate entry is gated)

Context ​

A plugin works inside one cluster. A plugin assistant tool declares one permission, which is checked on the cluster in its clusterId argument (ADR-0114). A plugin feature that reads from one cluster and acts on another, such as a rule that consumes from a production broker and sends to a Kafka topic, cannot declare such a tool. Its tool would be checked on one cluster, and the plugin would have to check the other itself. Plugin REST calls on the estate path (/api/v1/p/<id>/…) name clusters in their bodies, and every plugin that answers "the clusters where you may do X" filters the cluster list by hand, as the estate Alerts page did. A plugin's estate entry is gated by access permissions that the bundle names, and nothing checks that they are global (ADR-0235 item 7).

Decision ​

  1. A tool lists the clusters it names. A plugin assistant tool declares either the one-cluster form (scope, permission, clusterId, plus resourceArg and resourceType for a resource tool) or clusters: [{arg, permission, resourceArg?, resourceType?}], with one to four entries, each with its own permission. That permission is the plugin's own, with scope cluster or resource, and a resource entry names its argument and type. An entry's argument holds a cluster id or a non-empty array of them. One call names at most 16 distinct clusters. A global tool is unchanged. Rahdar turns the one-cluster form into one entry on clusterId, so the host has one path.
  2. Every cluster is checked before anything runs. ClusterAccessGuard.requireClusters runs a visibility pass over every requirement first: the permission on a cluster, or the right to read the named queue or address. Only then does it run a permission pass for resource entries. A cluster the caller may not use answers as a hidden cluster does today. When the call names several clusters, the answer names none of them, so it cannot say which one the caller may not see. Every refusal is published as AccessRefused. The MCP bridge calls the same guard that a plugin's REST controller calls, so the two cannot drift.
  3. Rahdar lists where the caller may act. RahdarInfo.clustersHolding(permission) returns the clusters on which the caller holds the permission, by id with names, ordered by name. For a resource permission it counts grants only, never a team's patterns or shares, so every cluster listed may be acted on as a whole. A question about one queue or address stays with ClusterAccessGuard.
  4. An estate entry is gated by a global permission. The manifest carries each permission's scope. A plugin bundle whose estate entry names an access permission that is not a known global permission is refused, with the entry named. A plugin may name its own permission or one of Rahdar's.
  5. Work without a request stays on OwnerWork. A plugin's background work lists a WorkNeed per cluster (and per queue or address) it touches. Rahdar checks each against the owner's account as it is now, at publish and before every run, and suspends the work when one is lost. No new API is needed for this.
  6. Contract 20. The plugin descriptor gains clusters on a tool, the manifest a permission's scope, and the console refuses an estate entry gated by a permission that is not global. Those are contract changes, so a plugin built for 19 is refused. The @PluginApi Java surface only grows. japicmp, run against 2026.11.9 on Maven Central over @PluginApi types, reports two modified classes and no incompatible change: ClusterAccessGuard (requireClusters, ClusterRequirement) and RahdarInfo (clustersHolding). McpToolDef.Access, which gains clusters, is not plugin API.

Consequences ​

  • A cross-cluster plugin feature is one tool and one page, and each cluster it touches is checked with the permission that cluster needs. For example, a tool can require read on the source and send on the target.
  • The answer to a two-cluster call with one denied cluster does not say which cluster was denied. An operator learns which one from the audit of refusals, which names it.
  • Resource checks across clusters are limited to what each entry names. A tool that touches more queues than its arguments name checks them in its own code with requireAll, per cluster.
  • Plugin authors with a cluster tool keep the one-cluster form. Only a tool that names several clusters uses the list.

Alternatives considered ​

  • One tool-wide permission and a list of argument names. This cannot express "read on the source, send on the target", which is the case that motivated the change. A plugin would then check the other permission itself.
  • A new tool scope, clusters. The issue rules out a new permission scope. A tool scope that matches no permission scope would also break the rule that a tool's scope is its permission's.
  • Every tool on the list form. That churns every existing declaration and gains nothing for the common one-cluster tool.
  • The listing helper on PermissionResolver. The kernel does not know the registered clusters. A kernel interface added for one caller widens a contract for no gain, and RahdarInfo already lists the clusters a caller may see.
  • A cluster check in the plugin gateway. The gateway does not know which permission an endpoint needs. A visibility check there would refuse a plugin permission that is granted without cluster:read.

Apache-2.0. Apache Kafka, Apache ActiveMQ and Apache ActiveMQ Artemis are trademarks of the Apache Software Foundation. RabbitMQ is a trademark of its owner. Rahdar is an independent project, not produced by, endorsed by, or affiliated with the ASF or the owner of RabbitMQ.