Correctly configure tenant config length. (#680)
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -15,6 +15,16 @@ package org.eclipse.hawkbit.repository.model;
|
||||
*/
|
||||
public interface TenantConfiguration extends TenantAwareBaseEntity {
|
||||
|
||||
/**
|
||||
* Maximum length of tenant configuration key.
|
||||
*/
|
||||
int KEY_MAX_SIZE = 128;
|
||||
|
||||
/**
|
||||
* Maximum length of tenant configuration value.
|
||||
*/
|
||||
int VALUE_MAX_SIZE = 512;
|
||||
|
||||
/**
|
||||
* @return key of the entry
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,6 @@ import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@@ -32,14 +31,14 @@ import org.eclipse.hawkbit.repository.model.TenantConfiguration;
|
||||
public class JpaTenantConfiguration extends AbstractJpaTenantAwareBaseEntity implements TenantConfiguration {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "conf_key", length = 128, nullable = false, updatable = false)
|
||||
@Size(max = 128)
|
||||
@NotEmpty
|
||||
@Column(name = "conf_key", length = TenantConfiguration.KEY_MAX_SIZE, nullable = false, updatable = false)
|
||||
@Size(min = 1, max = TenantConfiguration.KEY_MAX_SIZE)
|
||||
@NotNull
|
||||
private String key;
|
||||
|
||||
@Column(name = "conf_value", length = 512, nullable = false)
|
||||
@Column(name = "conf_value", length = TenantConfiguration.VALUE_MAX_SIZE, nullable = false)
|
||||
@Basic
|
||||
@Size(max = 512)
|
||||
@Size(max = TenantConfiguration.VALUE_MAX_SIZE)
|
||||
@NotNull
|
||||
private String value;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
package org.eclipse.hawkbit.ui.tenantconfiguration.authentication;
|
||||
|
||||
import org.eclipse.hawkbit.repository.TenantConfigurationManagement;
|
||||
import org.eclipse.hawkbit.repository.model.TenantConfiguration;
|
||||
import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationProperties.TenantConfigurationKey;
|
||||
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
|
||||
import org.eclipse.hawkbit.ui.common.builder.TextFieldBuilder;
|
||||
@@ -53,7 +54,7 @@ public class CertificateAuthenticationConfigurationItem extends AbstractBooleanT
|
||||
"The SSL Issuer iRules.X509 hash, to validate against the controller request certifcate.");
|
||||
caRootAuthorityLabel.setWidthUndefined();
|
||||
|
||||
caRootAuthorityTextField = new TextFieldBuilder(160).buildTextComponent();
|
||||
caRootAuthorityTextField = new TextFieldBuilder(TenantConfiguration.VALUE_MAX_SIZE).buildTextComponent();
|
||||
caRootAuthorityTextField.setWidth("100%");
|
||||
caRootAuthorityTextField.addTextChangeListener(event -> caRootAuthorityChanged());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user