danielcweeks commented on code in PR #10753:
URL: https://github.com/apache/iceberg/pull/10753#discussion_r1826339673


##########
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java:
##########
@@ -378,7 +289,8 @@ public List<TableIdentifier> listTables(SessionContext 
context, Namespace ns) {
               paths.tables(ns),
               queryParams,
               ListTablesResponse.class,
-              headers(context),
+              ImmutableMap.of(),
+              authManager.contextualSession(context, catalogAuth),

Review Comment:
   (bear in mind this isn't fully fleshed out)
   
   We're exposing a lot of the mechanics of how we do auth as opposed to 
forcing it through an API path that ensures use of the auth.  Consider an 
alternative where we have to get at the client through the auth manager/session:
   
   ```java
   authManager.clientForSession(context, catalogAuth) // Returns a wrapped 
RESTClient
               .get(
                 paths.tables(ns),
                 queryParams,
                 ListTablesResponse.class,
                 configHeaders,
                 ErrorHandlers.namespaceErrorHandler());
   ```
   
   If requests are forced through the session, then it's more explicit.  It 
just feels like we're doing a lot of hand-crafting.



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