mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-03 12:08:31 +00:00
MINOR: Fix Hive Metastore Password Encryption (#15329)
This commit is contained in:
parent
e8c0b017ba
commit
f00c679f51
@ -47,6 +47,7 @@ public final class ClassConverterFactory {
|
||||
Map.entry(BigTableConnection.class, new BigTableConnectionClassConverter()),
|
||||
Map.entry(DatalakeConnection.class, new DatalakeConnectionClassConverter()),
|
||||
Map.entry(MysqlConnection.class, new MysqlConnectionClassConverter()),
|
||||
Map.entry(HiveConnection.class, new HiveConnectionClassConverter()),
|
||||
Map.entry(TrinoConnection.class, new TrinoConnectionClassConverter()),
|
||||
Map.entry(PostgresConnection.class, new PostgresConnectionClassConverter()),
|
||||
Map.entry(DbtGCSConfig.class, new DbtGCSConfigClassConverter()),
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright 2021 Collate
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.openmetadata.service.secrets.converter;
|
||||
|
||||
import java.util.List;
|
||||
import org.openmetadata.schema.services.connections.database.HiveConnection;
|
||||
import org.openmetadata.schema.services.connections.database.MysqlConnection;
|
||||
import org.openmetadata.schema.services.connections.database.PostgresConnection;
|
||||
import org.openmetadata.service.util.JsonUtils;
|
||||
|
||||
/** Converter class to get an `DatalakeConnection` object. */
|
||||
public class HiveConnectionClassConverter extends ClassConverter {
|
||||
|
||||
private static final List<Class<?>> CONFIG_SOURCE_CLASSES =
|
||||
List.of(MysqlConnection.class, PostgresConnection.class);
|
||||
|
||||
public HiveConnectionClassConverter() {
|
||||
super(HiveConnection.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object convert(Object object) {
|
||||
HiveConnection hiveConnection = (HiveConnection) JsonUtils.convertValue(object, this.clazz);
|
||||
|
||||
tryToConvert(hiveConnection.getMetastoreConnection(), CONFIG_SOURCE_CLASSES)
|
||||
.ifPresent(hiveConnection::setMetastoreConnection);
|
||||
|
||||
return hiveConnection;
|
||||
}
|
||||
}
|
||||
@ -58,6 +58,6 @@ public class ClassConverterFactoryTest {
|
||||
|
||||
@Test
|
||||
void testClassConvertedMapIsNotModified() {
|
||||
assertEquals(19, ClassConverterFactory.getConverterMap().size());
|
||||
assertEquals(20, ClassConverterFactory.getConverterMap().size());
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user