Allow the provider configuration form to use any key

Created on 18 June 2025, about 1 month ago

Problem/Motivation

The provider configuration form restricts key selection to only keys that get their value from files. Keys can source their values from multiple locations such as environment variables, configuration, or in my case Pantheon secrets. So, lets remove this restriction.

I think it was done this way originally because maybe there was a misunderstanding that since the service credentials was downloaded as a file then it was assumed you had to also use the file key plugin, but that's not true, the file contents could be copied into an environment variable, or a Pantheon secret, etc...

Steps to reproduce

Proposed resolution

Remove the file filter restriction for the key selection field.

✨ Feature request
Status

Needs review

Version

1.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States lpeabody

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

Comments & Activities

  • Issue created by @lpeabody
  • πŸ‡­πŸ‡ΊHungary mxr576 Hungary

    Makes complete sense to me, Lester, could you create MR-s instead of patches, because that would speed up the merge of the proposed fixes.
    Thank you!

  • πŸ‡­πŸ‡ΊHungary mxr576 Hungary
  • πŸ‡ΊπŸ‡ΈUnited States lpeabody

    @mxr576 I do apologize for the patches, I would have done MRs but I was in a pinch for time and wanted to keep all the individual changes isolated and patches were the easiest/quickest thing to do in the moment.

  • πŸ‡ΊπŸ‡ΈUnited States en-cc-org

    I would love see this implemented because the 'configuration' method would allow us to quickly try out this module. However, I'm confused because this change reverses recent changes made on this issue: https://www.drupal.org/project/ai_provider_google_vertex/issues/3521038 πŸ“Œ File, Config or Environment Variable? Active
    Google's documentation goes in circles and isn't clear about the allowed methods.

  • πŸ‡ΊπŸ‡ΈUnited States lpeabody

    Pertinent comment from valthebald:

    https://www.drupal.org/project/ai_provider_google_vertex/issues/3521038#... πŸ“Œ File, Config or Environment Variable? Active

    He claims keys using file provider won't work due to a bug but he gives no additional details beyond that, and I can definitely say he's wrong (at least with respect to the current version of the key module) because I've been using the key just fine with file, configuration, environment variable, and pantheon secrets provider plugins.

    The content of the service account key file (JSON file with service account details including private key) is expected by this module's provider plugin. The file key provider works fine, as does the environment variable, configuration, and pantheon secrets provider (encoding the JSON has to be base64 for pantheon key provider).

  • πŸ‡ΊπŸ‡ΈUnited States lpeabody
Production build 0.71.5 2024