Contribution Date
Contribution Project
Contribution Details
Add the damrs base module for Drupal (M3d·5, one of six)
The deferral said "nothing in this repository can run PHP or a Drupal
install". True of the repository and false of the machine: DDEV was already
installed, so a throwaway Drupal 11.4.5 took four commands. The reason this
was parked evaporated on inspection, having been restated across several
sessions without anyone testing it.
integrations/drupal/ now holds the `damrs` base module: API client, settings
form, service-account auth, health check, and the delivery-URL signer. Enabled
on a real Drupal 11.4.5, where the settings form builds through the real
container and both services resolve.
The signer is the part that mattered. §11.3 requires transform URLs signed in
PHP with no API call in the render path — otherwise a damrs outage is a white
screen on somebody's site rather than a stale page — so a second
implementation of the delivery-token canonical form now exists in another
language, and the two have to agree byte for byte forever.
Two examples keep them honest. signing_vectors emits the vectors the PHPUnit
suite compares against offline, so changing the canonical form changes a
committed fixture, shows a diff in review, and fails the PHP suite until it is
updated too. verify_token closes the other direction: a URL minted by the live
Drupal service, from real config and the real clock, verifies in Rust with
every field correct, and both a wrong secret and a one-character tamper are
refused.
Mutation-tested, because a vector suite that cannot fail is decoration.
Character length instead of byte length, omitting an absent optional instead of
writing a zero-length field, and signing a UUID's text instead of its raw
bytes were each introduced deliberately and each fails.
Running it caught one thing immediately: Drupal's routing file must be
MODULE.routing.yml, and it was written as MODULE.routes.yml — so the module
enabled cleanly, reported no error, and had no settings page at all. A module
written against the spec would have shipped that.
Five submodules remain: damrs_media first, since the MediaSource plugin is
where the connector's value lands, then image styles, sync, editor, and
search_api last.
Contribution Issue Link
Files count
0
Patches count
1