Skip to content

Commit 9e4805c

Browse files
pmbrullTeddyCr
authored andcommitted
FIX - Redshift converter (#26229)
(cherry picked from commit ce8e1e5)
1 parent 948bfe4 commit 9e4805c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

openmetadata-service/src/main/java/org/openmetadata/service/secrets/converter/RedshiftConnectionClassConverter.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@
1616
import java.util.List;
1717
import org.openmetadata.schema.security.ssl.ValidateSSLClientConfig;
1818
import org.openmetadata.schema.services.connections.database.RedshiftConnection;
19+
import org.openmetadata.schema.services.connections.database.common.IamAuthConfig;
20+
import org.openmetadata.schema.services.connections.database.common.basicAuth;
1921
import org.openmetadata.schema.utils.JsonUtils;
2022

21-
/**
22-
* Converter class to get an `DatalakeConnection` object.
23-
*/
2423
public class RedshiftConnectionClassConverter extends ClassConverter {
2524

2625
private static final List<Class<?>> SSL_SOURCE_CLASS = List.of(ValidateSSLClientConfig.class);
2726

27+
private static final List<Class<?>> AUTH_SOURCE_CLASSES =
28+
List.of(basicAuth.class, IamAuthConfig.class);
29+
2830
public RedshiftConnectionClassConverter() {
2931
super(RedshiftConnection.class);
3032
}
@@ -33,6 +35,10 @@ public RedshiftConnectionClassConverter() {
3335
public Object convert(Object object) {
3436
RedshiftConnection redshiftConnection =
3537
(RedshiftConnection) JsonUtils.convertValue(object, this.clazz);
38+
39+
tryToConvert(redshiftConnection.getAuthType(), AUTH_SOURCE_CLASSES)
40+
.ifPresent(redshiftConnection::setAuthType);
41+
3642
tryToConvert(redshiftConnection.getSslConfig(), SSL_SOURCE_CLASS)
3743
.ifPresent(redshiftConnection::setSslConfig);
3844

0 commit comments

Comments
 (0)