caican00 commented on code in PR #4075:
URL: https://github.com/apache/gravitino/pull/4075#discussion_r1670144929
##########
catalogs/catalog-lakehouse-paimon/src/main/java/com/datastrato/gravitino/catalog/lakehouse/paimon/utils/CatalogUtils.java:
##########
@@ -36,27 +46,80 @@ public class CatalogUtils {
private CatalogUtils() {}
+ @VisibleForTesting
+ public static PaimonBackendCatalogWrapper loadCatalogBackend(PaimonConfig
paimonConfig) {
+ Map<String, String> allConfig = paimonConfig.getAllConfig();
+ AuthenticationConfig authenticationConfig = new
AuthenticationConfig(allConfig);
+ if (authenticationConfig.isSimpleAuth()) {
+ return new
PaimonBackendCatalogWrapper(loadCatalogBackendWithSimpleAuth(paimonConfig),
null);
+ } else if (authenticationConfig.isKerberosAuth()) {
+ Configuration configuration = new Configuration();
+ allConfig.forEach(configuration::set);
+ configuration.set(HADOOP_SECURITY_AUTHORIZATION, "true");
+ configuration.set(HADOOP_SECURITY_AUTHENTICATION, "kerberos");
+
+ try {
+ KerberosClient kerberosClient = new KerberosClient(allConfig,
configuration);
+ File keytabFile =
+
kerberosClient.saveKeyTabFileFromUri(UUID.randomUUID().toString().replace("-",
""));
+ kerberosClient.login(keytabFile.getAbsolutePath());
Review Comment:
https://github.com/apache/gravitino/pull/4075/files#diff-6bbc0b99d3fe56c11f9ba3a5a77bc510fc3a9dcb6769167b4b32ab0b3e92bb6eR51-R54
when `PaimonCatalogOperations` invoke the `close` method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]