Problem/Motivation

If the module is installed but not enabled (for example via config import), trying to enable it via UI won't work because of a missing API key. At this point it is only possible to generate the API key by:

  • Uninstalling and installing the site Guardian module via UI.
  • Generate the API key somehow and configure it for the module.

Notice that if you install the module via UI, the API key is generated as expected.

Steps to reproduce

  • Install the Site Guardian module via configuration. Notice that, because the configurations of the module should be ignored (there's still some conversations ongoing about this) the module will only be installed but not enabled.
  • As a post deployment task try to enable Site Guardian via UI, this step will fail due to a missing key.

Proposed resolution

Add a 'Generate API Key' button to the Site Guardian configuration page, so that a new random key can be generated at discretion for whatever reason, with no need to uninstall or disable Site Guardian.

CommentFileSizeAuthor
#7 generate-site-guardian-key.PNG58.19 KBeworwa
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

seeduardo created an issue. See original summary.

seeduardo’s picture

Assigned: seeduardo » Unassigned
Status: Active » Needs review

Ready for review, thanks anyone and everyone.

the_g_bomb’s picture

Tested applying the patch. Applies cleanly.

Before patch Site Guardian loads and generates the API as expected.

After the Patch a button appears that allows the API key to be re-generated.

Very nice!

alina.basarabeanu’s picture

The patch works as expected on the Drupal version 10.2.5 and Site Guardian 1.0.4.

alina.basarabeanu’s picture

Status: Needs review » Reviewed & tested by the community
eworwa’s picture

StatusFileSize
new58.19 KB

I can confirm the patch applies with no issues, my current configuration:

  • Drupal core: 10.2.5
  • Site guardian: 1.0.4



After applying the patch there's a new button to re-generate the API key (nice improvement).

Site Guardian generate new key

ricardofaria’s picture

Tested on site guardian 1.0.4 and drupal 10.2.2.
All working as expected.

arcaic’s picture

Applies to Site Guardian 1.0.5 on Drupal 10.2.5 and seems to work fine.

  • seeduardo committed bfd773fd on 1.0.x
    Issue #3447835 by seeduardo, eworwa, Alina Basarabeanu, ricardofaria,...

seeduardo credited dunx.

seeduardo’s picture

Status: Reviewed & tested by the community » Fixed

Ok appears the solution is robust enough, thanks so much for all testing and comments and others who helped with this - merging and closing now.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.