MINOR: Mask Wherescape MSSQL Password (#23076)

(cherry picked from commit a382533f252c6c7f6280ea0cc8d3bda5ea56b7ad)
This commit is contained in:
Mayur Singal 2025-08-28 18:25:43 +05:30 committed by OpenMetadata Release Bot
parent 7cfff762c4
commit ff65f7f8b8
2 changed files with 29 additions and 0 deletions

View File

@ -48,6 +48,7 @@ import org.openmetadata.schema.services.connections.pipeline.AirflowConnection;
import org.openmetadata.schema.services.connections.pipeline.MatillionConnection;
import org.openmetadata.schema.services.connections.pipeline.NifiConnection;
import org.openmetadata.schema.services.connections.pipeline.SSISConnection;
import org.openmetadata.schema.services.connections.pipeline.WherescapeConnection;
import org.openmetadata.schema.services.connections.search.ElasticSearchConnection;
import org.openmetadata.schema.services.connections.security.RangerConnection;
import org.openmetadata.schema.services.connections.storage.GCSConnection;
@ -98,6 +99,7 @@ public final class ClassConverterFactory {
Map.entry(NifiConnection.class, new NifiConnectionClassConverter()),
Map.entry(MatillionConnection.class, new MatillionConnectionClassConverter()),
Map.entry(VertexAIConnection.class, new VertexAIConnectionClassConverter()),
Map.entry(WherescapeConnection.class, new WherescapeConnectionClassConverter()),
Map.entry(RangerConnection.class, new RangerConnectionClassConverter()));
Map.entry(Workflow.class, new WorkflowClassConverter());
Map.entry(CassandraConnection.class, new CassandraConnectionClassConverter());

View File

@ -0,0 +1,27 @@
package org.openmetadata.service.secrets.converter;
import java.util.List;
import org.openmetadata.schema.services.connections.database.MssqlConnection;
import org.openmetadata.schema.services.connections.pipeline.WherescapeConnection;
import org.openmetadata.schema.utils.JsonUtils;
/** Converter class to get an `SupersetConnection` object. */
public class WherescapeConnectionClassConverter extends ClassConverter {
private static final List<Class<?>> CONNECTION_CLASSES = List.of(MssqlConnection.class);
public WherescapeConnectionClassConverter() {
super(WherescapeConnection.class);
}
@Override
public Object convert(Object object) {
WherescapeConnection wherescapeConnection =
(WherescapeConnection) JsonUtils.convertValue(object, this.clazz);
tryToConvertOrFail(wherescapeConnection.getDatabaseConnection(), CONNECTION_CLASSES)
.ifPresent(wherescapeConnection::setDatabaseConnection);
return wherescapeConnection;
}
}