Bundle dependent Key config entities
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3560088. --> Reported by: [mxr576](https://www.drupal.org/user/315522) Related to !26 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p> As a temporary solution until this module stores credentials in configuration, the goal is to document <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-1"><a href="https://www.drupal.org/project/ai_provider_amazeeio/issues/3559849" title="Status: Active">#3559849: Document secure credential configuration for amazee.ai AI Provider</a></span> how to set up a secure credential storage approach for production environments using configuration overrides in <code>settings.php</code> as described in <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/ai_provider_amazeeio/issues/3559845" title="Status: Closed (fixed)">#3559845: Ignore environment-specific credentials in configuration for amazee.ai AI Provider</a></span>. </p> <p> In such environments, the (trial) setup process at <code>/admin/config/ai/providers/amazeeio</code> is not expected to be executed, because the credentials already exist and the Amazee AI subscription and private key registration have been completed elsewhere. </p> <p> However, without executing the setup process, the <code>amazeeio_ai</code> and <code>amazeeio_ai_database</code> Key configuration entities are never created, which means their key values cannot be provided via configuration overrides. </p> <p> Independently from this problem, the module's <code>ai_provider_amazeeio.settings</code> configuration entity already depends on these Key entities through the <code>api_key</code> and <code>postgres_password</code> properties, so semantically these Key entities should be created by the module when it is installed. </p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <ul> <li> Ensure that the module creates the <code>amazeeio_ai</code> and <code>amazeeio_ai_database</code> Key configuration entities during installation so they are always present, regardless of whether the web-based setup form is used. </li> <li> Treat these Key entities as installation-time configuration objects that are provisioned alongside the <code>ai_provider_amazeeio.settings</code> configuration entity. </li> <li> Confirm that once these Key entities exist, site builders can safely override their values in <code>settings.php</code> for production credential management without having to run the trial setup process in each environment. </li> </ul> <h4 id="summary-remaining-tasks">Remaining tasks</h4> <h3 id="summary-user-stories">User stories</h3> <ul> <li> As a site builder, I want the Amazee AI provider&rsquo;s Key configuration entities to be created automatically on installation so that I can manage their values via configuration overrides in <code>settings.php</code> without running the trial setup UI in each environment. </li> <li> As a DevOps engineer, I want to ensure production credentials are injected via environment-specific configuration overrides while relying on the module to provision the required Key entities, so that secrets never need to be entered through the web UI. </li> </ul> <h3 id="summary-api-changes">API changes</h3> <ul> <li>No API changes are expected; the change is limited to installation and configuration behavior for Key config entities used by the module.</li> </ul> <h3 id="summary-data-model-changes">Data model changes</h3> <ul> <li> The <code>ai_provider_amazeeio.settings</code> configuration entity already has dependencies on the Key entities via the <code>api_key</code> and <code>postgres_password</code> properties, so this issue formalizes the expectation that these Key entities are present from installation onward. </li> </ul> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <ol> <li>Install the <code>ai_provider_amazeeio</code> module on a new environment without running the setup form at <code>/admin/config/ai/providers/amazeeio</code>.</li> <li>Attempt to configure the <code>amazeeio_ai</code> and <code>amazeeio_ai_database</code> keys via configuration overrides in <code>settings.php</code>.</li> <li>Observe that the Key configuration entities do not exist, so there is nothing to override for the API key and database password values.</li> </ol> > Related issue: [Issue #3559845](https://www.drupal.org/node/3559845) > Related issue: [Issue #3559849](https://www.drupal.org/node/3559849)
issue