Problem/Motivation

The current form requires the user to paste the key into the form and then click "info" to submit the form, trigger a form error, and show the key info as a message.

Steps to reproduce

  • Go to admin/config/system/keys/add
  • Select Key Type "Public key/certificate"
  • Add a PEM-encoded key in the "Key value" field
  • Click "info" to get the key data.

Proposed resolution

Add some #ajax code to automatically pull the key/certificate information "on blur" of the Key value field, if possible. (The way the form is created may make this difficult.)

User interface changes

  • Remove the info button
  • Add an element that shows the key/certificate info
  • Update the key/certificate info when focus is removed from the Key value field
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

john franklin created an issue. See original summary.

dimitriskr’s picture

Issue summary: View changes
dimitriskr’s picture

@john franklin, what about a modal? Do you think that's better?

roderik’s picture

It would be nice to have e.g. a modal instead of the current ugly hack.

But remember that this currently can validate info from a potential key, _before_ it is actually saved as a key entity. You can get they key value from any key provider (for instance: the "environment" provider, enter a variable name) and check if it actually holds the info you need.

In order to do that, you'd need to copy code from KeyFormBase::validateFom().

I'm not sure if this is suitable for a GET (ajax) request. It might be, though.