Key value maxlength

Created on 13 May 2022, almost 3 years ago
Updated 21 January 2023, about 2 years ago

Problem/Motivation

I am using Lockr along with the key module and I'm trying to store an ssl certificate, however the 'Key value' field is limited to 4092 characters (see https://www.drupal.org/project/key/issues/3116038 ). I was messing around with the key_asymmetric module for this, which changes the 'Key value' field to a textarea, however the maxlength still exists because of the code in /src/Plugin/KeyInput/TextFieldKeyInput.php:

$form['key_value'] = [
  '#type' => 'textfield',
  '#title' => $this->t('Key value'),
  '#required' => $key->getKeyProvider()->getPluginDefinition()['key_value']['required'],
  '#maxlength' => 4096,
  '#default_value' => $key_value_data['current'],
  // Tell the browser not to autocomplete this field.
  '#attributes' => ['autocomplete' => 'off'],
];

The certificate I'm using has about 5500 characters. I was wondering if there was a reason for this limit? Lockr doesn't have a maxlength limit on the values it stores, so I was wondering why this limit exists. Just curious, does there even need to be a limit at all here?

Thanks!

Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024