diff --git a/key.install b/key.install index dc96fc3..14d6977 100644 --- a/key.install +++ b/key.install @@ -33,3 +33,18 @@ function key_update_1000() { db_drop_table('key_config'); } } + +/** + * Use textarea for authentication keys stored in config. + */ +function key_update_1002() { + $config_names = config_get_names_with_prefix('key.key.'); + foreach ($config_names as $name) { + $config = config($name); + if ($config->get('key_type') == 'authentication' && $config->get('key_provider') == 'config' && $config->get('key_input') == 'text_field') { + $config->set('key_input', 'textarea_field'); + $config->save(); + } + } + +} diff --git a/plugins/key_provider/config.inc b/plugins/key_provider/config.inc index 489e7ba..a16ee52 100644 --- a/plugins/key_provider/config.inc +++ b/plugins/key_provider/config.inc @@ -7,7 +7,7 @@ $plugin = array( 'label' => t('Configuration'), - 'description' => t('The Configuration key provider stores the key in configuration in the database.'), + 'description' => t('The Configuration key provider stores the key in configuration, which is likely web-accessible (and should not be).'), 'storage method' => 'config', 'key value' => array( 'accepted' => TRUE, diff --git a/plugins/key_type/authentication.inc b/plugins/key_type/authentication.inc index d7aa906..7b51dbe 100644 --- a/plugins/key_type/authentication.inc +++ b/plugins/key_type/authentication.inc @@ -10,6 +10,6 @@ $plugin = array( 'description' => t('Use for a password or API key. (A generic key type that does not belong to any other defined key type.)'), 'group' => 'authentication', 'key value' => array( - 'plugin' => 'text_field', + 'plugin' => 'textarea_field', ), ); diff --git a/tests/key.test b/tests/key.test index 15c2cfa..6c5db99 100644 --- a/tests/key.test +++ b/tests/key.test @@ -50,7 +50,7 @@ class KeyBasicAdminTest extends BackdropWebTestCase { 'key_type_settings' => array(), 'key_provider' => 'config', 'key_provider_settings' => array('key_value' => $original_key_value), - 'key_input' => 'text_field', + 'key_input' => 'textarea_field', 'key_input_settings' => array(), );