Problem/Motivation

Similar to #3477520: Add support for PHP attributes for EncryptionMethod plugins, the Key module should support adding PHP attributes for KeyProvider plugins, since this is the way forward for core.

This MR provides attributes for KeyInput, KeyProvider, and KeyType, the three annotations provided by the Key module. It also adds an attribute next to the annotation in each plugin.

The only intentional change is that I did not implement "storage" for KeyProvider, since this is deprecated and none of the built-in plugins use it.

Issue fork key-3483550

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

ptmkenny created an issue. See original summary.

ptmkenny’s picture

Title: Support PHP attributes for KeyProvider plugins » Support PHP attributes in addition to annotations
Issue summary: View changes
ptmkenny’s picture

Status: Active » Needs review
ptmkenny’s picture

Issue summary: View changes

ptmkenny’s picture

The current MR ONLY adds attribute support without actually adding the attribute to the plugins. The reason is because attributes will break on PHP < 8.1 and don't work with Drupal < 10.2. Since this module supports older versions of Drupal, addition of attributes to plugins should be postponed, but the Attribute itself can be committed now so that downstream modules (with stricter version requirements) can start using it.

rlhawk made their first commit to this issue’s fork.

rajeshreeputra made their first commit to this issue’s fork.

ptmkenny’s picture

As per #8, I think this is ready to go, but if it gets committed, we should create a follow-up issue to actually use the attributes within Key and then drop the annotations when Key requires at least Drupal 10.2.

ptmkenny’s picture

Title: Support PHP attributes in addition to annotations » Add initial support for PHP attributes (allow attributes to be used by other modules, but do not convert yet)
rajeshreeputra’s picture

ptmkenny’s picture

Title: Add initial support for PHP attributes (allow attributes to be used by other modules, but do not convert yet) » Add support for PHP attributes and require Drupal 10.2
Version: 8.x-1.x-dev » 2.0.x-dev
Status: Needs review » Needs work

Now that there is a 2.x branch of Key, we should do the full conversion and require Drupal 10.2.

ptmkenny’s picture

Status: Needs work » Needs review

Ok, this is now working again.

The MR adds support for PHP attributes (adds attribute classes for Key's three annotations) and converts Key's built-in plugins to use the new attributes instead of annotations.

This requires Drupal 10.2 at a minimum.

I have moved this to the 2.x branch but it could be part of 1.x if 1.x gets bumped to 10.2+.

jatingupta40 made their first commit to this issue’s fork.

john franklin’s picture

It's been seven months since the last update to the MR. Any ETA on when this will get reviewed and merged?

japerry’s picture

Status: Needs review » Needs work

Marking NW due to the refactor in 2.x. I don't think attributes will get added to 1.x unless we need it for migration purposes. Also, note that attributes is a new feature, so as long as annotations aren't removed, the minimum version of Drupal doesn't need to be changed.