Integration with Key module

Created on 29 August 2025, 5 days ago

Problem/Motivation

Currently, the Acquia SEO Content Insights module stores API key and shared secret within the configuration, which poses security risks. The Drupal Key module provides a mechanism to manage secrets securely by storing keys outside of Drupal config (e.g., in environment variables or external files) and providing them when needed.

Proposed resolution

This module should enhance security in this module by integrating with the Drupal Key module. This integration will ensure sensitive API key and shared secret are not stored directly in the module's configuration but are instead securely retrieved via the Key module on demand.

💬 Support request
Status

Active

Version

2.0

Component

Code

Created by

🇮🇳India rajeshreeputra Pune

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

Comments & Activities

  • Issue created by @rajeshreeputra
  • @rajeshreeputra opened merge request.
  • 🇮🇳India rajeshreeputra Pune

    Created MR with following:

    • Add key module in dev dependency
    • Update configuration form allowing to use the Key module to get api key and shared secret.
    • Manually created a simple authentication key using file key provider and used in config form for key based authentication.
    • Added new getCredentials() to retrieve API key and shared secret from keyValue or config as per key module used.
    • Verified connection is successful with key module as well as with config.

    How to use key module with Acquia SEO Content Insights:

    1. Require and install key module.
    2. Create new key with file key provider or any other, I am using the file key provider to create the Conductor credentials key.
    3. Add required details to file, i.e. api_key and shared_secret as json.
    4. Visit /admin/config/development/conductor:
      • You will see a new checkbox option(Use Key module for API credentials storage) under the API Credentials.
      • Check the checkbox option.
      • The API Key dropdown field will appear, allowing you to select the key from the list.
      • Choose the Conductor credentials key.
      • Click on Save configurations.

    5. You will receive a success or error message based on the data in the file path provided in the key.

    Remaining work:

    • Update Acquia SEO Content Insights extention to support key module integration.
    • Verified the functionality.
    • Add test coverage for key module integration.
Production build 0.71.5 2024