Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #18005: Mask Greenplum Password #18047

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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::setSslConfig);

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

Expand Down
Loading