- Issue created by @marcus_johansson
I am developing the AI module and we are heavily using your great module to store api keys and other secrets. Our module is going into Drupal CMS as an optional recipe you can apply after installation. Meaning that your module will be there as well.
There is now a way of using input variables ✨ Make it possible for recipes to prompt for input values Fixed in D11. This works well in terminal and will soon be available when applying a recipe in the GUI as well.
On top of that there are custom action plugins for recipes, meaning that the Key module could add a custom action plugin for recipes that will take care of:
Create a custom plugin action that can take a value an connect it to a config on a specific config key.
One example for setting up the OpenAI API Key during installation or application of recipes would for instance be (in this example the plugin is called setKeyEntityIfValueExists:
input:
api_key:
data_type: string
description: The OpenAI API Key if you want to use OpenAI.
prompt:
method: ask
arguments:
question: 'Please provide your OpenAI API Key:'
default:
source: value
value: ''
config:
actions:
ai_provider_openai.settings: # The configuration file you want to add it to
setKeyEntityIfValueExists: # The new action
key_config_key: api_key # The config key that should take the keys entity id on the configuration (in this case ai_provider_openai.settings).
value: ${api_key} # The value to check if its set.
id: openai_key # The key entity id.
label: 'OpenAI Key' #Other configurations for the key entity.
key_type: authentication
key_provider: config
key_provider_settings:
key_value: ${api_key}
key_input: text_field
Active
1.0
Code