From 4c7b9fca9526087ed56cc3588edf4e9585c20e32 Mon Sep 17 00:00:00 2001 From: Ainur <59531286+yagudin10@users.noreply.github.com> Date: Wed, 1 Nov 2023 14:50:39 +0100 Subject: [PATCH] CB-4127 ssl show certificates (#2097) Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com> --- .../cloudbeaver/model/WebNetworkHandlerConfig.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/WebNetworkHandlerConfig.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/WebNetworkHandlerConfig.java index 66447daefd..4264e35159 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/WebNetworkHandlerConfig.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/WebNetworkHandlerConfig.java @@ -18,8 +18,14 @@ import org.jkiss.code.NotNull; import org.jkiss.dbeaver.model.net.DBWHandlerConfiguration; +import org.jkiss.dbeaver.model.net.DBWHandlerDescriptor; import org.jkiss.dbeaver.model.net.DBWHandlerType; import org.jkiss.dbeaver.model.net.ssh.SSHConstants; +import org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor; +import org.jkiss.dbeaver.model.preferences.DBPPropertySource; +import org.jkiss.dbeaver.model.runtime.VoidProgressMonitor; +import org.jkiss.dbeaver.registry.RegistryConstants; +import org.jkiss.dbeaver.runtime.properties.PropertySourceMap; import org.jkiss.utils.CommonUtils; import java.util.LinkedHashMap; @@ -83,8 +89,11 @@ public Map getProperties() { @NotNull public Map getSecureProperties() { Map secureProperties = new LinkedHashMap<>(configuration.getSecureProperties()); - for (Map.Entry property : secureProperties.entrySet()) { - property.setValue(CommonUtils.isEmpty(property.getValue()) ? null : WebConnectionInfo.SECURED_VALUE); + DBPPropertyDescriptor[] descriptor = configuration.getHandlerDescriptor().getHandlerProperties(); + for (DBPPropertyDescriptor p : descriptor) { + if (p.hasFeature(RegistryConstants.ATTR_PASSWORD)) { + secureProperties.computeIfPresent(p.getId(), (k, v) -> CommonUtils.isEmpty(v) ? null : WebConnectionInfo.SECURED_VALUE); + } } return secureProperties; }