DerGut commented on code in PR #2920:
URL: https://github.com/apache/iceberg-rust/pull/2920#discussion_r3779321067


##########
crates/catalog/rest/src/catalog.rs:
##########
@@ -419,6 +419,51 @@ struct RestClient {
 }
 
 impl RestClient {
+    async fn init(
+        user_config: &RestCatalogConfig,
+        auth_manager: Arc<dyn AuthManager>,
+    ) -> Result<Self> {
+        let http_client = HttpClient::new(user_config)?;
+        // The init session lives only for the config handshake, so a
+        // manager whose session guards a one-shot resource can release
+        // it before deriving the catalog session.
+        let catalog_config = {
+            let init_session = auth_manager
+                .init_session(
+                    &http_client.without_auth_session(),
+                    &RestSessionCatalog::auth_props(user_config),
+                )
+                .await?;
+            RestSessionCatalog::load_config(

Review Comment:
   I'm leaning towards moving the two functions 
`RestSessionCatalog::auth_props` and `RestSessionCatalog::load_config` over to 
the `RestClient` too.
   
   They're only used in the `RestClient::init` and aren't part of the catalog 
API (not part of the `Catalog` trait).



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to