nastra commented on code in PR #18716:
URL: https://github.com/apache/iceberg/pull/18716#discussion_r4663627845


##########
gcp/src/main/java/org/apache/iceberg/gcp/gcs/OAuth2RefreshCredentialsHandler.java:
##########
@@ -104,7 +123,18 @@ private void checkCredential(Credential gcsCredential, 
String gcsOauth2Token) {
   }
 
   public static OAuth2RefreshCredentialsHandler create(Map<String, String> 
properties) {
-    return new OAuth2RefreshCredentialsHandler(properties);
+    return new OAuth2RefreshCredentialsHandler(properties, null);
+  }
+
+  /**
+   * Creates a handler for the storage client of the given prefix. When the 
catalog returns more
+   * than one GCS credential, the handler uses the one with the longest prefix 
that the storage
+   * prefix starts with.
+   */
+  public static OAuth2RefreshCredentialsHandler create(
+      Map<String, String> properties, String storagePrefix) {
+    Preconditions.checkArgument(null != storagePrefix, "Invalid storage 
prefix: null");

Review Comment:
   I'm not sure we would want to check this here. Isn't the check in L94 enough?



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