Skip to content

Commit

Permalink
Fix #18005: Mask Greenplum Password (#18047)
Browse files Browse the repository at this point in the history
  • Loading branch information
ulixius9 authored Oct 4, 2024
1 parent d9b15ef commit 52ea9ea
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import java.util.List;
import org.openmetadata.schema.security.ssl.ValidateSSLClientConfig;
import org.openmetadata.schema.services.connections.database.GreenplumConnection;
import org.openmetadata.schema.services.connections.database.common.IamAuthConfig;
import org.openmetadata.schema.services.connections.database.common.basicAuth;
import org.openmetadata.service.util.JsonUtils;

/**
Expand All @@ -24,6 +26,8 @@
public class GreenplumConnectionClassConverter extends ClassConverter {

private static final List<Class<?>> SSL_SOURCE_CLASS = List.of(ValidateSSLClientConfig.class);
private static final List<Class<?>> CONFIG_SOURCE_CLASSES =
List.of(basicAuth.class, IamAuthConfig.class);

public GreenplumConnectionClassConverter() {
super(GreenplumConnection.class);
Expand All @@ -34,6 +38,9 @@ public Object convert(Object object) {
GreenplumConnection greenplumConnection =
(GreenplumConnection) JsonUtils.convertValue(object, this.clazz);

tryToConvert(greenplumConnection.getAuthType(), CONFIG_SOURCE_CLASSES)
.ifPresent(greenplumConnection::setAuthType);

tryToConvert(greenplumConnection.getSslConfig(), SSL_SOURCE_CLASS)
.ifPresent(greenplumConnection::setSslConfig);

Expand Down

0 comments on commit 52ea9ea

Please sign in to comment.