gh-yzou commented on code in PR #12655:
URL: https://github.com/apache/iceberg/pull/12655#discussion_r2027459032


##########
core/src/main/java/org/apache/iceberg/rest/RESTCatalog.java:
##########
@@ -65,7 +68,14 @@ public RESTCatalog(Function<Map<String, String>, RESTClient> 
clientBuilder) {
   public RESTCatalog(
       SessionCatalog.SessionContext context,
       Function<Map<String, String>, RESTClient> clientBuilder) {
-    this.sessionCatalog = new RESTSessionCatalog(clientBuilder, null);
+    this(context, clientBuilder, AuthManagers::loadAuthManager);
+  }
+
+  public RESTCatalog(
+      SessionCatalog.SessionContext context,
+      Function<Map<String, String>, RESTClient> clientBuilder,
+      BiFunction<String, Map<String, String>, AuthManager> authManagerBuilder) 
{

Review Comment:
   @danielcweeks I have a graph here to describing the architecture of our 
Polaris spark client, hope it could make things more clear.
   <img width="530" alt="Screenshot 2025-04-03 at 10 18 55 AM" 
src="https://github.com/user-attachments/assets/9156a651-51a0-4d08-b995-077599f9278b";
 />
   
   As you can see, we want the same AuthManager injected into both Iceberg 
RestCatalog and Polaris RestCatalog. I am currently testing with @adutra 's 
change, but i am definitely open to other options could help achieve the 
similar effect.
   
   The Polaris Client relies very heavily on Iceberg Client, ideally, we would 
like reuse a lot of things across the two REST Client, such as the result of 
the getConfig call and authentication. However, I don't think we can get all of 
them in one shot, getting the authentication reuse could one big step for us. 



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to