Change record status: 
Project: 
Introduced in branch: 
3.0.x
Introduced in version: 
3.0.0-alpha2
Description: 

matrix_api ^3 requires drupal/key ^1.0 as a hard dependency. The access token is no longer stored as a plain string in Drupal config; it is stored in a Key module entity and referenced by machine name via the new matrix_api.key_id config field.

The matrix_api.token and matrix_api.password config fields are removed.

Upgrading from ^2:

  1. 1. Run composer require drupal/matrix_api:^3 — this will also pull in drupal/key as a new dependency.
  2. 2. Run drush updb` to run `matrix_api_update_3001(), which:
    • Installs the Key module if not already present
    • Migrates any existing token from config to a new Key entity named matrix_api_access_token. By default, this is a key stored in configuration, but you can change to your preferred storage as desired.
    • Clears matrix_api.token and matrix_api.password from config
  3. If no token was found during migration (e.g. the site only had a password stored, not a token), a warning is logged. Re-enter credentials at /admin/config/services/matrix-api.

The `matrix_api.matrixhttp` service is removed. It was an internal Guzzle
client factory exposed as a service. No contrib or custom code should have been
depending on it, but update any code that does.

Custom code referencing matrix_api.token or matrix_api.password:

Replace reads of:

\Drupal::config('matrix_api.MatrixApiSettings')->get('matrix_api.token')

with:

$keyId = \Drupal::config('matrix_api.MatrixApiSettings')->get('matrix_api.key_id');
$token = $keyId
  ? \Drupal::service('key.repository')->getKey($keyId)?->getKeyValue()
  : NULL;
Impacts: 
Site builders, administrators, editors
Module developers
Site templates, recipes and distribution developers