amogh-jahagirdar commented on code in PR #12591:
URL: https://github.com/apache/iceberg/pull/12591#discussion_r2023775261


##########
core/src/main/java/org/apache/iceberg/io/SupportsStorageCredentials.java:
##########
@@ -0,0 +1,28 @@
+/*
+ * 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.iceberg.io;
+
+import java.util.List;
+
+public interface SupportsStorageCredentials {

Review Comment:
   Could we add some JavaDocs on the interface? Don't think it's required on 
the actual interface methods since those are self explanatory, but something at 
the interface at level like "This interface is intended as an extension for 
FileIO implementations to be able to provide and retrieve storage credentials"



##########
core/src/main/java/org/apache/iceberg/rest/responses/LoadTableResponse.java:
##########
@@ -80,7 +81,24 @@ public TableMetadata tableMetadata() {
   }
 
   public Map<String, String> config() {
-    return config != null ? config : ImmutableMap.of();
+    Map<String, String> conf = config != null ? config : ImmutableMap.of();
+    List<Credential> storageCredentials = credentials();
+    if (!storageCredentials.isEmpty()) {
+      List<Credential> creds = Lists.newLinkedList(storageCredentials);
+      for (Credential credential : storageCredentials) {
+        // only keep the credentials with the longest prefix
+        creds.removeIf(
+            cred ->
+                credential.prefix().length() > cred.prefix().length()
+                    && credential.prefix().startsWith(cred.prefix()));
+      }

Review Comment:
   Got it, the scope of the PR is just to handle passing through the 
credentials.



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