Problem/Motivation
A site that only needs to talk to a remote Orchestra had to install the whole engine. For example, a site that hosts the forms a workflow on another site collects. orchestra_client depended on orchestra_api, and orchestra_api depended on orchestra.
Almost nothing in the client stack used the engine. A few places tied it to the engine, and some code that only the answering side uses lived in the module both sides install:
LocalOrchestraClient, the engine's in-process client, lived inorchestra_apiand was the reason it depended onorchestra. Its only consumer is theorchestra_server_apiApiController.AcceptedIdentitySchemesandIdentitySchemeResolverInterface, which decide the identity schemes this site accepts from a caller, also lived inorchestra_api, though only the answering side uses them.NoticeControllerinorchestra_clientcounts requests withDrupal\orchestra\FloodGuard, which read its switch and its period fromorchestra.settings. Its route,/orchestra-notice/{orchestra_remote}, accepts a POST from anyone, because only the signature over the body authenticates the sending site, so a client site needsFloodGuardas much as the engine site does.- The pages of
orchestra_clientsat under the engine's/admin/orchestrasection and required the engine'sadminister orchestrapermission.
This is the first step towards starting and resuming workflows from a webform on another site. That other site installs only orchestra_api, orchestra_client and a small webform module. The rule is that nothing a client site installs is specific to the answering side, and a site with the engine, the server API and the client together keeps working.
Proposed resolution
- Move
LocalOrchestraClient, its service and the binding ofOrchestraClientInterfaceto it fromorchestra_apitoorchestra_server_api.orchestra_clientstill wins that binding on a site that also answers the API, andClientBindingTestnow checks it againstorchestra_server_api. - Move
AcceptedIdentitySchemesandIdentitySchemeResolverInterfacetoorchestra_server_api. - Move
FloodGuardtoorchestra_api, with its switch and its period in a neworchestra_api.settingsconfig. The Request limits section of the Orchestra settings form becomes its own page, Configuration > Web services > Orchestra request limits.orchestra_interaction, whose capability links it counts, now depends onorchestra_api. - Give
orchestra_clientits own permission and move its pages to Configuration > Web services: Remote Orchestras and Orchestra notices. - Remove
orchestra:orchestrafrom the dependencies oforchestra_api. The kernel tests oforchestra_clientleave the engine out, andClientSiteWithoutEngineTestinstalls the client the way a site does, checks that the engine stays out, and checks that every new page names a permission the site defines.
Orchestra is pre-beta, so the classes, services and config move with no deprecation layer and no update hook.
Remaining tasks
- Review.
- On each site with
orchestra_interaction, rundrush en orchestra_apibeforedrush cr, switch request limits on again at the new page if they were on, remove the old keys withdrush config:delete orchestra.settings flood, and grant the new permissions. - Follow-up in yoyaku and pdv: their kernel tests that enable
orchestra_interactionmust enableorchestra_apitoo.
User interface changes
- The Request limits settings move from the Orchestra settings page to Configuration > Web services > Orchestra request limits.
- The Remote Orchestras and Notices pages move from the Orchestra section to Configuration > Web services, the second one renamed Orchestra notices.
API changes
Drupal\orchestra_api\LocalOrchestraClientbecomesDrupal\orchestra_server_api\LocalOrchestraClient, and the binding ofOrchestraClientInterfaceto it moves toorchestra_server_api. An engine site with neither the server API nor the client no longer binds the contract.Drupal\orchestra_api\AcceptedIdentitySchemesandDrupal\orchestra_api\IdentitySchemeResolverInterfacemove toDrupal\orchestra_server_api. The service becomesorchestra_server_api.accepted_identity_schemes, and resolvers are taggedorchestra_server_api.identity_scheme_resolver.Drupal\orchestra\FloodGuardbecomesDrupal\orchestra_api\FloodGuard, and the serviceorchestra.flood_guardbecomesorchestra_api.flood_guard.- New permissions:
administer orchestra request limitsandadminister orchestra remotes. The remote pages no longer acceptadminister orchestra.
Data model changes
The flood keys move from orchestra.settings to orchestra_api.settings.
AI-Generated: Yes (Claude Code was used to help draft this issue summary and to write the change and its tests. I reviewed them, and the new tests were confirmed to fail when the engine dependency is put back, when a page names a permission no module defines, and when the request limits form saves the wrong key.)
Issue fork orchestra-3631390
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mably commentedComment #4
mably commentedComment #6
mably commented