Drupal's Lenient Composer endpoint

Today, I tried to add the Content Access module to a Drupal 11 project, but there's no Drupal 11-compatible version.

It's a simple update - just adding ^11 to the content_access.info.yml file, but even with Composer Patches installed, it's not possible to download and patch the module using the normal Drupal 8+ Composer repository.

This is possible, though, with the Lenient Composer endpoint.

This composer plugin lets you specify an allowlist of packages where you are willing to break the version constraint.

Together with the Composer Patches Plugin, this allows you to install any Drupal extension, even if the version constraint hasn't been officially updated yet. Of course the code may still need to be patched for deprecations.

To add the lenient endpoint and add the Content Access plugin:

composer require mglaman/composer-drupal-lenient
composer config --merge --json extra.drupal-lenient.allowed-list '["drupal/content_access"]
composer req drupal/content_access

Note that I'd already included this section to my composer.json file to add a patch to make the module installable on Drupal 11:

"extra": {
"composer-patches": {
"drupal/content_access": {
"Drupal 11 support": "./tools/patches/content_access/d11_support.patch"
}
},
},