diqiu50 commented on code in PR #11628:
URL: https://github.com/apache/gravitino/pull/11628#discussion_r3412944197
##########
flink-connector/flink-common/src/main/java/org/apache/gravitino/flink/connector/iceberg/GravitinoIcebergCatalogFactory.java:
##########
@@ -122,9 +139,78 @@ private Map<String, String>
toIcebergCatalogOptions(Map<String, String> catalogO
&&
!icebergCatalogOptions.containsKey(IcebergPropertiesConstants.ICEBERG_CATALOG_TYPE))
{
icebergCatalogOptions.put(IcebergPropertiesConstants.ICEBERG_CATALOG_TYPE,
catalogBackend);
}
+ injectRestAuth(
+ icebergCatalogOptions,
+ catalogBackend,
+ GravitinoCatalogManager.get().getGravitinoClientConfig());
// The outer Flink factory is `gravitino-iceberg`, but the nested Iceberg
factory still expects
// `catalog-type=iceberg` when building the native Iceberg catalog
instance.
icebergCatalogOptions.put(CommonCatalogOptions.CATALOG_TYPE.key(),
"iceberg");
return icebergCatalogOptions;
}
+
+ /**
+ * Propagates the Gravitino client's authentication to the Iceberg REST
catalog options. A REST
+ * backend connects directly to the Iceberg REST service, bypassing the
Gravitino server's auth
+ * proxy, so the REST client needs its own credentials. Does nothing for
non-REST backends, or
+ * when the user has already configured REST auth explicitly.
+ *
+ * @param icebergCatalogOptions the Iceberg catalog options to inject auth
into
+ * @param catalogBackend the Gravitino Iceberg catalog backend (e.g. {@code
rest}, {@code hive})
+ * @param gravitinoClientConfig the Gravitino client config carrying the
authentication entries
+ */
+ @VisibleForTesting
+ static void injectRestAuth(
Review Comment:
Fixed
--
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]