Skip to content

Commit

Permalink
CB-4127 ssl show certificates (#2097)
Browse files Browse the repository at this point in the history
Co-authored-by: Daria Marutkina <[email protected]>
  • Loading branch information
yagudin10 and dariamarutkina authored Nov 1, 2023
1 parent f98b9aa commit 4c7b9fc
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -83,8 +89,11 @@ public Map<String, Object> getProperties() {
@NotNull
public Map<String, String> getSecureProperties() {
Map<String, String> secureProperties = new LinkedHashMap<>(configuration.getSecureProperties());
for (Map.Entry<String, String> 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;
}
Expand Down

0 comments on commit 4c7b9fc

Please sign in to comment.