dbeaver/pro#5562 revert hide password if not applicable (#4225)

This commit is contained in:
Dmitrii Barnukov
2026-03-19 10:31:47 +01:00
committed by GitHub
parent db9f145609
commit 10ad601f8b
@@ -20,10 +20,7 @@ import io.cloudbeaver.DBWebException;
import io.cloudbeaver.WebServiceUtils;
import io.cloudbeaver.model.session.WebSession;
import io.cloudbeaver.utils.WebCommonUtils;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.model.DBConstants;
import org.jkiss.dbeaver.model.connection.DBPAuthModelDescriptor;
import org.jkiss.dbeaver.model.impl.auth.AuthModelDatabaseNative;
import org.jkiss.dbeaver.model.meta.Property;
import org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor;
import org.jkiss.dbeaver.model.preferences.DBPPropertySource;
@@ -77,6 +74,7 @@ public class WebDatabaseAuthModel {
@Property
public WebPropertyInfo[] getProperties() throws DBWebException {
DBPPropertySource credentialsSource = model.createCredentialsSource(null, null);
Predicate<DBPPropertyDescriptor> predicate = CommonUtils.isEmpty(getRequiredAuth())
? p -> true
@@ -84,18 +82,9 @@ public class WebDatabaseAuthModel {
return Arrays.stream(credentialsSource.getProperties())
.filter(predicate)
.filter(p -> !isPassword(p) || isPasswordApplicable())
.filter(p -> !p.isDesktop())
.map(p -> new WebPropertyInfo(webSession, p, credentialsSource))
.toArray(WebPropertyInfo[]::new);
.map(p -> new WebPropertyInfo(webSession, p, credentialsSource)).toArray(WebPropertyInfo[]::new);
}
private boolean isPassword(@NotNull DBPPropertyDescriptor property) {
return property.hasFeature(DBConstants.PROP_FEATURE_PASSWORD);
}
private boolean isPasswordApplicable() {
return model.getInstance() instanceof AuthModelDatabaseNative<?> nativeModel &&
nativeModel.isUserPasswordApplicable();
}
}