adutra commented on code in PR #3729:
URL: https://github.com/apache/polaris/pull/3729#discussion_r2799499439


##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRESTExternalCatalogFactory.java:
##########
@@ -38,6 +41,8 @@
 @Identifier(ConnectionType.ICEBERG_REST_FACTORY_IDENTIFIER)
 public class IcebergRESTExternalCatalogFactory implements 
ExternalCatalogFactory {
 
+  public static final String HEADER_PREFIX = "header.";
+

Review Comment:
   ```suggestion
   ```



##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRESTExternalCatalogFactory.java:
##########
@@ -50,13 +55,19 @@ public Catalog createCatalog(
     }
 
     SessionCatalog.SessionContext context = 
SessionCatalog.SessionContext.createEmpty();
+
     RESTCatalog federatedCatalog =
         new RESTCatalog(
             context,
-            (config) ->
-                HTTPClient.builder(config)
-                    .uri(config.get(org.apache.iceberg.CatalogProperties.URI))
-                    .build());
+            (config) -> {
+              return HTTPClient.builder(config)
+                  .withHeaders(
+                      extractPrefixMap(
+                          
icebergConfig.asIcebergCatalogProperties(polarisCredentialManager),
+                          HEADER_PREFIX))
+                  .uri(config.get(URI))
+                  .build();
+            });

Review Comment:
   Actually there is a much simpler way:
   
   ```suggestion
               (config) ->
                   HTTPClient.builder(config)
                       
.uri(config.get(org.apache.iceberg.CatalogProperties.URI))
                       .withHeaders(RESTUtil.configHeaders(config))
                       .build());
   ```



-- 
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]

Reply via email to