manuzhang commented on code in PR #14447:
URL: https://github.com/apache/iceberg/pull/14447#discussion_r2486785331


##########
gcp/src/main/java/org/apache/iceberg/gcp/gcs/PrefixedStorage.java:
##########
@@ -67,15 +74,41 @@ class PrefixedStorage implements AutoCloseable {
             // Google Cloud APIs default to automatically detect the 
credentials to use, which is
             // in most cases the convenient way, especially in GCP.
             // See javadoc of 
com.google.auth.oauth2.GoogleCredentials.getApplicationDefault()
+
+            // Configure authentication based on available properties
             if (gcpProperties.noAuth()) {
               // Explicitly allow "no credentials" for testing purposes
               builder.setCredentials(NoCredentials.getInstance());
-            }
-
-            if (gcpProperties.oauth2Token().isPresent()) {
+            } else if (gcpProperties.oauth2Token().isPresent()) {
               this.closeableGroup = new CloseableGroup();
               builder.setCredentials(
                   
GCPAuthUtils.oauth2CredentialsFromGcpProperties(gcpProperties, closeableGroup));
+            } else if (gcpProperties.impersonateServiceAccount().isPresent()) {

Review Comment:
   Is this change tested?



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