Add environment key provider to 7.x

Created on 25 June 2019, almost 6 years ago
Updated 11 May 2025, 4 days ago

The "Better" option of storing keys in environmental variables (as described on the Key project home page) is currently available only in the 8.x branch. I'm working on a D7 project for which having the option to store key values in environment variables was useful, so I figured out how to create the plugin, based on the file key provider as an example. It works for me, so I'm offering it back as a feature enhancement, even if it never gets officially incorporated due to D7 being so close to EoL. At least the patch will be available for those who wish to make use of it.

(see comment #3)

One difference from the 8.x version is that I have enforced a "key_" prefix for any environment variable used with this plugin. This is a security feature to prevent someone from exposing any other environment variables via the Key module.

Finally, I haven't tested the encryption key part of the key provider plugins, since I don't have a use case, and I'm not entirely clear how that all is supposed to work. I welcome any testing and advice specifically on those components. (What I've done mimics how the file provider plugin handles things, so I'm pretty sure it should work if the file plugin works.)

✨ Feature request
Status

Closed: outdated

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States daletrexel Minnesota, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡―πŸ‡΅Japan ptmkenny

    Drupal 7 and 7.x modules are EOL and no longer supported.

    Key for Drupal 8+ has this feature, so I'm closing this issue.

Production build 0.71.5 2024