yuqi1129 commented on code in PR #4075:
URL: https://github.com/apache/gravitino/pull/4075#discussion_r1670018316
##########
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:
When will we close the `kerberosClient` and release the resource?
--
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]