HonahX commented on code in PR #2736:
URL: https://github.com/apache/polaris/pull/2736#discussion_r2411493121


##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/io/AccessConfigProvider.java:
##########
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.polaris.service.catalog.io;
+
+import jakarta.annotation.Nonnull;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import java.util.Optional;
+import java.util.Set;
+import org.apache.iceberg.TableMetadata;
+import org.apache.iceberg.catalog.TableIdentifier;
+import org.apache.polaris.core.context.CallContext;
+import org.apache.polaris.core.entity.PolarisEntity;
+import org.apache.polaris.core.persistence.MetaStoreManagerFactory;
+import org.apache.polaris.core.persistence.PolarisResolvedPathWrapper;
+import org.apache.polaris.core.storage.AccessConfig;
+import org.apache.polaris.core.storage.PolarisStorageActions;
+import org.apache.polaris.core.storage.StorageUtil;
+import org.apache.polaris.core.storage.cache.StorageCredentialCache;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Provides temporary, scoped credentials for accessing table data in object 
storage (S3, GCS, Azure
+ * Blob Storage).
+ *
+ * <p>This provider decouples credential vending from catalog implementations, 
and should be the
+ * primary entrypoint to get sub-scoped credentials for accessing table data.
+ */
+@ApplicationScoped

Review Comment:
   > In general @ApplicationScoped does not have to be stateless 🙂 it is only 
restricted to one instance per application runtime.
   
   Yeah, I actually mean more of "request state agnostic", sorry for the 
confusion.
   
   > BCR
   
   Although we do not offer guarantee for interfaces other than our api spec, 
it may be still good to do a dev mailing list notification on interface changes 
like the metaStoreManager and persistence, so that the downstream maintainer 
and vendor could exercise the
   ```
   Maintainers of downstream projects are encouraged to join Polaris mailing 
lists to monitor project changes, suggest improvements, and engage with the 
Polaris community in case of specific compatibility concerns.
   ```
   
   I expect the refactoring on `loadPolarisStorageIntegration()` will be large 
so it better to be in a separate PR anyway to make it easier for reviewer. 
Given both, how about making this in a follow-up, both to control the size of 
the PR and make it easier for other maintainer to evaluate any compatibility 
concerns?
   
   The current PR IMHO still has value that separate the logic 
`getAccessConfig` out and unify the call path, so that subsequent small 
refactoring to update `DefaultFileIOFactory` could happen in parallel to the 
metastoreManager refactoring. And we could always update the 
`AccessConfigProvider` (changing the scope, rename) as needed. WDYT 🙂
   
   



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