How to add API keys as Environment variables

Created on 30 March 2023, over 1 year ago
Updated 4 September 2023, about 1 year ago

Problem/Motivation

When I try to add Twitter API keys using the "Envinronment" provider, I get the error:
The key value is missing the field client_id.

Steps to reproduce

  1. First add Twitter API Consumer Keys as environment variables, as stated in your README @ line 24:
  2. ddev config --web-environment-add="client_id=[my_twitter_api_client_id]"
  3. ddev config --web-environment-add="client_secret=[my_twitter_api_client_secret]"
  4. Then if you try to submit the /admin/config/system/keys/add form with
  5. Key type = Twitter API app
  6. Key provider = Environment
  7. Environment variable = you only have 1 line!?

Proposed resolution

  1. Key's module page suggest Environment as the safest provider, so how should we set working environment variables?
  2. If I select "Configuration" as provider (not suggested in production), I can see there are 5 keys needed, so should I add all of them as environment variables instead?
  3. How can I check Drupal knows about the environment variables I set, while still keeping them safe?
💬 Support request
Status

Active

Version

4.0

Component

Miscellaneous

Created by

🇮🇹Italy kopeboy Milan

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

Comments & Activities

Production build 0.71.5 2024