Fix #18005: Mask Greenplum Password (#18047)

This commit is contained in:
Mayur Singal 2024-10-04 16:57:15 +05:30 committed by GitHub
parent d9b15ef6cb
commit 52ea9ea81e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,6 +16,8 @@ package org.openmetadata.service.secrets.converter;
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;
/**
@ -24,6 +26,8 @@ import org.openmetadata.service.util.JsonUtils;
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);
@ -34,6 +38,9 @@ public class GreenplumConnectionClassConverter extends ClassConverter {
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);