Problem/Motivation

In #3316617: Add a validator to check that PHP-TUF's Composer integration is present and configured correctly we are adding a validator that ensures PHP-TUF support is present in the site's Composer configuration. However, the validator is not actually tagged as an event subscriber, so it's dormant code.

Several things have to happen for TUF to be activated on a Drupal site (most need child issues):

  • The PHP-TUF Composer plugin needs to be present and installed as a dependency. (This likely necessitates tagging stable releases of both the plugin and the underlying PHP-TUF library.)
  • The plugin also has to be listed in Composer's allow-plugins config. That's being done for new sites by #3522991: The project templates should allow the PHP-TUF plugin, but existing sites will need to either run a Composer command, or we'll need to write an update or install hook that modifies the project-level composer.json.
  • The packages.drupal.org repository has to be explicitly opted into TUF. That's also done in composer.json and will either need to be set for new sites right off the bat, or we'll need an update/install hook to do it.
  • Some recent root metadata for drupal.org's TUF repository has to be in PROJECT_ROOT/tuf/packages.drupal.org.json. We'll need to ship this for new and existing projects -- a scaffold file is probably the correct approach. This is most likely best done when we're nearing a stable release of Package Manager in core.
  • Core needs to mark the PHP-TUF validator in Package Manager as active (i.e., tag it as an event subscriber).

Proposed resolution

Tag the validator as an event subscriber, and add a hard dependency on php-tuf/composer-integration to Package Manager.

Remaining tasks

Postponed on:

  1. https://github.com/php-tuf/php-tuf/issues/385 which should be resolved by https://github.com/php-tuf/php-tuf/pull/387 and https://github.com/php-tuf/php-tuf/pull/386
  2. #3370270: [PP-1] Add php-tuf/composer-integration to core dependencies
  3. #3316617: Add a validator to check that PHP-TUF's Composer integration is present and configured correctly
  4. drupal.org deploying TUF support to packages.drupal.org in #3325040: [Packaging Pipeline] Securely sign packages hosted on Drupal.org using the TUF framework and Rugged
Command icon 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

phenaproxima created an issue. See original summary.

wim leers’s picture

Title: [PP-1] Require PHP-TUF's Composer integration plugin » [PP-2] Require PHP-TUF's Composer integration plugin
Priority: Normal » Critical
Issue summary: View changes
Issue tags: +alpha-target, +core-mvp
Related issues: +#3325040: [Packaging Pipeline] Securely sign packages hosted on Drupal.org using the TUF framework and Rugged, +#3316617: Add a validator to check that PHP-TUF's Composer integration is present and configured correctly

Given Drupal core release managers have indicated this is a hard requirement … updating issue metadata accordingly.

This is AFAICT hard-blocked on #3325040: [Packaging Pipeline] Securely sign packages hosted on Drupal.org using the TUF framework and Rugged too. Once #3316617: Add a validator to check that PHP-TUF's Composer integration is present and configured correctly lands, this will be down to PP-1.

wim leers’s picture

Title: [PP-2] Require PHP-TUF's Composer integration plugin » [PP-1] Require PHP-TUF's Composer integration plugin
Assigned: Unassigned » phenaproxima
phenaproxima’s picture

Not until PHP-TUF (both the library and the plugin) are published on Packagist.

wim leers’s picture

Right, but I mean an outline of a MR that shows which code would need to change. While it's still fresh in your head.

I would not expect this MR to pass obviously!

wim leers’s picture

Assigned: phenaproxima » Unassigned

Splendid! 🤩

Thanks 😊

wim leers’s picture

Issue tags: -alpha-target +alpha target
catch’s picture

Title: [PP-1] Require PHP-TUF's Composer integration plugin » Require PHP-TUF's Composer integration plugin
Status: Postponed » Needs work
Issue tags: +package manager alpha blocker

https://packagist.org/packages/php-tuf/ should mean this is unblocked?

catch’s picture

Project: Automatic Updates » Drupal core
Version: 3.0.x-dev » 11.0.x-dev
Component: Code » ajax system

Moving to core.

catch’s picture

Component: ajax system » package_manager.module
catch’s picture

I think this still might only be partially implemented in package_manager - we need to figure out exactly what's left to do here.

quietone’s picture

Version: 11.0.x-dev » 11.x-dev
larowlan’s picture

cmlara’s picture

Title: Require PHP-TUF's Composer integration plugin » [PP-1] Require PHP-TUF's Composer integration plugin
Status: Needs work » Postponed
Related issues: +#3477553: [PP-1] Manually test TUF-enabled Composer projects

Setting as postponed on upstream https://github.com/php-tuf/composer-integration/issues/127

As discovered in #3477553: [PP-1] Manually test TUF-enabled Composer projects in even basic lab deployments the plug-in causes an excessive increase in memory consumption.

catch’s picture

Issue summary: View changes

That should be resolved by https://github.com/php-tuf/php-tuf/pull/386 and https://github.com/php-tuf/php-tuf/pull/387 - manual testing of those MRs (or in general if there's a new release incorporating them) would be very welcome. Updating the issue summary to link to them.

phenaproxima’s picture

Spun off #3522991: The project templates should allow the PHP-TUF plugin as a Package Manager beta blocker to save us some pain later.

phenaproxima’s picture

Issue summary: View changes
catch’s picture

Title: [PP-1] Require PHP-TUF's Composer integration plugin » Require PHP-TUF's Composer integration plugin
Status: Postponed » Active

https://github.com/php-tuf/php-tuf/pull/395 landed.

#3477553: [PP-1] Manually test TUF-enabled Composer projects is still open, but if the dependency is in core, that is one less testing step.

larowlan’s picture

quietone’s picture

Issue summary: View changes
Status: Active » Postponed

This is postponed on 3 php-tuf issues and 1 core issue, so changing status. Update the issue to put the postponed items into the remaining tasks per the guidelines.

naheemsays’s picture

Is this still postponed on anything?

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.